Skip to content

StatefulSet volumeclaimtemplates added when base did not include it #504

Description

@msau42

This might be caused to #483

I have a StatefulSet spec that doesn't use volumeClaimTemplates, but when I kustomize it with common labels, it adds it to the spec, which causes it to fail validation:

My base spec:

kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: test
spec:
  serviceName: "test"
  replicas: 1
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
    spec:
      containers:
        - name: nginx
          image: nginx

After kustomize:

kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: test
spec:
  serviceName: "test"
  replicas: 1
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
    spec:
      containers:
        - name: nginx
          image: nginx
  volumeClaimTemplates:
    metadata:
      labels:
        app: my-label

Error:

error validating data: ValidationError(StatefulSet.spec.volumeClaimTemplates): invalid type for io.k8s.api.apps.v1.StatefulSetSpec.volumeClaimTemplates: got "map", expected "array"; if you choose to ignore these errors, turn validation off with --validate=false

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiissues for api modulekind/bugCategorizes issue or PR as related to a bug.triage/not-reproducibleIndicates an issue can not be reproduced as described.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions