From fbc17cf9c54804b7087cac7b1e5ecd4f6967d68e Mon Sep 17 00:00:00 2001 From: pasha-codefresh Date: Mon, 27 May 2024 18:41:14 +0300 Subject: [PATCH] fix: crash due to store is nil (#723) Signed-off-by: Pasha Kostohrys --- pkg/argocd/gitcreds.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/argocd/gitcreds.go b/pkg/argocd/gitcreds.go index 46336cf6..2716659e 100644 --- a/pkg/argocd/gitcreds.go +++ b/pkg/argocd/gitcreds.go @@ -8,6 +8,7 @@ import ( "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/argoproj/argo-cd/v2/util/db" + argoGit "github.com/argoproj/argo-cd/v2/util/git" "github.com/argoproj/argo-cd/v2/util/settings" "github.com/argoproj-labs/argocd-image-updater/ext/git" @@ -43,7 +44,7 @@ func getCredsFromArgoCD(wbc *WriteBackConfig, kubeClient *kube.KubernetesClient) if !repo.HasCredentials() { return nil, fmt.Errorf("credentials for '%s' are not configured in Argo CD settings", wbc.GitRepo) } - return repo.GetGitCreds(nil), nil + return repo.GetGitCreds(argoGit.NoopCredsStore{}), nil } // getCredsFromSecret loads repository credentials from secret