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

more enum values cannot be added for an existing field

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Important
    • Yes
    • Rejected
    • Nidoran Sprint 274, Pikachu Sprint 276
    • 2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

        enum values cannot be added for an existing field 
      
      error message:
      message: 'error for resolved bundle "nginx75515.v1.0.6" with version "1.0.6":
            validating upgrade for CRD "nginxolm75515s.cache.example.com": v1alpha1: ^.spec.enumfield:
            enum: allowed enum values added : ["value4"]'

      Version-Release number of selected component (if applicable):

          4.20.0-0.nightly-2025-07-07-234740

      How reproducible:

          always

      Steps to Reproduce:

          1.create catalog
      xzha@xzha1-mac OCP-75515 % cat catalog.yaml 
      apiVersion: olm.operatorframework.io/v1
      kind: ClusterCatalog
      metadata:
        name: catalog-75515
        labels:
          example.com/support: "true"
          test-cases: ocp-75515
      spec:
        priority: 1000
        source:
          type: Image
          image:
            ref: quay.io/openshifttest/nginxolm-operator-index:nginxolm75515
      
           2. create clusterextension extension-75515
      xzha@xzha1-mac OCP-75515 % cat extension.yaml 
      apiVersion: olm.operatorframework.io/v1
      kind: ClusterExtension
      metadata:
        name: "extension-75515"
      spec:
        namespace: "ns-75515"
        serviceAccount:
          name: "test-75515"
        source:
          sourceType: "Catalog"
          catalog:
            packageName: "nginx75515"
            channel: candidate-v1.0
            version: "1.0.3"
            upgradeConstraintPolicy: "CatalogProvided"
      
      CRD nginxolm75515s.cache.example.com
               spec:
                  description: Spec defines the desired state of Nginxolm75515
                  type: object
                  properties:
                    enumfield:
                      type: string
                      enum: 
                        - "value1"
                        - "value2"
                        - "value3"
                  required:
                    - enumfield
      
           3. upgrade clusterextension to 1.0.6
      CRD  nginxolm75515s.cache.example.com for 1.0.6 add one enum value
      
                properties:
                    enumfield:
                      type: string
                      enum:
                        - "value1"
                        - "value2"
                        - "value3"
                        - "value4"
                  required:
                    - enumfield 
      
      xzha@xzha1-mac OCP-75515 % oc patch clusterextension extension-75515 -p '{"spec":{"source":{"catalog":{"version":"1.0.6","upgradeConstraintPolicy":"SelfCertified"}}}}' --type=merge
      clusterextension.olm.operatorframework.io/extension-75515 patched  
      
      - lastTransitionTime: "2025-07-08T01:51:10Z"
          message: 'error for resolved bundle "nginx75515.v1.0.6" with version "1.0.6":
            validating upgrade for CRD "nginxolm75515s.cache.example.com": v1alpha1: ^.spec.enumfield:
            enum: allowed enum values added : ["value4"]'
          observedGeneration: 2
          reason: Retrying
          status: "True"
          type: Progressing
      
      
      

      Actual results:

         upgrade to 1.0.6 failed,  enum values cannot be added for an existing field

      Expected results:

          upgrade to 1.0.6 successfully, more enum values can be added for an existing field

      Additional info:

          https://issues.redhat.com/browse/OPECO-3201
      "more enum values can be added for an existing field" should be supported

              rh-ee-cchantse Catherine Chan-Tse
              rhn-support-xzha Xia Zhao
              None
              None
              Xia Zhao Xia Zhao
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: