mirror of
https://github.com/ysoftdevs/imagepullsecret-injector.git
synced 2026-01-15 16:23:45 +01:00
Add a check for the correct secret type
This commit is contained in:
@@ -157,6 +157,11 @@ func (whsvr *WebhookServer) ensureSecrets(ar *v1beta1.AdmissionReview) error {
|
||||
glog.Errorf("Could not fetch source secret %s in namespace %s: %v", whsvr.config.sourceImagePullSecretName, currentNamespace, err)
|
||||
return err
|
||||
}
|
||||
if sourceSecret.Type != corev1.SecretTypeDockerConfigJson {
|
||||
err := fmt.Errorf("source secret %s in namespace %s exists, but has incorrect type (is %s, should be %s)", whsvr.config.sourceImagePullSecretName, currentNamespace, sourceSecret.Type, corev1.SecretTypeDockerConfigJson)
|
||||
glog.Errorf("%v", err)
|
||||
return err
|
||||
}
|
||||
glog.Infof("Source secret found")
|
||||
|
||||
glog.Infof("Looking for the existing target secret")
|
||||
|
||||
@@ -20,4 +20,4 @@ version: 0.0.18
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 0.0.9
|
||||
appVersion: 0.0.10
|
||||
|
||||
Reference in New Issue
Block a user