Skip to content

Commit

Permalink
Update script logic to modify 'spec.project' to 'kubeaid' managed app…
Browse files Browse the repository at this point in the history
…s for resources with kind 'Application'
  • Loading branch information
mdasif authored and ashish1099 committed Dec 9, 2024
1 parent bd7b330 commit 912eaa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/update-kubeaid-argocd-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_label_to_high_priority_app() {
local found=false

# List of critical priority apps
critical_priority_apps=("sealed-secrets" "argo-cd" "cert-manager" "cilium" "cluster-autoscaler" "haproxy" "keycloakx" "traefik" "teleport-cluster" "kube-prometheus")
critical_priority_apps=("sealed-secrets" "argo-cd" "cert-manager" "cilium" "cluster-autoscaler" "haproxy" "keycloakx" "traefik" "teleport-cluster" "prometheus-adapter")

# Loop through the list and check for the app
for item in "${critical_priority_apps[@]}"; do
Expand Down Expand Up @@ -75,7 +75,7 @@ for label_name in "${LABELS_NAMES[@]}"; do
yq eval -i "(.spec.sources[] | select(.repoURL | test(\"kubeaid\\.git|k8id\\.git|KubeAid\\.git\")) | .targetRevision) = \"$NEW_TARGET_REVISION\"" "$file_path"

# Use yq to update project for kubeAid managed apps
yq eval -i "(.spec.project ) = \"kubeaid\"" "$file_path"
yq eval -i '( select(.kind | test("Application")) | .spec.project) = "kubeaid"' "$file_path"

# Use yq to add custom labels
yq eval -i ".metadata.labels.\"kubeaid.io/version\" = \"$NEW_TARGET_REVISION\" | .metadata.labels.\"kubeaid.io/managed-by\" = \"kubeaid\"" "$file_path"
Expand Down

0 comments on commit 912eaa3

Please sign in to comment.