Skip to content

Commit

Permalink
Ensure resources are not managed by ArgoCD (actions#3540)
Browse files Browse the repository at this point in the history
Remove the "argocd.argoproj.io/instance" label from resources created by the controller. This prevents ArgoCD from pruning and deleting these resources when syncing.

Signed-off-by: kahirokunn <okinakahiro@gmail.com>
  • Loading branch information
kahirokunn committed Jun 5, 2024
1 parent e45ac19 commit 8ff50ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/actions.github.com/resourcebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,5 +759,9 @@ func mergeLabels(base, overwrite map[string]string) map[string]string {
mergedLabels[k] = v
}

// Remove the label to ensure that resources created by this controller are not managed by ArgoCD.
// This prevents ArgoCD from pruning and deleting these resources when syncing.
delete(mergedLabels, "argocd.argoproj.io/instance")

return mergedLabels
}

0 comments on commit 8ff50ee

Please sign in to comment.