Skip to content

Commit

Permalink
Update internal/host/hostcommands/install_cmd.go
Browse files Browse the repository at this point in the history
Co-authored-by: Omer Tuchfeld <omertuchfeld@gmail.com>
Signed-off-by: Amadeus Podvratnik <apodvrat@redhat.com>
  • Loading branch information
2 people authored and apodvrat committed Mar 15, 2024
1 parent d01bcff commit 7742f8e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions internal/host/hostcommands/install_cmd.go
Expand Up @@ -281,8 +281,6 @@ func constructHostInstallerArgs(cluster *common.Cluster, host *models.Host, inve

var installerArgs []string
var err error
var hasIPConfigOverride bool
var isInventorySet bool

hasStaticNetwork := (infraEnv != nil && infraEnv.StaticNetworkConfig != "") || cluster.StaticNetworkConfigured

Expand All @@ -295,14 +293,8 @@ func constructHostInstallerArgs(cluster *common.Cluster, host *models.Host, inve

// Check if Manufacturer is IBM/S390 and ProductName is not "KVM/Linux" (the case for z/VM and LPAR).
// If this is the case than we need to extract the necessary z/VM kargs and append them.
isInventorySet = (inventory != nil && inventory.SystemVendor != nil)
hasIPConfigOverride = false
if isInventorySet {
log.Debugf("Check for SystemVendor and ProductName: %s:%s\n", inventory.SystemVendor.Manufacturer, inventory.SystemVendor.ProductName)
installerArgs, hasIPConfigOverride = appends390xArgs(inventory, installerArgs, log)
} else {
log.Debug("Check for SystemVendor and ProductName: <nil>:<nil>\n")
}
hasIPConfigOverride := false
installerArgs, hasIPConfigOverride = appends390xArgs(inventory, installerArgs, log)

// set DHCP args only if no IP config override was specified (only for LPAR and zVM nodes on s390x)
if !hasStaticNetwork && !hasIPConfigOverride {
Expand Down Expand Up @@ -340,10 +332,11 @@ func constructHostInstallerArgs(cluster *common.Cluster, host *models.Host, inve

func appends390xArgs(inventory *models.Inventory, installerArgs []string, log logrus.FieldLogger) ([]string, bool) {

var hasIPConfigOverride bool
hasIPConfigOverride := false

if strings.EqualFold(inventory.SystemVendor.Manufacturer, ZVM_VENDOR_ID) &&
if inventory != nil && inventory.SystemVendor != nil && strings.EqualFold(inventory.SystemVendor.Manufacturer, ZVM_VENDOR_ID) &&
!strings.HasSuffix(inventory.SystemVendor.ProductName, VM_CTRL_PRG) && (inventory.Boot != nil) {
log.Debugf("Current heck for SystemVendor and ProductName: %s:%s\n", inventory.SystemVendor.Manufacturer, inventory.SystemVendor.ProductName)
// Commandline for dasd and static IP w/o nmstate might look like:
// rd.neednet=1 console=ttysclp0 coreos.live.rootfs_url=http://172.23.236.156:8080/assisted-installer/rootfs.img
// ip=10.14.6.3::10.14.6.1:255.255.255.0:master-0.boea3e06.lnxero1.boe:encbdd0:none nameserver=10.14.6.1
Expand Down

0 comments on commit 7742f8e

Please sign in to comment.