Add a check for the correct secret type

This commit is contained in:
Martin Šalata
2021-04-06 10:07:54 +02:00
parent 6e67d5b87c
commit f098c48dcf
3 changed files with 7 additions and 2 deletions

View File

@@ -1 +1 @@
0.0.9
0.0.10

View File

@@ -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")

View File

@@ -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