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 @@ -64,7 +64,7 @@ require (
github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.3.3-0.20240416171357-98239ba02cb2
github.com/nutanix-cloud-native/prism-go-client v0.3.4
github.com/onsi/gomega v1.32.0
github.com/openshift/api v0.0.0-20240313103236-5f1498accd5d
github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784
github.com/openshift/assisted-image-service v0.0.0-20240408153851-f822399afa8a
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 @@ -1972,8 +1972,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8=
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
github.com/openshift/api v0.0.0-20240313103236-5f1498accd5d h1:WE1fNTWjcCQMZ+8flkBER/ygsYvQIum25F/2qBQPi+g=
github.com/openshift/api v0.0.0-20240313103236-5f1498accd5d/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784 h1:SmOZFMxuAH4d1Cj7dOftVyo4Wg/mEC4pwz6QIJJsAkc=
github.com/openshift/api v0.0.0-20240429104249-ac9356ba1784/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openshift/assisted-image-service v0.0.0-20240408153851-f822399afa8a h1:xWlqkUnY9N6aiKFgzHG27fc3kyjoxeanVdwVUUzgTs0=
github.com/openshift/assisted-image-service v0.0.0-20240408153851-f822399afa8a/go.mod h1:o2H5VwQhUD8P6XsK6dRmKpCCJqVvv12KJQZBXmcCXCU=
github.com/openshift/assisted-service/api v0.0.0-20230831114549-1922eda29cf8 h1:+fZLKbycDo4JeLwPGVSAgf2XPaJGLM341l9ZfrrlxG0=
Expand Down
3 changes: 2 additions & 1 deletion pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"github.com/openshift/installer/pkg/asset/machines/ovirt"
"github.com/openshift/installer/pkg/asset/machines/powervs"
"github.com/openshift/installer/pkg/asset/machines/vsphere"
"github.com/openshift/installer/pkg/asset/manifests/capiutils"
"github.com/openshift/installer/pkg/asset/rhcos"
rhcosutils "github.com/openshift/installer/pkg/rhcos"
"github.com/openshift/installer/pkg/types"
Expand Down Expand Up @@ -270,7 +271,7 @@ func (m *Master) Generate(dependencies asset.Parents) error {
// so we don't want to include target pools in the control plane machineset.
// TODO(padillon): once this feature gate is the default and we are
// no longer using Terraform, we can update ConfigMasters not to populate this.
if ic.EnabledFeatureGates().Enabled(configv1.FeatureGateClusterAPIInstall) {
if capiutils.IsEnabled(installConfig) {
for _, machine := range machines {
providerSpec, ok := machine.Spec.ProviderSpec.Value.Object.(*machinev1beta1.GCPMachineProviderSpec)
if !ok {
Expand Down
9 changes: 7 additions & 2 deletions pkg/asset/manifests/capiutils/helpers.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package capiutils

import (
v1 "github.com/openshift/api/config/v1"
"github.com/openshift/installer/pkg/asset/installconfig"
"github.com/openshift/installer/pkg/ipnet"
"github.com/openshift/installer/pkg/types"
typesazure "github.com/openshift/installer/pkg/types/azure"
)

var (
Expand All @@ -21,7 +22,11 @@ func CIDRFromInstallConfig(installConfig *installconfig.InstallConfig) *ipnet.IP

// IsEnabled returns true if the feature gate is enabled.
func IsEnabled(installConfig *installconfig.InstallConfig) bool {
return installConfig.Config.EnabledFeatureGates().Enabled(v1.FeatureGateClusterAPIInstall)
platform := installConfig.Config.Platform.Name()
if azure := installConfig.Config.Platform.Azure; azure != nil && azure.CloudName == typesazure.StackCloud {
platform = typesazure.StackTerraformName
}
return types.ClusterAPIFeatureGateEnabled(platform, installConfig.Config.EnabledFeatureGates())
}

// GenerateBoostrapMachineName generates the Cluster API Machine used for bootstrapping
Expand Down
4 changes: 2 additions & 2 deletions pkg/destroy/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

configv1 "github.com/openshift/api/config/v1"
"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 @@ -73,7 +73,7 @@ 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 := configv1.AllFeatureSets()[clusterProfile]
featureSets, ok := features.AllFeatureSets()[clusterProfile]
if !ok {
return fmt.Errorf("no feature sets for cluster profile %q", clusterProfile)
}
Expand Down
21 changes: 11 additions & 10 deletions pkg/infrastructure/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package platform
import (
"fmt"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/api/features"
"github.com/openshift/installer/pkg/infrastructure"
awscapi "github.com/openshift/installer/pkg/infrastructure/aws/clusterapi"
awsinfra "github.com/openshift/installer/pkg/infrastructure/aws/sdk"
Expand All @@ -30,6 +30,7 @@ import (
"github.com/openshift/installer/pkg/terraform/stages/ovirt"
"github.com/openshift/installer/pkg/terraform/stages/powervs"
"github.com/openshift/installer/pkg/terraform/stages/vsphere"
"github.com/openshift/installer/pkg/types"
awstypes "github.com/openshift/installer/pkg/types/aws"
azuretypes "github.com/openshift/installer/pkg/types/azure"
baremetaltypes "github.com/openshift/installer/pkg/types/baremetal"
Expand All @@ -50,15 +51,15 @@ import (
func ProviderForPlatform(platform string, fg featuregates.FeatureGate) (infrastructure.Provider, error) {
switch platform {
case awstypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(&awscapi.Provider{}), nil
}
if fg.Enabled(configv1.FeatureGateInstallAlternateInfrastructureAWS) {
if fg.Enabled(features.FeatureGateInstallAlternateInfrastructureAWS) {
return awsinfra.InitializeProvider(), nil
}
return terraform.InitializeProvider(aws.PlatformStages), nil
case azuretypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(&azureinfra.Provider{}), nil
}
return terraform.InitializeProvider(azure.PlatformStages), nil
Expand All @@ -67,36 +68,36 @@ func ProviderForPlatform(platform string, fg featuregates.FeatureGate) (infrastr
case baremetaltypes.Name:
return baremetalinfra.InitializeProvider(), nil
case gcptypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(gcpcapi.Provider{}), nil
}
return terraform.InitializeProvider(gcp.PlatformStages), nil
case ibmcloudtypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(ibmcloudcapi.Provider{}), nil
}
return terraform.InitializeProvider(ibmcloud.PlatformStages), nil
case libvirttypes.Name:
return terraform.InitializeProvider(libvirt.PlatformStages), nil
case nutanixtypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(nutanixcapi.Provider{}), nil
}
return terraform.InitializeProvider(nutanix.PlatformStages), nil
case powervstypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(&powervscapi.Provider{}), nil
}
return terraform.InitializeProvider(powervs.PlatformStages), nil
case openstacktypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(openstackcapi.Provider{}), nil
}
return terraform.InitializeProvider(openstack.PlatformStages), nil
case ovirttypes.Name:
return terraform.InitializeProvider(ovirt.PlatformStages), nil
case vspheretypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(vspherecapi.Provider{}), nil
}
return terraform.InitializeProvider(vsphere.PlatformStages), nil
Expand Down
18 changes: 9 additions & 9 deletions pkg/infrastructure/platform/platform_altinfra.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package platform
import (
"fmt"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/installer/pkg/infrastructure"
awscapi "github.com/openshift/installer/pkg/infrastructure/aws/clusterapi"
awsinfra "github.com/openshift/installer/pkg/infrastructure/aws/sdk"
Expand All @@ -18,6 +17,7 @@ import (
openstackcapi "github.com/openshift/installer/pkg/infrastructure/openstack/clusterapi"
powervscapi "github.com/openshift/installer/pkg/infrastructure/powervs/clusterapi"
vspherecapi "github.com/openshift/installer/pkg/infrastructure/vsphere/clusterapi"
"github.com/openshift/installer/pkg/types"
awstypes "github.com/openshift/installer/pkg/types/aws"
azuretypes "github.com/openshift/installer/pkg/types/azure"
"github.com/openshift/installer/pkg/types/featuregates"
Expand All @@ -33,40 +33,40 @@ import (
func ProviderForPlatform(platform string, fg featuregates.FeatureGate) (infrastructure.Provider, error) {
switch platform {
case awstypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(&awscapi.Provider{}), nil
}
return awsinfra.InitializeProvider(), nil
case azuretypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(&azurecapi.Provider{}), nil
}
return nil, nil
case gcptypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(gcpcapi.Provider{}), nil
}
return nil, nil
case ibmcloudtypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(ibmcloudcapi.Provider{}), nil
}
return nil, nil
case vspheretypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(vspherecapi.Provider{}), nil
}
case powervstypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(powervscapi.Provider{}), nil
}
return nil, nil
case openstacktypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(openstackcapi.Provider{}), nil
}
case nutanixtypes.Name:
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
if types.ClusterAPIFeatureGateEnabled(platform, fg) {
return clusterapi.InitializeProvider(nutanixcapi.Provider{}), nil
}
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/types/featuregates/featuregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import (
"k8s.io/apimachinery/pkg/util/sets"

configv1 "github.com/openshift/api/config/v1"
features "github.com/openshift/api/features"
)

func toFeatureGateNames(in []configv1.FeatureGateDescription) []configv1.FeatureGateName {
func toFeatureGateNames(in []features.FeatureGateDescription) []configv1.FeatureGateName {
out := []configv1.FeatureGateName{}
for _, curr := range in {
out = append(out, curr.FeatureGateAttributes.Name)
Expand All @@ -21,7 +22,7 @@ func toFeatureGateNames(in []configv1.FeatureGateDescription) []configv1.Feature
}

// completeFeatureGates identifies every known feature and ensures that is explicitly on or explicitly off.
func completeFeatureGates(knownFeatureSets map[configv1.FeatureSet]*configv1.FeatureGateEnabledDisabled, enabled, disabled []configv1.FeatureGateName) ([]configv1.FeatureGateName, []configv1.FeatureGateName) {
func completeFeatureGates(knownFeatureSets map[configv1.FeatureSet]*features.FeatureGateEnabledDisabled, enabled, disabled []configv1.FeatureGateName) ([]configv1.FeatureGateName, []configv1.FeatureGateName) {
specificallyEnabledFeatureGates := sets.New[configv1.FeatureGateName]()
specificallyEnabledFeatureGates.Insert(enabled...)

Expand All @@ -41,7 +42,7 @@ func completeFeatureGates(knownFeatureSets map[configv1.FeatureSet]*configv1.Fea
}

// FeatureGateFromFeatureSets creates a FeatureGate from the active feature sets.
func FeatureGateFromFeatureSets(knownFeatureSets map[configv1.FeatureSet]*configv1.FeatureGateEnabledDisabled, fs configv1.FeatureSet, customFS *configv1.CustomFeatureGates) FeatureGate {
func FeatureGateFromFeatureSets(knownFeatureSets map[configv1.FeatureSet]*features.FeatureGateEnabledDisabled, fs configv1.FeatureSet, customFS *configv1.CustomFeatureGates) FeatureGate {
if customFS != nil {
completeEnabled, completeDisabled := completeFeatureGates(knownFeatureSets, customFS.Enabled, customFS.Disabled)
return newFeatureGate(completeEnabled, completeDisabled)
Expand Down
8 changes: 4 additions & 4 deletions pkg/types/gcp/validation/featuregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package validation
import (
"k8s.io/apimachinery/pkg/util/validation/field"

configv1 "github.com/openshift/api/config/v1"
features "github.com/openshift/api/features"
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/featuregates"
"github.com/openshift/installer/pkg/types/gcp"
Expand All @@ -15,17 +15,17 @@ func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeat
g := c.GCP
return []featuregates.GatedInstallConfigFeature{
{
FeatureGateName: configv1.FeatureGateGCPLabelsTags,
FeatureGateName: features.FeatureGateGCPLabelsTags,
Condition: len(g.UserLabels) > 0,
Field: field.NewPath("platform", "gcp", "userLabels"),
},
{
FeatureGateName: configv1.FeatureGateGCPLabelsTags,
FeatureGateName: features.FeatureGateGCPLabelsTags,
Condition: len(g.UserTags) > 0,
Field: field.NewPath("platform", "gcp", "userTags"),
},
{
FeatureGateName: configv1.FeatureGateGCPClusterHostedDNS,
FeatureGateName: features.FeatureGateGCPClusterHostedDNS,
Condition: g.UserProvisionedDNS == gcp.UserProvisionedDNSEnabled,
Field: field.NewPath("platform", "gcp", "userProvisionedDNS"),
},
Expand Down
36 changes: 35 additions & 1 deletion pkg/types/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

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 @@ -549,11 +550,44 @@ func (c *InstallConfig) EnabledFeatureGates() featuregates.FeatureGate {
}

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

return fg
}

// ClusterAPIFeatureGateEnabled checks whether feature gates enabling
// cluster api installs are enabled.
func ClusterAPIFeatureGateEnabled(platform string, fgs featuregates.FeatureGate) bool {
// FeatureGateClusterAPIInstall enables for all platforms.
if fgs.Enabled(features.FeatureGateClusterAPIInstall) {
return true
}

// Check if CAPI install is enabled for individual platforms.
switch platform {
case aws.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallAWS)
case azure.StackTerraformName, azure.StackCloud.Name():
return false
case azure.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallAzure)
case gcp.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallGCP)
case ibmcloud.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallIBMCloud)
case nutanix.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallNutanix)
case openstack.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallOpenStack)
case powervs.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallPowerVS)
case vsphere.Name:
return fgs.Enabled(features.FeatureGateClusterAPIInstallVSphere)
default:
return false
}
}
7 changes: 4 additions & 3 deletions pkg/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/sirupsen/logrus"

configv1 "github.com/openshift/api/config/v1"
features "github.com/openshift/api/features"
)

// StringsToIPs is used to convert list of strings to list of IP addresses.
Expand Down Expand Up @@ -42,15 +43,15 @@ func MachineNetworksToCIDRs(nets []MachineNetworkEntry) []configv1.CIDR {

// GetClusterProfileName utility method to retrieve the cluster profile setting. This is used
// when dealing with openshift api to get FeatureSets.
func GetClusterProfileName() configv1.ClusterProfileName {
func GetClusterProfileName() features.ClusterProfileName {
// Get cluster profile for new FeatureGate access. Blank is no longer an option, so default to
// SelfManaged.
clusterProfile := configv1.SelfManaged
clusterProfile := features.SelfManaged
if cp := os.Getenv("OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE"); cp != "" {
logrus.Warnf("Found override for Cluster Profile: %q", cp)
// All profiles when getting FeatureSets need to have "include.release.openshift.io/" at the beginning.
// See vendor/openshift/api/config/v1/feature_gates.go for more info.
clusterProfile = configv1.ClusterProfileName(fmt.Sprintf("%s%s", "include.release.openshift.io/", cp))
clusterProfile = features.ClusterProfileName(fmt.Sprintf("%s%s", "include.release.openshift.io/", cp))
}
return clusterProfile
}
5 changes: 3 additions & 2 deletions pkg/types/validation/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
utilsnet "k8s.io/utils/net"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/api/features"
operv1 "github.com/openshift/api/operator/v1"
"github.com/openshift/installer/pkg/hostcrypt"
"github.com/openshift/installer/pkg/ipnet"
Expand Down Expand Up @@ -1229,14 +1230,14 @@ func ValidateFeatureSet(c *types.InstallConfig) field.ErrorList {
allErrs := field.ErrorList{}

clusterProfile := types.GetClusterProfileName()
featureSets, ok := configv1.AllFeatureSets()[clusterProfile]
featureSets, ok := features.AllFeatureSets()[clusterProfile]
if !ok {
logrus.Warnf("no feature sets for cluster profile %q", clusterProfile)
}
if _, ok := featureSets[c.FeatureSet]; c.FeatureSet != configv1.CustomNoUpgrade && !ok {
sortedFeatureSets := func() []string {
v := []string{}
for n := range configv1.AllFeatureSets()[clusterProfile] {
for n := range features.AllFeatureSets()[clusterProfile] {
v = append(v, string(n))
}
// Add CustomNoUpgrade since it is not part of features sets for profiles
Expand Down
Loading