kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.18k stars 101 forks source link

Filter unknown custom resources in Delete- and ToggleTask #1552

Closed ANeumann82 closed 4 years ago

ANeumann82 commented 4 years ago

What this PR does / why we need it: For the DeleteTask and ToggleTask we use the enhance process - but this fails when the resource to delete is a custom resource for a CRD which is not installed in the cluster. This is especially problematic for the ToggleTask which is often used to guard deployment of features.

We need to filter the rendered templates - If one of them is of an unknown type, we shouldn't try to delete it as it can't be there anyway.

This PR splits the convert functionality from the enhancer and skips enhancing for the DeleteTask, then filters the resources for unknown types

Fixes #1547 Signed-off-by: Andreas Neumann aneumann@mesosphere.com