Skip to content

[k8s] Can't prune the custom resource when there are multiple supported api version #6148

@ffjlabo

Description

@ffjlabo

What happened:
Custom resources that support multiple API versions may not be pruned.

Here is the example External Secrets (helm chart: v0.16.1)
This version supports both v1beta1 and v1 as API versions. Also, I deployed v1beta1 External Secret resource.
Then, I removed the resource definition from the git, but piped didn't prune it.

Image

Image

apiVersion: pipecd.dev/v1beta1
kind: KubernetesApp
spec:
  name: secretstores
  labels:
    env: dev
  quickSync:
    prune: true
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
  name: fake
  namespace: external-secrets
spec:
  provider:
    fake:
      data:
      - key: "/foo/bar"
        value: "HELLO1"
        version: "v1"
      - key: "/foo/bar"
        value: "HELLO2"
        version: "v2"
% kubectl get externalsecret -n external-secrets
NAME   STORETYPE     STORE   REFRESH INTERVAL   STATUS         READY
fake   SecretStore   fake    1h                 SecretSynced   True

What you expected to happen:

I expect to be able to prune all of the supported resources.

How to reproduce it:

Environment:

  • piped version:
  • control-plane version:
  • Others:

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions