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

Create Node ISO command crashes when rootDeviceHints is invalid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • 4.21.0
    • 4.18, 4.19, 4.20
    • oc / node-image
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      If a user provides rootDeviceHints in the wrong format (for example, missing the hint name), the command throws a runtime error instead of showing a user friendly message.

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

      4.20

      How reproducible:

      Always

      Steps to Reproduce:

       Create node ISO using oc adm node-image create --mac-address=c8:4b:d6:86:eb --root-device-hint=/dev/sda      

      Actual results:

      2025-09-23T20:45:42Z [node-image create] installer pullspec obtained from installer-images configMap quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:66355fdb4486f07d82fbc684a421c9c013a21ed9de7c2280746b8afeaf5f4739panic: runtime error: index out of range [1] with length 1
      goroutine 1 [running]:github.com/openshift/oc/pkg/cli/admin/nodeimage.(*CreateOptions).createConfigFileFromFlags(0xc0009b3200)	/go/src/github.com/openshift/oc/pkg/cli/admin/nodeimage/create.go:639 +0x6cegithub.com/openshift/oc/pkg/cli/admin/nodeimage.(*CreateOptions).createInputConfigMap(0xc0009b3200, {0x769c620, 0x98753a0})	/go/src/github.com/openshift/oc/pkg/cli/admin/nodeimage/create.go:670 +0xcbgithub.com/openshift/oc/pkg/cli/admin/nodeimage.(*BaseNodeImageCommand).runNodeJoinerPod(...)	/go/src/github.com/openshift/oc/pkg/cli/admin/nodeimage/basenodeimagecommand.go:442github.com/openshift/oc/pkg/cli/admin/nodeimage.(*CreateOptions).Run(0xc0009b3200)	/go/src/github.com/openshift/oc/pkg/cli/admin/nodeimage/create.go:294 +0x207github.com/openshift/oc/pkg/cli/admin/nodeimage.NewCreate.func1(0xc000de3208?, {0xc000907d10?, 0x0?, 0x5?})	/go/src/github.com/openshift/oc/pkg/cli/admin/nodeimage/create.go:110 +0x96github.com/spf13/cobra.(*Command).execute(0xc000de3208, {0xc000907cc0, 0x5, 0x5})	/go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:989 +0xa91github.com/spf13/cobra.(*Command).ExecuteC(0xc0009c5508)	/go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:1117 +0x3ffgithub.com/spf13/cobra.(*Command).Execute(...)	/go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:1041k8s.io/component-base/cli.run(0xc0009c5508)	/go/src/github.com/openshift/oc/vendor/k8s.io/component-base/cli/run.go:143 +0x245k8s.io/component-base/cli.RunNoErrOutput(...)	/go/src/github.com/openshift/oc/vendor/k8s.io/component-base/cli/run.go:82main.main()
      

      Expected results:

      The command should return a user-friendly error: "incorrect rootDeviceHints format provided: /dev/sda. Expected format: <hint name>:<value>, for example: deviceName:/dev/sda"    

      Additional info:

          

              rhn-support-mhans Manoj Hans
              rhn-support-mhans Manoj Hans
              None
              None
              Manoj Hans Manoj Hans
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: