pipe-cd / pipe-cd/pipecd

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

Open
#6,148 0 comments 0 reactions 1 assignee View on GitHub

@ffjlabo is already working on this.

Since Aug 22, 2025.

kind/bug
Dominant language
Go
Stars
1.4k
Forks
364
Avg merge
1d 4h
Merged PRs (30d)
84

Description

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.