-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
- Using version ghcr.io/external-secrets/external-secrets:v0.9.18
Every time I try to create a SecretStore (namespaced one), I get the error
admission webhook "validate.secretstore.external-secrets.io" denied the request: namespace not allowed with namespaced SecretStore
As an example, one yaml I've tried to apply was:
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
name: <name>
namespace: <namespace1>
spec:
provider:
kubernetes:
auth:
serviceAccount:
name: external-secrets-sa
namespace: <namespace1>
remoteNamespace: <namespace2>
server:
caProvider:
key: ca.crt
name: kube-root-ca.crt
namespace: <namespace1>
type: ConfigMap
url: 'https://kubernetes.default'
I've checked that it is raised due to the following lines:
external-secrets/pkg/utils/utils.go
Lines 366 to 378 in 06e1342
| // ValidateSecretSelector just checks if the namespace field is present/absent | |
| // depending on the secret store type. | |
| // We MUST NOT check the name or key property here. It MAY be defaulted by the provider. | |
| func ValidateSecretSelector(store esv1beta1.GenericStore, ref esmeta.SecretKeySelector) error { | |
| clusterScope := store.GetObjectKind().GroupVersionKind().Kind == esv1beta1.ClusterSecretStoreKind | |
| if clusterScope && ref.Namespace == nil { | |
| return errRequireNamespace | |
| } | |
| if !clusterScope && ref.Namespace != nil { | |
| return errNamespaceNotAllowed | |
| } | |
| return nil | |
| } |
The line 374 seems to me as a bug, since clusterScope will be false whenever the resource type is namespaced, and therefore it should have a related namespace.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels