Skip to content

BUG: Cannot applt post render patch for PVCs #1768

@Frusoz

Description

@Frusoz

Problem Description

I'm trying to apply this patch to multiple PVCs but the add-on controller throws some errors and the label is not applied.

patches:
  - target:
      group: ""
      version: v1
      kind: PersistentVolumeClaim
      name: "data-thanos-.*"
    patch: |
      - op: add
        path: /metadata/labels/velero.io~1exclude-from-backup
        value: "true"

or

patches:
    - target:
        group: ""
        version: v1
        kind: PersistentVolumeClaim
        name: "data-thanos-.*"
      patch: |
        apiVersion: v1
        kind: PersistentVolumeClaim
        metadata:
          labels:
            velero.io/exclude-from-backup: "true"

System Information

CLUSTERAPI VERSION: operator, 0.26.0
SVELTOS VERSION: v1.8.0
KUBERNETES VERSION: v1.36.0

Logs

I0508 08:41:02.440115       1 handlers_helm.go:1944] "failed to upgrade: error while running post render on files: trouble configuring builtin PatchTransformer with config: \npatch: |\n  apiVersion: v1\n  kind: PersistentVolumeClaim\n  metadata:\n    labels:\n      [velero.io/exclude-from-backup](http://velero.io/exclude-from-backup): \"true\"\ntarget:\n  kind: PersistentVolumeClaim\n  name: data-thanos-.*\n  version: v1\n: unable to parse SM or JSON patch from [patch: "apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  labels:\n    velero.io/exclude-from-backup: \"true\""]"

Metadata

Metadata

Assignees

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