operator-lifecycle-manager icon indicating copy to clipboard operation
operator-lifecycle-manager copied to clipboard

adding optional fields to CRD without incrementing api version

Open ctrought opened this issue 3 years ago • 2 comments

Is there currently any way to have OLM update a CRD during an operator install where CRD schema has changed, even though the api version remains the same?

Use case would be for adding optional fields and retaining the same API version. There could be multiple version of the operator installed relying on the CRD, some that support those optional fields and older ones that don't. But they should still be able to consume the same CRD version I would think.

In my test, OLM detects the pre-existing CRD is already installed and it does not get updated. Is that expected? Thanks!

ctrought avatar May 20 '22 18:05 ctrought

Looks like it's probably a result of multiple versions of the operator being installed in the cluster. Installing an older version of an operator can overwrite the CRD provided by the newer version.

I don't know how best the tenancy problem is resolved, but one possible solution would be for OLM to track the version of the operator which the current CRD was provided by. To support optional schema changes without incrementing API versions, olm might need to track which version of an operator provided the current installed version of the CRD, and if it was provided by a newer version than the one being installed do not apply/overwrite.

ctrought avatar May 23 '22 16:05 ctrought