Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for secrets only if service account pull secrets exist #377

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1235,21 +1235,15 @@ func ServiceAccountPullSecretExists(ba common.BaseComponent, client client.Clien
return getErr
}
secrets := sa.ImagePullSecrets
found := false
if len(secrets) > 0 {
// if this is our service account there will be one image pull secret
// For others there could be more. either way, just use the first?
sName := secrets[0].Name
err := client.Get(context.TODO(), types.NamespacedName{Name: sName, Namespace: ns}, &corev1.Secret{})
if err != nil {
return err
saErr := errors.New("Service account " + saName + " isn't ready. Reason: " + err.Error())
return saErr
}
found = true

}
if !found {
saErr := errors.New("Service account " + saName + " isn't ready")
return saErr
}
return nil
}
Expand Down