Respect helm.sh/resource-policy annotation of remote resource
#8.132 aberto em 15 de mai. de 2020
Métricas do repositório
- Stars
- (29.815 estrelas)
- Métricas de merge de PR
- (Mesclagem média 40d 17h) (48 fundiu PRs em 30d)
Description
The helm.sh/resource-policy: keep annotation is currently only used if it is included in the rendered manifests of the last deployed release. This means that resource policies only apply if the following sequence is followed:
- Add resource policy annotation to resource to be removed from chart
- Run
helm upgradeand wait for completion and success status - Remove resource from chart
- Run
helm upgradeorhelm uninstall
Anecdotally this behavior has been a source of confusion for users; they tend to expect that the annotation is respected as long as it is set on the resource that is live in the target cluster. Ideally this sequence would result in the same behavior as above:
kubectl annotate <type> <name> helm.sh/resource-policy=keep- Remove resource from chart
- Run
helm upgradeorhelm uninstall
If there is a conflict between remote and last deployed state, then I would think remote state should win. We could also choose the more conservative value, but this might be tricky behavior to document and maintain if we add resource policies other than keep and delete over time.