operator-framework / kubectl-operator

Manage Kubernetes Operators from the command line
https://operatorframework.io/
Apache License 2.0
129 stars 37 forks source link

fix(uninstall): rely on OLM to delete operator resources via CSV deletion #27

Closed varshaprasad96 closed 4 years ago

varshaprasad96 commented 4 years ago

When multiple install plans are present for single operator, select the resources of install plan containing the installed CSV while uninstalling the operator.

joelanford commented 4 years ago

Based on some discussion with the OLM team, I think we can immediately improve on solving this problem by ignoring the install plan altogether and deleting only the CSV and CRDs.

We can lookup the CSV using Name: sub.Status.InstalledCSV, Namespace: sub.GetNamespace().

And then lookup the CRDs from csv.Status.RequirementStatus filtering on req.Kind == crdKind.