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

Runtime panic occurs when clusternetwork CIDR mask is greater than hostPrefix and OVN ipv4 join subnet is provided

XMLWordPrintable

    • Low
    • None
    • Installer Sprint 266
    • 1
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      When a clusternetwork entry has an invalid hostPrefix, which is <= CIDR mask and the custom IPv4 join subnet is provided in the install-config, the installer gives a runtime panic error: negative shift amount The error is expected to occur as it is an invalid configuration, but a more descriptive error should be returned instead of panics.

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

          

      How reproducible:

      Always

      Steps to Reproduce:

      Create a cluster with the following install-config (i.e. some fields are intentionally not included):
      
      ```
      additionalTrustBundlePolicy: Proxyonly
      apiVersion: v1
      baseDomain: devcluster.openshift.com
      compute:
        - architecture: amd64
          hyperthreading: Enabled
          name: worker
          platform: {}
          replicas: 3
      controlPlane:
        architecture: amd64
        hyperthreading: Enabled
        name: master
        platform: {}
        replicas: 3
      metadata:
        creationTimestamp: null
        name: thvo-dev
      networking:
        clusterNetwork:
          - cidr: 10.128.0.0/19
            hostPrefix: 18 # Bad because hostPrefix must be >= 19
          - cidr: 10.128.32.0/19
            hostPrefix: 23
        machineNetwork:
          - cidr: 10.0.0.0/16
        networkType: OVNKubernetes
        serviceNetwork:
          - 172.30.0.0/16
        ovnKubernetesConfig:
          ipv4:
            internalJoinSubnet: 101.64.0.0/16
      platform:
        aws:
          region: us-east-1
      publish: External
      ```
      
      

      Actual results:

      panic: runtime error: negative shift amount

      Expected results:

      A descriptive user-friendly error that points out why it is invalid

      Additional info:

          

              rh-ee-thvo Thuan Vo
              rh-ee-thvo Thuan Vo
              Jinyun Ma Jinyun Ma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: