feat(hooks): never delete CustomResourceDefinitions

Signed-off-by: Jacob LeGrone <git@jacob.work>
pull/6639/head
Jacob LeGrone 5 years ago
parent 34d685f8bf
commit 2d983f27e7
No known key found for this signature in database
GPG Key ID: 5FD0852F235368C1

@ -119,6 +119,11 @@ func (x hookByWeight) Less(i, j int) bool {
// deleteHookByPolicy deletes a hook if the hook policy instructs it to
func (cfg *Configuration) deleteHookByPolicy(h *release.Hook, policy release.HookDeletePolicy) error {
// Never delete CustomResourceDefinitions; this could cause lots of
// cascading garbage collection.
if h.Kind == "CustomResourceDefinition" {
return nil
}
if hookHasDeletePolicy(h, policy) {
resources, err := cfg.KubeClient.Build(bytes.NewBufferString(h.Manifest), false)
if err != nil {

Loading…
Cancel
Save