Procházet zdrojové kódy

Merge pull request #1216 from external-secrets/fix/vault-validate

fixing panic if using JWT with KubernetesServiceAccountToken
paul-the-alien[bot] před 4 roky
rodič
revize
9f97dd009b
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      pkg/provider/vault/vault.go

+ 4 - 1
pkg/provider/vault/vault.go

@@ -605,7 +605,10 @@ func (v *client) Validate() (esv1beta1.ValidationResult, error) {
 		if v.store.Auth.Ldap != nil && v.store.Auth.Ldap.SecretRef.Namespace == nil {
 			return esv1beta1.ValidationResultUnknown, nil
 		}
-		if v.store.Auth.Jwt != nil && v.store.Auth.Jwt.SecretRef.Namespace == nil {
+		if v.store.Auth.Jwt != nil && v.store.Auth.Jwt.SecretRef != nil && v.store.Auth.Jwt.SecretRef.Namespace == nil {
+			return esv1beta1.ValidationResultUnknown, nil
+		}
+		if v.store.Auth.Jwt != nil && v.store.Auth.Jwt.KubernetesServiceAccountToken != nil && v.store.Auth.Jwt.KubernetesServiceAccountToken.ServiceAccountRef.Namespace == nil {
 			return esv1beta1.ValidationResultUnknown, nil
 		}
 		if v.store.Auth.Cert != nil && v.store.Auth.Cert.SecretRef.Namespace == nil {