Closed manno closed 1 month ago
Rancher Version: 2.9-head and Fleet version: 0.10.4-rc.1
GitRepo
using fleet.yaml
which doesn't contains {crds: keep: true}
option in it.(fleet.yaml)helm.sh/resource-policy: keep
annotation is present.{crds: keep: true/false}
.The annotation doesn't get removed after adding or removing {crds: keep: true/false}.
I agree, our code doesn't seem able to remove that policy. However, the example you picked has the policy already in their template folder: https://github.com/argoproj/argo-helm/blob/main/charts/argo-workflows/templates/crds/argoproj.io_cronworkflows.yaml#L7-L9
So adding it from fleet does nothing and deletion isn't implemented. Do we want to delete existing "keep" policies from the charts template, if deleteCRD is true? I think yes?
Followed below scenario's considering the deleteCRDResources
values and annotation behavior.
GitRepo
which installs CRD's along with the application.(Used this fleet.yaml file.)deleteCRDResources: true
must be present in the fleet.yaml
.helm.sh/resource-policy: keep
is absent.GitRepo
which installs CRD's along with the application.(Used this fleet.yaml file.)deleteCRDResources: false
in the fleet.yaml
.helm.sh/resource-policy: keep
is present.If we don't want to see annotation helm.sh/resource-policy: keep
then we have to use the deleteCRDResource
option with true
value in fleet.yaml
.
Backport of #2716
Is there an existing issue for this?
Current Behavior
helm/resource-policy: keep
, but we could not figure out why. By searching the source code of their helm charts, we can only see the crds are annotated with such setting.Using
argo-workflows:0.41.14
as an example, the only resources annotated withhelm.sh/resource-policy: keep
are those under/templates/crds
: https://github.com/search?q=repo%3Aargoproj%2Fargo-helm+path%3A%2Fcharts%2Fargo-workflows%2F**+%22resource-policy%22&type=codeBut when installing via fleet config:
The resulted deployments are annotated with
helm.sh/resource-policy
set tokeep
Expected Behavior
The workloads are not annotated with
helm.sh/resource-policy: keep
unless it is defined in helm charts.Steps To Reproduce
The sample fleet yaml config can be located at https://github.com/aDisplayName/bugsamplecode/tree/main/20240808
Environment
Logs
No response
Anything else?
No response