From fd0ceada0357f072116476db9ef683aa6e46e0f0 Mon Sep 17 00:00:00 2001 From: Roman Bednar Date: Mon, 16 Jan 2023 14:44:14 +0100 Subject: [PATCH 1/3] improve unit test message When debugging feature gate tests run with `make test-unit` it is not clear what the test expects. Adding a better log message to show all relevant values making it easier to debug. --- config/v1/types_features_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/v1/types_features_test.go b/config/v1/types_features_test.go index 50653ffcc68..62b72ecb71f 100644 --- a/config/v1/types_features_test.go +++ b/config/v1/types_features_test.go @@ -79,7 +79,7 @@ func TestFeatureBuilder(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { if !reflect.DeepEqual(tc.expected, tc.actual) { - t.Error(tc.actual) + t.Errorf("\nExpected feature gates: \n Enabled: %s \n Disabled: %s \nBut got:\n Enabled: %v \n Disabled: %s\n", tc.expected.Enabled, tc.expected.Disabled, tc.actual.Enabled, tc.actual.Disabled) } }) } From 30fda1d3f82ee6f0890a65288c2922b8af3c6598 Mon Sep 17 00:00:00 2001 From: Roman Bednar Date: Mon, 16 Jan 2023 14:17:28 +0100 Subject: [PATCH 2/3] set RetroactiveDefaultStorageClass feature as TechPreview The feature is currently beta upstream so it is enabled by default. Since there is no guarantee the feature won't be changed or removed it is safer to release this feature as TechPreview so admins will have to opt-in with TechPreviewNoUpgrade feature set in OpenShift. --- config/v1/types_feature.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/v1/types_feature.go b/config/v1/types_feature.go index 757517d2ccb..644eb650b6f 100644 --- a/config/v1/types_feature.go +++ b/config/v1/types_feature.go @@ -119,6 +119,7 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{ with("InsightsConfigAPI"). // insights, tremes (#ccx), OCP specific with("CSIInlineVolumeAdmission"). // sig-storage, jdobson, OCP specific with("MatchLabelKeysInPodTopologySpread"). // sig-scheduling, ingvagabund (#forum-workloads), Kubernetes feature gate + with("RetroactiveDefaultStorageClass"). // sig-storage, RomanBednar, Kubernetes feature gate toFeatures(), LatencySensitive: newDefaultFeatures(). with( @@ -134,7 +135,9 @@ var defaultFeatures = &FeatureGateEnabledDisabled{ "DownwardAPIHugePages", // sig-node, rphillips "OpenShiftPodSecurityAdmission", // bz-auth, stlaz, OCP specific }, - Disabled: []string{}, + Disabled: []string{ + "RetroactiveDefaultStorageClass", // sig-storage, RomanBednar, Kubernetes feature gate + }, } type featureSetBuilder struct { From 98a82c0d68b4fd63bc937acff17fb0caf9a09d93 Mon Sep 17 00:00:00 2001 From: Roman Bednar Date: Mon, 16 Jan 2023 14:48:02 +0100 Subject: [PATCH 3/3] fix unit tests --- config/v1/types_features_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/v1/types_features_test.go b/config/v1/types_features_test.go index 62b72ecb71f..d292218b3ef 100644 --- a/config/v1/types_features_test.go +++ b/config/v1/types_features_test.go @@ -26,6 +26,7 @@ func TestFeatureBuilder(t *testing.T) { "OpenShiftPodSecurityAdmission", }, Disabled: []string{ + "RetroactiveDefaultStorageClass", "APIPriorityAndFairness", }, }, @@ -41,7 +42,9 @@ func TestFeatureBuilder(t *testing.T) { "OpenShiftPodSecurityAdmission", "CSIMigrationAzureFile", }, - Disabled: []string{}, + Disabled: []string{ + "RetroactiveDefaultStorageClass", + }, }, }, { @@ -54,6 +57,7 @@ func TestFeatureBuilder(t *testing.T) { "OpenShiftPodSecurityAdmission", }, Disabled: []string{ + "RetroactiveDefaultStorageClass", "APIPriorityAndFairness", "other", }, @@ -71,7 +75,9 @@ func TestFeatureBuilder(t *testing.T) { "CSIMigrationAzureFile", "other", }, - Disabled: []string{}, + Disabled: []string{ + "RetroactiveDefaultStorageClass", + }, }, }, }