mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #116610 from xing-yang/vSphere_lock
Lock CSIMigrationvSphere feature gate for k8s 1.27
This commit is contained in:
commit
e8acfc45ba
@ -927,7 +927,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
||||
|
||||
CSIMigrationRBD: {Default: false, PreRelease: featuregate.Alpha}, // Off by default (requires RBD CSI driver)
|
||||
|
||||
CSIMigrationvSphere: {Default: true, PreRelease: featuregate.GA}, // LockToDefault when CSI driver with GA support for Windows, raw block and xfs features are available
|
||||
CSIMigrationvSphere: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29
|
||||
|
||||
CSINodeExpandSecret: {Default: true, PreRelease: featuregate.Beta},
|
||||
|
||||
|
@ -91,62 +91,6 @@ func TestIsMigratable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckMigrationFeatureFlags(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
pluginFeature featuregate.Feature
|
||||
pluginFeatureEnabled bool
|
||||
pluginUnregsiterFeature featuregate.Feature
|
||||
pluginUnregsiterEnabled bool
|
||||
expectMigrationComplete bool
|
||||
expectErr bool
|
||||
}{
|
||||
{
|
||||
name: "plugin specific migration feature enabled with plugin unregister disabled",
|
||||
pluginFeature: features.CSIMigrationvSphere,
|
||||
pluginFeatureEnabled: true,
|
||||
pluginUnregsiterFeature: features.InTreePluginvSphereUnregister,
|
||||
pluginUnregsiterEnabled: false,
|
||||
expectMigrationComplete: false,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "plugin specific migration feature and plugin unregister disabled",
|
||||
pluginFeature: features.CSIMigrationvSphere,
|
||||
pluginFeatureEnabled: false,
|
||||
pluginUnregsiterFeature: features.InTreePluginvSphereUnregister,
|
||||
pluginUnregsiterEnabled: false,
|
||||
expectMigrationComplete: false,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "all features enabled",
|
||||
pluginFeature: features.CSIMigrationvSphere,
|
||||
pluginFeatureEnabled: true,
|
||||
pluginUnregsiterFeature: features.InTreePluginvSphereUnregister,
|
||||
pluginUnregsiterEnabled: true,
|
||||
expectMigrationComplete: true,
|
||||
expectErr: false,
|
||||
},
|
||||
}
|
||||
for _, test := range testCases {
|
||||
t.Run(fmt.Sprintf("Testing %v", test.name), func(t *testing.T) {
|
||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, test.pluginFeature, test.pluginFeatureEnabled)()
|
||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, test.pluginUnregsiterFeature, test.pluginUnregsiterEnabled)()
|
||||
migrationComplete, err := CheckMigrationFeatureFlags(utilfeature.DefaultFeatureGate, test.pluginFeature, test.pluginUnregsiterFeature)
|
||||
if err != nil && test.expectErr == false {
|
||||
t.Errorf("Unexpected error: %v", err)
|
||||
}
|
||||
if err == nil && test.expectErr == true {
|
||||
t.Errorf("Unexpected validation pass")
|
||||
}
|
||||
if migrationComplete != test.expectMigrationComplete {
|
||||
t.Errorf("Unexpected migrationComplete result. Exp: %v, got %v", test.expectMigrationComplete, migrationComplete)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestMigrationFeatureFlagStatus(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
|
Loading…
Reference in New Issue
Block a user