Skip to content

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

Open
@jmontleon

Description

@jmontleon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions