Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/asset/agent/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ type nmStateConfig struct {
}

const (
// ExternalPlatformNameOci is the name of the external platform for OCP.
// ExternalPlatformNameOci is the name of the external platform for Oracle Cloud Infrastructure.
ExternalPlatformNameOci = "oci"
// ExternalPlatformNameIBMZ is the name of the external platform for IBM Z (s390x).
ExternalPlatformNameIBMZ = "ibmz"
)

// SupportedInstallerPlatforms lists the supported platforms for agent installer.
Expand Down
4 changes: 2 additions & 2 deletions pkg/asset/agent/image/agentimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ func (a *AgentImage) PersistToFile(directory string) error {
if err != nil {
return err
}
// For external platform OCI, add CCM manifests in the openshift directory.
// For external platforms (OCI, IBM Z, etc.), add CCM manifests in the openshift directory.
if a.platform == hiveext.ExternalPlatformType {
logrus.Infof("When using %s oci platform, always make sure CCM manifests were added in the %s directory.", hiveext.ExternalPlatformType, manifests.OpenshiftManifestDir())
logrus.Infof("When using %s platform, always make sure CCM manifests were added in the %s directory.", hiveext.ExternalPlatformType, manifests.OpenshiftManifestDir())
}

return nil
Expand Down
9 changes: 7 additions & 2 deletions pkg/asset/agent/image/kargs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ func (a *Kargs) Generate(_ context.Context, dependencies asset.Parents) error {
switch agentWorkflow.Workflow {
case workflow.AgentWorkflowTypeInstall:
a.fips = agentClusterInstall.FIPSEnabled()
// Add kernel args for external oci platform
if agentClusterInstall.GetExternalPlatformName() == agent.ExternalPlatformNameOci {
// Add kernel args for external platforms
externalPlatformName := agentClusterInstall.GetExternalPlatformName()
switch externalPlatformName {
case agent.ExternalPlatformNameOci:
logrus.Debugf("Added kernel args to enable serial console for %s %s platform", hiveext.ExternalPlatformType, agent.ExternalPlatformNameOci)
a.consoleArgs = " console=ttyS0"
case agent.ExternalPlatformNameIBMZ:
logrus.Debugf("Added kernel args to enable serial console for %s %s platform", hiveext.ExternalPlatformType, agent.ExternalPlatformNameIBMZ)
a.consoleArgs = " console=ttysclp0"
}

case workflow.AgentWorkflowTypeAddNodes:
Expand Down
13 changes: 11 additions & 2 deletions pkg/asset/agent/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ func ValidateSupportedPlatforms(platform types.Platform, controlPlaneArch string
if platform.Name() != none.Name && controlPlaneArch == types.ArchitecturePPC64LE {
allErrs = append(allErrs, field.Invalid(fieldPath, platform.Name(), fmt.Sprintf("CPU architecture \"%s\" only supports platform \"%s\".", types.ArchitecturePPC64LE, none.Name)))
}
if platform.Name() != none.Name && controlPlaneArch == types.ArchitectureS390X {
allErrs = append(allErrs, field.Invalid(fieldPath, platform.Name(), fmt.Sprintf("CPU architecture \"%s\" only supports platform \"%s\".", types.ArchitectureS390X, none.Name)))
if platform.Name() != none.Name && platform.Name() != external.Name && controlPlaneArch == types.ArchitectureS390X {
allErrs = append(allErrs, field.Invalid(fieldPath, platform.Name(), fmt.Sprintf("CPU architecture \"%s\" only supports platform \"%s\" or \"%s\".", types.ArchitectureS390X, none.Name, external.Name)))
}
return allErrs
}
Expand All @@ -135,13 +135,22 @@ func (a *OptionalInstallConfig) validatePlatformsByName(installConfig *types.Ins
var allErrs field.ErrorList

if installConfig.Platform.Name() == external.Name {
// Validate OCI platform requirements
if installConfig.Platform.External.PlatformName == ExternalPlatformNameOci &&
installConfig.Platform.External.CloudControllerManager != external.CloudControllerManagerTypeExternal {
fieldPath := field.NewPath("platform", "external", "cloudControllerManager")
allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager,
fmt.Sprintf("When using external %s platform, %s must be set to %s",
ExternalPlatformNameOci, fieldPath, external.CloudControllerManagerTypeExternal)))
}
// Validate IBM Z platform requirements
if installConfig.Platform.External.PlatformName == ExternalPlatformNameIBMZ &&
installConfig.Platform.External.CloudControllerManager != external.CloudControllerManagerTypeExternal {
fieldPath := field.NewPath("platform", "external", "cloudControllerManager")
allErrs = append(allErrs, field.Invalid(fieldPath, installConfig.Platform.External.CloudControllerManager,
fmt.Sprintf("When using external %s platform, %s must be set to %s",
ExternalPlatformNameIBMZ, fieldPath, external.CloudControllerManagerTypeExternal)))
}
}

if installConfig.Platform.Name() == vsphere.Name {
Expand Down