Skip to content

Please add apiVersion and Kind to volumeClaimTemplates (for trivy and wherever else used) #1661

@prezhdarov

Description

@prezhdarov

Please add the full spec of the volumeClaimTemplates when generating sts manifests as partial templates bug CD tools like ArgoCD. Here is the problem:

Helm generates sts manifest that says:

  volumeClaimTemplates:
  -  metadata:
      labels:
       ...
      name: data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
      ...

However, after applying that manifest Kubernetes reports the sts as:

volumeClaimTemplates:
 - apiVersion: v1
   kind: PersistentVolumeClaim
   metadata:
     labels:
       ....
     name: data
   spec:
     accessModes:
     - ReadWriteOnce
     resources:
       ...

And that bugs the whole process.

A workaround for ArgoCD could be:

ignoreDifferences:
  - group: apps
    kind: StatefulSet
    name: harbor-trivy
    jqPathExpressions:
    - .spec.volumeClaimTemplates[]?.apiVersion
    - .spec.volumeClaimTemplates[]?.kind

but this isn't pretty..

Thank you,
Atanas

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions