Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add an updated version of a CRD and encountering problems #3342

Open
jmontleon opened this issue Jul 10, 2024 · 0 comments
Open

Trying to add an updated version of a CRD and encountering problems #3342

jmontleon opened this issue Jul 10, 2024 · 0 comments

Comments

@jmontleon
Copy link

Type of question

Correct practices when adding a new version to a CRD.

Question

We have a CRD, addons.tackle.konveyor.io. Up until now we have only had v1alpha1. However we're looking to rework this and add a v1alpha2.

What did you expect to see?
The ability for v1alpha1 and v1alpha2 CRs to co-exist.

What did you see instead? Under which circumstances?
When trying to upgrade the operator from an older version to the new version with the new CRD version the OLM UI is reporting:

error validating existing CRs against new CRD's schema for "addons.tackle.konveyor.io": error validating tackle.konveyor.io/v1alpha2, Kind=Addon "openshift-mta/analyzer": updated validation is too restrictive: [].spec.container: Required value

Along with a similar message on the InstallPlan

  - lastTransitionTime: "2024-07-10T16:07:57Z"
    lastUpdateTime: "2024-07-10T16:07:57Z"
    message: 'error validating existing CRs against new CRD''s schema for "addons.tackle.konveyor.io":
      error validating tackle.konveyor.io/v1alpha2, Kind=Addon "openshift-mta/analyzer":
      updated validation is too restrictive: [].spec.container: Required value'
    reason: InstallComponentFailed
    status: "False"
    type: Installed
  message: 'error validating existing CRs against new CRD''s schema for "addons.tackle.konveyor.io":
    error validating tackle.konveyor.io/v1alpha2, Kind=Addon "openshift-mta/analyzer":
    updated validation is too restrictive: [].spec.container: Required value'
  phase: Failed
  plan:

Despite these messages it appears the CRD is actually updated on the cluster. Should we be doing something to alleviate the issue above?

Further when viewing the installed CRD we see:

$ oc get crd addons.tackle.konveyor.io -o yaml | tail -n 3
  storedVersions:
  - v1alpha1
  - v1alpha2

We were under the impression it was only possible to have one stored version. Is this understanding false, or do we also need to do something to correct this.

Environment

  • operator-lifecycle-manager version:
    I don't know how to get this from the running cluster, but if you tell me I will provide it.

  • Kubernetes version information:

OpenShift 4.16.2
Kubernetes Version: v1.29.6+aba1e8d

  • Kubernetes cluster kind:
    OpenShift

Additional context
The full CRD is here:
https://github.com/konveyor/operator/blob/main/bundle/manifests/tackle.konveyor.io_addons.yaml

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

No branches or pull requests

1 participant