Skip to content

Commit

Permalink
fix: Image updater changes git write back file (#970) (#980)
Browse files Browse the repository at this point in the history
Signed-off-by: Cheng Fang <[email protected]>
  • Loading branch information
chengfang authored Dec 20, 2024
1 parent 2da386b commit 57138ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/argocd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ func getWriteBackConfig(app *v1alpha1.Application, kubeClient *kube.KubernetesCl
}

func parseDefaultTarget(appNamespace string, appName string, path string, kubeClient *kube.KubernetesClient) string {
if (appNamespace == kubeClient.Namespace) || (appNamespace == "") {
// when running from command line and argocd-namespace is not set, e.g., via --argocd-namespace option,
// kubeClient.Namespace may be resolved to "default". In this case, also use the file name without namespace
if appNamespace == kubeClient.Namespace || kubeClient.Namespace == "default" || appNamespace == "" {
defaultTargetFile := fmt.Sprintf(common.DefaultTargetFilePatternWithoutNamespace, appName)
return filepath.Join(path, defaultTargetFile)
} else {
Expand Down

0 comments on commit 57138ca

Please sign in to comment.