Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-9932

sdk bundle validate does not validate the maxocpversion field when set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Normal Normal
    • None
    • 4.13
    • Operator SDK
    • None
    • No
    • False
    • Hide

      None

      Show
      None

      Description of problem:
      CSV with the following property:

      properties:

      • type: olm.maxOpenShiftVersion
        value:
        version: "4.13"

      was considered valid by the bundle validate --select-optional=community test. However, when applied on cluster, it resulted in the cluster not being upgradeable with the following error:

      Cluster operator operator-lifecycle-manager should not be upgraded between minor versions: ClusterServiceVersions blocking cluster upgrade: openshift-operators/openshift-pipelines-operator-rh.v1.9.1 has invalid olm.maxOpenShiftVersion properties: failed to parse "{"version":"4.13"}" as semver: Invalid character(s) found in major number "0{\"version\":\"4"

      To fix this, the team had to release a new version of the operator with a valid olm.maxOpenShiftVersion field:

      properties:

      • type: "olm.maxOpenShiftVersion"
        value: "4.13"
        Version-Release number of selected component (if applicable):

      How reproducible:
      always
      Steps to Reproduce:
      run operator-sdk bundle validate --select-optional=community on openshift-pipelines-operator-rh.v1.9.1
      Actual results:
      no error
      Expected results:
      error with invalid olm.maxOpenShiftVersion properties
      Additional info:
      The field is only validated IF the bundle has deprecated APIs (see:
      https://github.com/operator-framework/api/blob/0131a6301e42e4819874c7fe5d0eabf3d756299e/pkg/validation/internal/community.go#L90
      ) but it should be validated IF set.

              rh-ee-cchantse Catherine Chan-Tse
              lgallett Lance Galletti
              Jia Fan Jia Fan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: