Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When changing the namespace, the workload remains in the old namespace #5213

Open
ffjlabo opened this issue Sep 17, 2024 · 1 comment
Open
Labels
kind/bug Something isn't working

Comments

@ffjlabo
Copy link
Member

ffjlabo commented Sep 17, 2024

What happened:

When changing the namespace, the workload remains in the old namespace.

Change_ns_to_test2_by_ffjlabo_·Pull_Request__227·_ca-dp_ffjlabo-dev (1)

ca-tech-pipecd-support__Channel__-_CyberAgent_-_1_new_item_-_Slack

before

% kubectl get deployment -n test simple-hoge                                                               
NAME          READY   UP-TO-DATE   AVAILABLE   AGE
simple-hoge   2/2     2            2           12m

after

% kubectl get deployment -n test2 simple-hoge                                                             
NAME          READY   UP-TO-DATE   AVAILABLE   AGE
simple-hoge   2/2     2            2           7m8s

What you expected to happen:

It would be nice to delete the old resource successfully.

How to reproduce it:

Environment:

  • piped version:
  • control-plane version:
  • Others:
@ffjlabo ffjlabo added the kind/bug Something isn't working label Sep 17, 2024
@ffjlabo
Copy link
Member Author

ffjlabo commented Sep 17, 2024

[Root cause]
Resources in the old namespace cannot be deleted because the namespace is not included in the conditions for searching the deletion target resources.

Inside PipeCD, resources are identified by four types: apiVersion, kind, namespace, and name.
However, based on the live state and the manifest on git, in the pruning phase, the deletion target seems to be searched for only three things except for the namespace.

https://github.com/pipe-cd/pipecd/blob/c0d5b795de2e89ff6d3c1b7221fb2480c094ce72/pkg/app/piped/executor/kubernetes/sync.go#L131C2-L144C3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant