Skip to content

Commit

Permalink
Allow DevPreviewNoUpgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed May 7, 2024
1 parent d29e3b9 commit 86ff5da
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1964,8 +1964,8 @@ spec:
type: array
featureSet:
description: FeatureSet enables features that are not part of the default
feature set. Valid values are "Default", "TechPreviewNoUpgrade" and
"CustomNoUpgrade". When omitted, the "Default" feature set is used.
feature set. Valid values are "Default", "TechPreviewNoUpgrade", "DevPreviewNoUpgrade",
and "CustomNoUpgrade". When omitted, the "Default" feature set is used.
type: string
fips:
default: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/explain/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func Test_PrintFields(t *testing.T) {
FeatureGates enables a set of custom feature gates. May only be used in conjunction with FeatureSet "CustomNoUpgrade". Features may be enabled or disabled by providing a true or false value for the feature gate. E.g. "featureGates": ["FeatureGate1=true", "FeatureGate2=false"].
featureSet <string>
FeatureSet enables features that are not part of the default feature set. Valid values are "Default", "TechPreviewNoUpgrade" and "CustomNoUpgrade". When omitted, the "Default" feature set is used.
FeatureSet enables features that are not part of the default feature set. Valid values are "Default", "TechPreviewNoUpgrade", "DevPreviewNoUpgrade", and "CustomNoUpgrade". When omitted, the "Default" feature set is used.
fips <boolean>
Default: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/azure/validation/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func ValidatePlatform(p *azure.Platform, publish types.PublishingStrategy, fldPa
allErrs = append(allErrs, field.Invalid(fldPath.Child("outboundType"), p.OutboundType, fmt.Sprintf("%s is only allowed when installing to pre-existing network", azure.UserDefinedRoutingOutboundType)))
}
if p.OutboundType == azure.NatGatewayOutboundType {
if ic.FeatureSet != configv1.TechPreviewNoUpgrade {
if ic.FeatureSet != configv1.TechPreviewNoUpgrade && ic.FeatureSet != configv1.DevPreviewNoUpgrade {
allErrs = append(allErrs, field.Invalid(fldPath.Child("outboundType"), p.OutboundType, "not supported in this feature set"))
}
if p.VirtualNetwork != "" {
Expand Down
7 changes: 7 additions & 0 deletions pkg/types/baremetal/validation/platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ func TestValidatePlatform(t *testing.T) {
platform().LoadBalancerType("OpenShiftManagedDefault")).
FeatureSet(configv1.TechPreviewNoUpgrade).build(),
},
{
name: "allowed_feature_loadbalancer_openshift_managed_default_DevPreview",
config: installConfig().
BareMetalPlatform(
platform().LoadBalancerType("OpenShiftManagedDefault")).
FeatureSet(configv1.DevPreviewNoUpgrade).build(),
},
{
name: "allowed_feature_loadbalancer_user_managed",
config: installConfig().
Expand Down
4 changes: 2 additions & 2 deletions pkg/types/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +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/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 @@ -208,7 +208,7 @@ type InstallConfig struct {
Capabilities *Capabilities `json:"capabilities,omitempty"`

// FeatureSet enables features that are not part of the default feature set.
// Valid values are "Default", "TechPreviewNoUpgrade" and "CustomNoUpgrade".
// Valid values are "Default", "TechPreviewNoUpgrade", "DevPreviewNoUpgrade", and "CustomNoUpgrade".
// When omitted, the "Default" feature set is used.
// +optional
FeatureSet configv1.FeatureSet `json:"featureSet,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions pkg/types/validation/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import (
"github.com/openshift/installer/pkg/types/vsphere"
)

const TechPreviewNoUpgrade = "TechPreviewNoUpgrade"

func validInstallConfig() *types.InstallConfig {
return &types.InstallConfig{
TypeMeta: metav1.TypeMeta{
Expand Down

0 comments on commit 86ff5da

Please sign in to comment.