feat(dao,used-by-cmd): check imagePullSecrets as well (#2964)

mine
Jonas Badstübner 2024-11-16 18:20:19 +01:00 committed by GitHub
parent 92ff64eac3
commit 4c4381b834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -334,6 +334,12 @@ func hasSecret(f Factory, spec *v1.PodSpec, ns, name string, wait bool) (bool, e
}
}
for _, imagePullSecret := range spec.ImagePullSecrets {
if imagePullSecret.Name == name {
return true, nil
}
}
saName := spec.ServiceAccountName
if saName != "" {
o, err := f.Get("v1/serviceaccounts", client.FQN(ns, saName), wait, labels.Everything())