Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPSTRAT-367: Support Nutanix in agent-based installer #9173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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 @@ -9,6 +9,7 @@ import (
"github.com/openshift/installer/pkg/types/baremetal"
"github.com/openshift/installer/pkg/types/external"
"github.com/openshift/installer/pkg/types/none"
"github.com/openshift/installer/pkg/types/nutanix"
"github.com/openshift/installer/pkg/types/vsphere"
)

Expand All @@ -19,12 +20,13 @@ const (

// SupportedInstallerPlatforms lists the supported platforms for agent installer.
func SupportedInstallerPlatforms() []string {
return []string{baremetal.Name, vsphere.Name, none.Name, external.Name}
return []string{baremetal.Name, vsphere.Name, nutanix.Name, none.Name, external.Name}
}

var supportedHivePlatforms = []hiveext.PlatformType{
hiveext.BareMetalPlatformType,
hiveext.VSpherePlatformType,
hiveext.NutanixPlatformType,
hiveext.NonePlatformType,
hiveext.ExternalPlatformType,
}
Expand Down
23 changes: 23 additions & 0 deletions pkg/asset/agent/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
baremetalvalidation "github.com/openshift/installer/pkg/types/baremetal/validation"
"github.com/openshift/installer/pkg/types/external"
"github.com/openshift/installer/pkg/types/none"
"github.com/openshift/installer/pkg/types/nutanix"
nutanixvalidation "github.com/openshift/installer/pkg/types/nutanix/validation"
"github.com/openshift/installer/pkg/types/validation"
"github.com/openshift/installer/pkg/types/vsphere"
)
Expand Down Expand Up @@ -149,6 +151,11 @@ func (a *OptionalInstallConfig) validatePlatformsByName(installConfig *types.Ins
allErrs = append(allErrs, a.validateBMCConfig(installConfig)...)
}

if installConfig.Platform.Name() == nutanix.Name {
errList := nutanixvalidation.ValidatePlatform(installConfig.Platform.Nutanix, field.NewPath("platform", "nutanix"), installConfig)
allErrs = append(allErrs, errList...)
}

return allErrs
}

Expand Down Expand Up @@ -462,7 +469,23 @@ func warnUnusedConfig(installConfig *types.InstallConfig) {
fieldPath := field.NewPath("Platform", "VSphere", "Hosts")
logrus.Warnf(fmt.Sprintf("%s: %v is ignored", fieldPath, vspherePlatform.Hosts))
}
case nutanix.Name:
nutanixPlatform := installConfig.Platform.Nutanix

if nutanixPlatform.ClusterOSImage != "" {
fieldPath := field.NewPath("Platform", "Nutanix", "ClusterOSImage")
logrus.Warnf(fmt.Sprintf("%s: %s is ignored", fieldPath, nutanixPlatform.ClusterOSImage))
}
if nutanixPlatform.DefaultMachinePlatform != nil && !reflect.DeepEqual(*nutanixPlatform.DefaultMachinePlatform, nutanix.MachinePool{}) {
fieldPath := field.NewPath("Platform", "Nutanix", "DefaultMachinePlatform")
logrus.Warnf(fmt.Sprintf("%s: %v is ignored", fieldPath, nutanixPlatform.DefaultMachinePlatform))
}
if nutanixPlatform.LoadBalancer != nil && !reflect.DeepEqual(*nutanixPlatform.LoadBalancer, configv1.NutanixPlatformLoadBalancer{}) {
fieldPath := field.NewPath("Platform", "Nutanix", "LoadBalancer")
logrus.Warnf(fmt.Sprintf("%s: %v is ignored", fieldPath, nutanixPlatform.LoadBalancer))
}
}

// "External" is the default set from generic install config code
if installConfig.Publish != "External" {
fieldPath := field.NewPath("Publish")
Expand Down