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

siteconfig-generator panics when handling a node level NMStateConfig override

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 4.15
    • GitOps ZTP
    • None
    • Important
    • No
    • CNF RAN Sprint 248
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      When using a node level crTemplate to over-ride the NMStateconfig CR, the siteconfig-generator panics while trying to import the CR.

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

          

      How reproducible:

      100%

      Steps to Reproduce:

          1. Use these siteconfig and nmstateconfig yaml files
      
      ---
      apiVersion: ran.openshift.io/v1
      kind: SiteConfig
      metadata:
        name: "ex-ocp1"
        namespace: "ex-ocp1"
      spec:
        baseDomain: "example.com"
        pullSecretRef:
          name: "assisted-deployment-pull-secret"
        clusterImageSetNameRef: "ocp-4.12"
        sshPublicKey: "ssh-key"
        clusters:
          - clusterName: "ex-ocp1"
            #extraManifestPath: testSiteConfig/testUserExtraManifest
            networkType: "OVNKubernetes"
            clusterLabels:
              common: true
              sites: "ex-ocp1"
              group: "ex1"
            clusterNetwork:
              - cidr: 10.10.11.0/14
                hostPrefix: 31
            apiVIP: 10.10.10.5 
            ingressVIP: 10.10.10.6 
            serviceNetwork:
              - 10.10.12.0/16
            additionalNTPSources:
              - 10.10.11.50
            nodes:
              - hostName: master01
                crTemplates:
                  NMStateConfig: "nmstateconfig.yaml"
                role: "master"
                bmcAddress: redfish-virtualmedia://10.10.10.25/redfish/v1/Systems/1
                bmcCredentialsName:
                  name: "ex-ocp1-secret"
                bootMACAddress: "00:00:00:00:00:80"
                bootMode: "UEFI"
                rootDeviceHints:
                  deviceName: "/dev/disk/by-path/pci-0000" apiVersion: agent-install.openshift.io/v1beta1 
      ---
      kind: NMStateConfig
      metadata:
        annotations:
          argocd.argoproj.io/sync-wave: "1"
        name: "master01"
        namespace: "ex-ocp1"
        labels:
          nmstate-label: "ex-ocp1"
      spec:   
        interfaces:
          - name: eno5
            macAddress: 00:00:00:00:00:18
        config:
          dns-resolver:
            config:
              server:
                - 10.10.11.10
                - 10.10.11.11
      
      
      
          2. Build the siteconfig-generator
          3. ./siteconfig-generator -manifestPath ../source-crs/extra-manifest sc.yaml     

      Actual results:

      [dahir@thinkpad siteconfig-generator]$ ./siteconfig-generator -manifestPath ../source-crs/extra-manifest sc.yaml 
      2024/01/10 15:59:39 Overriding NMStateConfig with "nmstateconfig.yaml" for node master01 in cluster ex-ocp1
      panic: interface conversion: interface {} is string, not map[string]interface {}goroutine 1 [running]:
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCR(0xc00068f200?, 0x28000000014e9f20?, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, ...}, ...}, ...)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:365 +0x7f7
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCR(0x19f39c8?, 0x56?, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, ...}, ...}, ...)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:357 +0x505
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCR(0x15693c0?, 0xc000486868?, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, ...}, ...}, ...)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:357 +0x505
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCR(0xc000486868?, 0x0?, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, ...}, ...}, ...)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:357 +0x505
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCR(0x590a20?, 0xc00015ab58?, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, ...}, ...}, ...)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:357 +0x505
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCRs.func2(0x15693c0?)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:173 +0x4d
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).instantiateCR(0x1762d62?, {0xc0003678a0, 0x20}, 0x2?, 0xc000032fd0, 0xc000033010)
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:310 +0x602
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCRs(0xc000033de8, 0x0, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, ...}, ...})
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:167 +0xcb0
      github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).Build(0xc0001fbc38?, {{0xc000046360, 0x13}, {0xc00044c2e4, 0xa}, {{0xc00044c310, 0x7}, {0xc00044c320, 0x7}, 0x0}, ...})
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:79 +0x265
      main.main()
              /home/dahir/src/cnf-features-deploy/ztp/siteconfig-generator/main.go:49 +0x565
          

      Expected results:

      The resulting CRs for the AI

      Additional info:

          

            dosman@redhat.com Dahir Osman
            dosman@redhat.com Dahir Osman
            Periyamaruthu Mohanraj Periyamaruthu Mohanraj
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: