Skip to content

Commit

Permalink
no token found in the application-manager SA secret for OCP V4.16 wit…
Browse files Browse the repository at this point in the history
…h AWS provider (#399)

Signed-off-by: Xiangjing Li <xiangli@redhat.com>
  • Loading branch information
xiangjingli authored May 22, 2024
1 parent 6c99bb5 commit 1fad32b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pkg/controller/spoketoken/spoke_token_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,11 @@ func (r *ReconcileAgentToken) getServiceAccountTokenSecret() string {
}

anno := dockerSecret.GetAnnotations()
klog.Info("found the application-manager-token secret " + anno["openshift.io/token-secret.name"])

return anno["openshift.io/token-secret.value"]
if anno["openshift.io/token-secret.value"] > "" {
klog.Info("found the application-manager-token secret " + anno["openshift.io/token-secret.name"])
return anno["openshift.io/token-secret.value"]
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/helmrelease/utils/helmrepoutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func DownloadGitRepo(configMap *corev1.ConfigMap,
klog.Error(err, "- Failed to remove all: ", destRepo)
}

err = os.MkdirAll(destRepo, os.ModePerm)
err = os.MkdirAll(destRepo, os.ModePerm) // #nosec G301
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func GenerateServerCerts(dir string) error {
}

if _, err := os.Stat(dir); os.IsNotExist(err) {
err = os.MkdirAll(dir, os.ModePerm)
err = os.MkdirAll(dir, os.ModePerm) // #nosec G301
if err != nil {
klog.Error(err, "Failed to make directory ", dir)
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/gitrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func getConnectionOptions(cloneOptions *GitCloneOption, primary bool) (connectio
klog.Warning(err, "Failed to remove directory ", cloneOptions.DestDir)
}

err = os.MkdirAll(cloneOptions.DestDir, os.ModePerm)
err = os.MkdirAll(cloneOptions.DestDir, os.ModePerm) // #nosec G301

if err != nil {
return nil, err
Expand Down

0 comments on commit 1fad32b

Please sign in to comment.