Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Cleaner: Use only CRDs with storage = true #1295

Closed
ZupkaPomidorowa opened this issue Feb 27, 2023 · 0 comments · Fixed by #1296
Closed

Cleaner: Use only CRDs with storage = true #1295

ZupkaPomidorowa opened this issue Feb 27, 2023 · 0 comments · Fixed by #1296
Assignees

Comments

@ZupkaPomidorowa
Copy link

ZupkaPomidorowa commented Feb 27, 2023

Description

Currently, to find the objects to remove, the cleaner iterates over all defined versions of a CRD.
For example: v1alpha1, v1beta1, v1 etc.

The cleaner then uses every CRD version to list the objects and then tries to remove them.
That approach breaks if there is not a Conversion Webhook anymore, which is often the case during cleanup phase.
This is because the Kyma component, including the controller (operator), along with the defined Conversion Webhook may have been undeployed already (see: #1193).

To be able to list objects without the Conversion Webhook, the cleaner should only list objects from the CRD version marked with storage = true.
This requires that the same version, and only that version, is listed in the CRD's status.storedVersions field.

NOTE
Proper migration of the CRD versions is beyond the scope of the cleaner.
As explained in the docs it is normal that more than one version is actually stored during API migration, as reflected in the CRD's status.storedVersions field.
The cleaner, if invoked in a two-stored-versions scenario, will probably fail!
It is because there are still some CR instances stored using the old version, but the cleaner will try to access these using the new version, marked with storage = true. And there's no Conversion Webhook available.

Expected result

Cleaner doesn't try to list objects from an old CRD version.

Actual result

Cleaner fails to list objects from an old CRD version, because there's no Conversion Webhook anymore.

Steps to reproduce

TBD.

Troubleshooting
n/a

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants