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
12 changes: 1 addition & 11 deletions pkg/types/gcp/validation/featuregates.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
package validation

import (
"k8s.io/apimachinery/pkg/util/validation/field"

features "github.com/openshift/api/features"
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/featuregates"
)

// GatedFeatures determines all of the install config fields that should
// be validated to ensure that the proper featuregate is enabled when the field is used.
func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeature {
g := c.GCP
return []featuregates.GatedInstallConfigFeature{
{
FeatureGateName: features.FeatureGateGCPCustomAPIEndpointsInstall,
Condition: g.Endpoint != nil,
Field: field.NewPath("platform", "gcp", "endpoint"),
},
}
return []featuregates.GatedInstallConfigFeature{}
}
13 changes: 0 additions & 13 deletions pkg/types/validation/featuregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/openshift/installer/pkg/types"
"github.com/openshift/installer/pkg/types/azure"
"github.com/openshift/installer/pkg/types/dns"
gcptypes "github.com/openshift/installer/pkg/types/gcp"
"github.com/openshift/installer/pkg/types/vsphere"
)

Expand All @@ -20,18 +19,6 @@ func TestFeatureGates(t *testing.T) {
installConfig *types.InstallConfig
expected string
}{
{
name: "GCP Custom API Endpoints is not allowed without Feature Gates",
installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.GCP = validGCPPlatform()
c.GCP.Endpoint = &gcptypes.PSCEndpoint{
Name: "test-endpoint",
}
return c
}(),
expected: `^platform.gcp.endpoint: Forbidden: this field is protected by the GCPCustomAPIEndpointsInstall feature gate which must be enabled through either the TechPreviewNoUpgrade or CustomNoUpgrade feature set$`,
},
{
name: "AWS UserProvisionedDNS is not allowed without Feature Gates",
installConfig: func() *types.InstallConfig {
Expand Down