Skip to content

Empty secret created when path is set to "" #1092

@budgester

Description

@budgester

When the path is set as

path: ""

Rather then a secret not being found an empty secret is created.

Even if the destination is setup as create: true I would expect it to only create the secret if there is a value to insert.

It should be impossible for a secret to be at an empty path.

apiVersion: v1
items:
- apiVersion: secrets.hashicorp.com/v1beta1
  kind: VaultStaticSecret
  metadata:
    creationTimestamp: "2025-08-06T08:14:35Z"
    finalizers:
    - vaultstaticsecret.secrets.hashicorp.com/finalizer
    generation: 2
    labels:
      app.kubernetes.io/instance: development-obs-loki-app
    name: loki-bucket-chunks
    namespace: obs-loki
    resourceVersion: "82873346"
  spec:
    destination:
      create: true
      name: loki-bucket-chunks
      overwrite: false
      transformation: {}
    hmacSecretData: true
    mount: kv
    path: ""
    refreshAfter: 1h
    type: kv-v2
    vaultAuthRef: loki-oauth
  status:
    lastGeneration: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions