Skip to content
Merged
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ require (
github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.7.0
github.com/nutanix-cloud-native/prism-go-client v0.5.0
github.com/onsi/gomega v1.38.2
github.com/openshift/api v0.0.0-20260209232644-126cbbe24427
github.com/openshift/api v0.0.0-20260228183123-9b2ee997d297
github.com/openshift/assisted-image-service v0.0.0-20240607085136-02df2e56dde6
github.com/openshift/assisted-service/api v0.0.0
github.com/openshift/assisted-service/client v0.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,8 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk=
github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/openshift/api v0.0.0-20260209232644-126cbbe24427 h1:MExw+yvWGmbwlTpsO8sk16n3YQeeE2QxLmLpQouIGeE=
github.com/openshift/api v0.0.0-20260209232644-126cbbe24427/go.mod h1:d5uzF0YN2nQQFA0jIEWzzOZ+edmo6wzlGLvx5Fhz4uY=
github.com/openshift/api v0.0.0-20260228183123-9b2ee997d297 h1:QoHTB3QS859LUGE6NUTg98XiMz6Kzm3svQmo4tmgmlg=
github.com/openshift/api v0.0.0-20260228183123-9b2ee997d297/go.mod h1:ZYAxo9t1AALeEotN07tNzIvqqqWSxcZIqMUKnY/xCeQ=
github.com/openshift/assisted-image-service v0.0.0-20240607085136-02df2e56dde6 h1:U6ve+dnHlHhAELoxX+rdFOHVhoaYl0l9qtxwYtsO6C0=
github.com/openshift/assisted-image-service v0.0.0-20240607085136-02df2e56dde6/go.mod h1:o2H5VwQhUD8P6XsK6dRmKpCCJqVvv12KJQZBXmcCXCU=
github.com/openshift/assisted-service/api v0.0.0-20250922204150-a52b83145bea h1:YhJ9iHKKT5ooAdVr8qq3BdudhTxP/WF0XYDT5gzi1ak=
Expand Down
8 changes: 4 additions & 4 deletions pkg/asset/agent/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (a *OptionalInstallConfig) validateTNAConfiguration(installConfig *types.In
}
// At this point we know: 2 replicas + arbiter configured
// Check if TNA feature gate is enabled
if !installConfig.EnabledFeatureGates().Enabled(features.FeatureGateHighlyAvailableArbiter) {
if !installConfig.Enabled(features.FeatureGateHighlyAvailableArbiter) {
fieldPath := field.NewPath("arbiter")
allErrs = append(allErrs, field.Invalid(fieldPath, "configured",
"arbiter configuration requires FeatureGateHighlyAvailableArbiter to be enabled"))
Expand All @@ -278,7 +278,7 @@ func (a *OptionalInstallConfig) validateTNFConfiguration(installConfig *types.In

// At this point we know: 2 replicas + fencing configured
// Check if TNF feature gate is enabled
if !installConfig.EnabledFeatureGates().Enabled(features.FeatureGateDualReplica) {
if !installConfig.Enabled(features.FeatureGateDualReplica) {
fieldPath := field.NewPath("controlPlane", "fencing")
allErrs = append(allErrs, field.Invalid(fieldPath, "configured",
"fencing configuration requires FeatureGateDualReplica to be enabled"))
Expand All @@ -303,10 +303,10 @@ func (a *OptionalInstallConfig) validateControlPlaneConfiguration(installConfig
if *installConfig.ControlPlane.Replicas < 1 || *installConfig.ControlPlane.Replicas > 5 {
fieldPath = field.NewPath("controlPlane", "replicas")
supportedControlPlaneRange := []string{"3", "1", "4", "5"}
if installConfig.EnabledFeatureGates().Enabled(features.FeatureGateHighlyAvailableArbiter) {
if installConfig.Enabled(features.FeatureGateHighlyAvailableArbiter) {
supportedControlPlaneRange = append(supportedControlPlaneRange, "2 (with arbiter)")
}
if installConfig.EnabledFeatureGates().Enabled(features.FeatureGateDualReplica) {
if installConfig.Enabled(features.FeatureGateDualReplica) {
supportedControlPlaneRange = append(supportedControlPlaneRange, "2 (with fencing)")
}
allErrs = append(allErrs, field.NotSupported(fieldPath, installConfig.ControlPlane.Replicas, supportedControlPlaneRange))
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ func (m *Master) Generate(ctx context.Context, dependencies asset.Parents) error
machineConfigs = append(machineConfigs, ignIPv6)
}

if installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateMultiDiskSetup) {
if installConfig.Config.Enabled(features.FeatureGateMultiDiskSetup) {
for i, diskSetup := range installConfig.Config.ControlPlane.DiskSetup {
var dataDisk any
var diskName string
Expand Down
4 changes: 2 additions & 2 deletions pkg/asset/machines/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NodeDiskSetup(installConfig *installconfig.InstallConfig, role string, disk

switch ic.Platform.Name() {
case azuretypes.Name:
if installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateAzureMultiDisk) {
if installConfig.Config.Enabled(features.FeatureGateAzureMultiDisk) {
if azureDataDisk, ok := dataDisk.(v1beta1.DataDisk); ok {
device := fmt.Sprintf("/dev/disk/azure/scsi1/lun%d", *azureDataDisk.Lun)
diskSetupIgn, err := machineconfig.ForDiskSetup(role, device, label, path, diskSetup.Type)
Expand All @@ -53,7 +53,7 @@ func NodeDiskSetup(installConfig *installconfig.InstallConfig, role string, disk
return nil, errors.Errorf("unsupported azure data disk type")
}
case vspheretypes.Name:
if installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateVSphereMultiDisk) {
if installConfig.Config.Enabled(features.FeatureGateVSphereMultiDisk) {
if vsphereDataDisk, ok := dataDisk.(vsphere.DiskInfo); ok {
// We need to find the index of the datadisk in the array. Each disk is added in order to the VM so
// we'll map to that location. First disk is OS disk so add 1 to index for scsi location
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/machines/vsphere/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine
} else if claim != nil && address != nil {
// To prevent having to touch many function below, adding logic here to ClusterCAPI issue with v1beta1 vs v1beta2.
// If cluster capi operator is enabled, we need to support v1beta2 of the IPAM. If disabled, we can keep v1beta1.
if config.EnabledFeatureGates().Enabled(features.FeatureGateClusterAPIMachineManagement) {
if config.Enabled(features.FeatureGateClusterAPIMachineManagement) {
logrus.Debug("updating capi ipam apiVersion from v1beta1 to v1beta2 when feature gate ClusterAPIMachineManagement is enabled")
for index := range claim {
claim[index].APIVersion = "ipam.cluster.x-k8s.io/v1beta2"
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/machines/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (w *Worker) Generate(ctx context.Context, dependencies asset.Parents) error
machineConfigs = append(machineConfigs, ignRoutes)
}
}
if installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateMultiDiskSetup) {
if installConfig.Config.Enabled(features.FeatureGateMultiDiskSetup) {
for i, diskSetup := range pool.DiskSetup {
var dataDisk any
var diskName string
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/manifests/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass
}
}

if installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateNoRegistryClusterInstall) {
if installConfig.Config.Enabled(features.FeatureGateNoRegistryClusterInstall) {
iri := &manifests.InternalReleaseImage{}
dependencies.Get(iri)

Expand Down
4 changes: 2 additions & 2 deletions pkg/asset/manifests/vsphere/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func GetInfraPlatformSpec(ic *installconfig.InstallConfig, clusterID string) *co
},
}

if ic.Config.EnabledFeatureGates().Enabled(features.FeatureGateVSphereHostVMGroupZonal) {
if ic.Config.Enabled(features.FeatureGateVSphereHostVMGroupZonal) {
logrus.Debug("Host VM Group based zonal feature gate enabled")

if failureDomain.ZoneType == vsphere.HostGroupFailureDomain {
Expand Down Expand Up @@ -86,7 +86,7 @@ func GetInfraPlatformSpec(ic *installconfig.InstallConfig, clusterID string) *co
}
}

if ic.Config.EnabledFeatureGates().Enabled(features.FeatureGateVSphereMultiNetworks) {
if ic.Config.Enabled(features.FeatureGateVSphereMultiNetworks) {
logrus.Debug("Multi-networks feature gate enabled")
if icPlatformSpec.NodeNetworking != nil {
logrus.Debug("Multi-networks: node networking defined, copying to infrastructure spec")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (t *InternalReleaseImageTLSSecret) Generate(_ context.Context, dependencies

dependencies.Get(installConfig, iri)

if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateNoRegistryClusterInstall) {
if !installConfig.Config.Enabled(features.FeatureGateNoRegistryClusterInstall) {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/tls/iricertkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (a *IRICertKey) Generate(ctx context.Context, dependencies asset.Parents) e
iri := &manifests.InternalReleaseImage{}
dependencies.Get(ca, installConfig, iri)

if !installConfig.Config.EnabledFeatureGates().Enabled(features.FeatureGateNoRegistryClusterInstall) {
if !installConfig.Config.Enabled(features.FeatureGateNoRegistryClusterInstall) {
return nil
}

Expand Down
8 changes: 2 additions & 6 deletions pkg/destroy/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"github.com/openshift/api/features"
"github.com/openshift/installer/pkg/asset/cluster/metadata"
osp "github.com/openshift/installer/pkg/destroy/openstack"
"github.com/openshift/installer/pkg/infrastructure/openstack/preprovision"
Expand Down Expand Up @@ -70,12 +69,9 @@ func Destroy(ctx context.Context, dir string) (err error) {
}
}

// Get cluster profile for new FeatureGate access. Blank is no longer an option, so default to
// SelfManaged.
clusterProfile := types.GetClusterProfileName()
featureSets, ok := features.AllFeatureSets()[clusterProfile]
featureSets, ok := types.FeatureSetsForProfile()
if !ok {
return fmt.Errorf("no feature sets for cluster profile %q", clusterProfile)
return fmt.Errorf("no feature sets for cluster profile %q", types.GetClusterProfileName())
}
fg := featuregates.FeatureGateFromFeatureSets(featureSets, metadata.FeatureSet, metadata.CustomFeatureSet)

Expand Down
11 changes: 7 additions & 4 deletions pkg/types/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"k8s.io/apimachinery/pkg/util/sets"

configv1 "github.com/openshift/api/config/v1"
features "github.com/openshift/api/features"
"github.com/openshift/installer/pkg/ipnet"
"github.com/openshift/installer/pkg/types/aws"
"github.com/openshift/installer/pkg/types/azure"
Expand Down Expand Up @@ -624,16 +623,20 @@ func (c *InstallConfig) EnabledFeatureGates() featuregates.FeatureGate {
customFS = featuregates.GenerateCustomFeatures(c.FeatureGates)
}

clusterProfile := GetClusterProfileName()
featureSets, ok := features.AllFeatureSets()[clusterProfile]
featureSets, ok := FeatureSetsForProfile()
if !ok {
logrus.Warnf("no feature sets for cluster profile %q", clusterProfile)
logrus.Warnf("no feature sets for cluster profile %q", GetClusterProfileName())
}
fg := featuregates.FeatureGateFromFeatureSets(featureSets, c.FeatureSet, customFS)

return fg
}

// Enabled returns true if the given feature gate is enabled in the current feature sets.
func (c *InstallConfig) Enabled(key configv1.FeatureGateName) bool {
return c.EnabledFeatureGates().Enabled(key)
}

// PublicAPI indicates whether the API load balancer should be public
// by inspecting the cluster and operator publishing strategies.
func (c *InstallConfig) PublicAPI() bool {
Expand Down
17 changes: 17 additions & 0 deletions pkg/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ func MachineNetworksToCIDRs(nets []MachineNetworkEntry) []configv1.CIDR {
return res
}

// openshiftMajorVersion is the major version of OpenShift that this installer targets.
// This is used when looking up feature sets from the API.
const openshiftMajorVersion uint64 = 4

// FeatureSetsForProfile returns the feature sets for the current cluster profile
// and OpenShift major version.
func FeatureSetsForProfile() (map[configv1.FeatureSet]*features.FeatureGateEnabledDisabled, bool) {
clusterProfile := GetClusterProfileName()
allSets := features.AllFeatureSets()
versionSets, ok := allSets[openshiftMajorVersion]
if !ok {
return nil, false
}
profileSets, ok := versionSets[clusterProfile]
return profileSets, ok
}

// GetClusterProfileName utility method to retrieve the cluster profile setting. This is used
// when dealing with openshift api to get FeatureSets.
func GetClusterProfileName() features.ClusterProfileName {
Expand Down
9 changes: 4 additions & 5 deletions pkg/types/validation/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func ValidateInstallConfig(c *types.InstallConfig, usingAgentMethod bool) field.
}

if c.Arbiter != nil {
if c.EnabledFeatureGates().Enabled(features.FeatureGateHighlyAvailableArbiter) {
if c.Enabled(features.FeatureGateHighlyAvailableArbiter) {
allErrs = append(allErrs, validateArbiter(&c.Platform, c.Arbiter, c.ControlPlane, field.NewPath("arbiter"))...)
} else {
allErrs = append(allErrs, field.Forbidden(field.NewPath("arbiter"), fmt.Sprintf("%s feature must be enabled in order to use arbiter cluster deployment", features.FeatureGateHighlyAvailableArbiter)))
Expand Down Expand Up @@ -1570,15 +1570,14 @@ func validateAdditionalCABundlePolicy(c *types.InstallConfig) error {
func ValidateFeatureSet(c *types.InstallConfig) field.ErrorList {
allErrs := field.ErrorList{}

clusterProfile := types.GetClusterProfileName()
featureSets, ok := features.AllFeatureSets()[clusterProfile]
featureSets, ok := types.FeatureSetsForProfile()
if !ok {
logrus.Warnf("no feature sets for cluster profile %q", clusterProfile)
logrus.Warnf("no feature sets for cluster profile %q", types.GetClusterProfileName())
}
if _, ok := featureSets[c.FeatureSet]; c.FeatureSet != configv1.CustomNoUpgrade && !ok {
sortedFeatureSets := func() []string {
v := []string{}
for n := range features.AllFeatureSets()[clusterProfile] {
for n := range featureSets {
v = append(v, string(n))
}
// Add CustomNoUpgrade since it is not part of features sets for profiles
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/openshift/api/config/v1/types_ingress.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading