Skip to content

ESO - copy secrets from ns to another ns #5832

@cjabrantes

Description

@cjabrantes

Describe the bug
Hi all,

trying to use ESO to sync secrets from a ns to another ns, but i m making a mistake or seems to be a bug.

apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata:
  name: kubernetes
spec:
  provider:
    kubernetes:
      server:
        caProvider:
          type: ConfigMap
          name: kube-root-ca.crt
          namespace: eso  
          key: ca.crt
      auth:
        serviceAccount:
          name: external-secrets
          namespace: eso
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
  name: copy-secrets-pushsecret
  namespace: ns_orig
spec:
  refreshInterval: 1h0m0s
  updatePolicy: Replace
  deletionPolicy: Delete
  secretStoreRefs:
    - name: kubernetes
      kind: ClusterSecretStore 
  selector:
    secret:
      name: regcred
  data:
    - match:
        remoteRef:
          remoteKey: my-regcred  
      metadata:
        apiVersion: kubernetes.external-secrets.io/v1alpha1
        kind: PushSecretMetadata
        spec:
          remoteNamespace: eso

but i m getting:
"error":"could not write remote ref to target secretstore kubernetes: the namespace of the provided object does not match the namespace sent on the request"

Error that is related with remoteNamespace being different namespace, if they are the same , its work and secret is copied to same namespace.

But i guess one important use case is to copy to different namespaces

To Reproduce
Steps to reproduce the behaviour:

Using the previous manifest, with external-secrets:v1.2.1

Expected behavior
Get the secret copied from one ns to another

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docstriage/supportIndicates an issue that is a support question.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions