Skip to content

ESO pod crashes if the secret referenced in the PushSecret has no data #3294

@ma-ble

Description

@ma-ble

Describe the bug
If you create a PushSecret that references a secret without a data key, the ESO pod crashes with the error message

{"level":"info","ts":1711105214.26202,"msg":"Observed a panic in reconciler: assignment to entry in nil map","controller":"pushsecret","controllerGroup":"external-secrets.io","controllerKind":"PushSecret","PushSecret":{"name":"my-secret","namespace":"test"},"namespace":"test","name":"my-secret","reconcileID":"566de87-9b33-403c-9006-adbece35940a"}
panic: assignment to entry in nil map [recovered]
	panic: assignment to entry in nil map

To Reproduce
Steps to reproduce the behavior:

  1. Install ESO with Version v0.9.13
  2. Create Secret without data field
apiVersion: v1
kind: Secret
metadata:
  name: my-secret
  namespace: test
  1. Create PushSecret
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
  name: my-secret
  namespace: test
spec:
  deletionPolicy: Delete
  refreshInterval: 10s
  secretStoreRefs:
    - name: build
      kind: SecretStore
  selector:
    secret:
      name: my-secret
  template:
    data:
      test: "{{ .test }}"
  data:
    - match:  
        secretKey: test
        remoteRef:
          remoteKey: test
          property: test

Expected behavior
My expectation is that the pod will not crash when a secret referenced by a PushSecret has no data field.

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions