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
prune cluster scoped resources does not work when specify namespace in app config #4269
Comments
Reproduced on QuickSync like this↓ (name: pod-reader) [result] before
after
[sample]
|
This might happen because the resource key in the live resource differs from the resource used when pruning.
|
As this PR #3991, all of the resources for the application belong to the namespace set on the |
Root cause:the resource key stored as livestate and the one on the annotation of actual k8s resource are different values, but actually, they are compared as if they are equal. The Code:pipecd/pkg/app/piped/platformprovider/kubernetes/applier.go Lines 161 to 163 in 7b471d7
DetailsThe resource key stored as livestate
More details
The resource key on the annotation of actual k8s resource
More details
Example:Consider the case to apply
|
Solution candidates The point is whether to fix or not as if they are equal.
In both cases, there is no user effect. |
Other stagesBaselineload manifests in the same way with K8S_SYNC stage indirectly.
So the resourceKey is based on the k8s resource manifest, then fixed by app.pipecd.yaml (spec.input.namespace). then, store it and use it on the BASELINE_CLEAN |
📝 the namespace of the resourceKey is pipecd/pkg/app/piped/platformprovider/kubernetes/loader.go Lines 90 to 91 in 7b1103d
|
There are two problems
So I'll resolve 1 in this issue, and later will try 2. |
📝 Prepared the issue for 2 |
What happened:
prune cluster scoped resources (such as
clusterrole
) does not work when specify namespace in app configWhat you expected to happen:
How to reproduce it:
Environment:
piped
version:control-plane
version:The text was updated successfully, but these errors were encountered: