diff --git a/etcd/vendor/github.com/openshift/microshift/pkg/config/apiserver.go b/etcd/vendor/github.com/openshift/microshift/pkg/config/apiserver.go index 54f6b29129..3bde9b4052 100644 --- a/etcd/vendor/github.com/openshift/microshift/pkg/config/apiserver.go +++ b/etcd/vendor/github.com/openshift/microshift/pkg/config/apiserver.go @@ -191,6 +191,9 @@ func (fg *FeatureGates) validateFeatureGates() error { switch fg.FeatureSet { case "": + if len(fg.CustomNoUpgrade.Enabled) > 0 || len(fg.CustomNoUpgrade.Disabled) > 0 { + return fmt.Errorf("CustomNoUpgrade enabled/disabled lists must be empty when FeatureSet is empty") + } return nil case FeatureSetCustomNoUpgrade: // Valid - continue with validation diff --git a/pkg/config/apiserver.go b/pkg/config/apiserver.go index 54fb5b18dc..a82fa49f94 100644 --- a/pkg/config/apiserver.go +++ b/pkg/config/apiserver.go @@ -194,6 +194,9 @@ func (fg *FeatureGates) validateFeatureGates() error { switch fg.FeatureSet { case "": + if len(fg.CustomNoUpgrade.Enabled) > 0 || len(fg.CustomNoUpgrade.Disabled) > 0 { + return fmt.Errorf("CustomNoUpgrade enabled/disabled lists must be empty when FeatureSet is empty") + } return nil case FeatureSetCustomNoUpgrade: // Valid - continue with validation diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index e2460a8002..79d9612daa 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -827,7 +827,7 @@ func TestValidate(t *testing.T) { c.ApiServer.FeatureGates.CustomNoUpgrade.Disabled = []string{"feature2"} return c }(), - expectErr: false, + expectErr: true, }, { name: "feature-gates-custom-no-upgrade-valid",