Skip to content

ExternalSecret without target field creates a Secret and deletes it #1233

@cod-r

Description

@cod-r

Hi,

Creating a new ExternalSecret without the target field creates the Kubernetes secret and deletes it immediately and no errors are shown.

This is my yaml:

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: test-postgres
  namespace: test
spec:
  secretStoreRef:
    name: vault-test-backend
    kind: ClusterSecretStore
  refreshInterval: "1h"
  dataFrom:
    - extract:
        key: kv/test/test-secret

Using --watch I can see the k8s Secret being created and deleted immediately.

The workaround is to add an empty target: {} object like:

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: test-postgres
  namespace: test
spec:
  secretStoreRef:
    name: vault-test-backend
    kind: ClusterSecretStore
  refreshInterval: "1h"
  target: {}
  dataFrom:
    - extract:
        key: kv/test/test-secret

Tested with version 0.5.3 and 0.5.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededkind/bugCategorizes issue or PR as related to a bug.triage/supportIndicates an issue that is a support question.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions