Skip to content

Commit 377b79c

Browse files
authored
Merge pull request #11228 from chrischdi/promote-ms-preflight-checks-beta
✨ MachineSet: Promote MachineSetPreflightChecks to Beta
2 parents 56c3118 + c8a5f18 commit 377b79c

File tree

6 files changed

+5
-15
lines changed

6 files changed

+5
-15
lines changed

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- "--diagnostics-address=${CAPI_DIAGNOSTICS_ADDRESS:=:8443}"
2525
- "--insecure-diagnostics=${CAPI_INSECURE_DIAGNOSTICS:=false}"
2626
- "--use-deprecated-infra-machine-naming=${CAPI_USE_DEPRECATED_INFRA_MACHINE_NAMING:=false}"
27-
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},ClusterResourceSet=${EXP_CLUSTER_RESOURCE_SET:=true},ClusterTopology=${CLUSTER_TOPOLOGY:=false},RuntimeSDK=${EXP_RUNTIME_SDK:=false},MachineSetPreflightChecks=${EXP_MACHINE_SET_PREFLIGHT_CHECKS:=false}"
27+
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},ClusterResourceSet=${EXP_CLUSTER_RESOURCE_SET:=true},ClusterTopology=${CLUSTER_TOPOLOGY:=false},RuntimeSDK=${EXP_RUNTIME_SDK:=false},MachineSetPreflightChecks=${EXP_MACHINE_SET_PREFLIGHT_CHECKS:=true}"
2828
image: controller:latest
2929
name: manager
3030
env:

docs/book/src/developer/core/testing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ kustomize_substitutions:
266266
CLUSTER_TOPOLOGY: "true"
267267
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
268268
EXP_RUNTIME_SDK: "true"
269-
EXP_MACHINE_SET_PREFLIGHT_CHECKS: "true"
270269
```
271270
272271
</aside>

docs/book/src/tasks/experimental-features/machineset-preflight-checks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Experimental Feature: MachineSetPreflightChecks (alpha)
1+
# Experimental Feature: MachineSetPreflightChecks (beta)
22

33
The `MachineSetPreflightChecks` feature can provide additional safety while creating new Machines and remediating existing unhealthy Machines of a MachineSet.
44

feature/feature.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const (
6060
// MachineSetPreflightChecks is a feature gate for the MachineSet preflight checks functionality.
6161
//
6262
// alpha: v1.5
63+
// beta: v1.9
6364
MachineSetPreflightChecks featuregate.Feature = "MachineSetPreflightChecks"
6465
)
6566

@@ -71,10 +72,10 @@ func init() {
7172
// To add a new feature, define a key for it above and add it here.
7273
var defaultClusterAPIFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
7374
// Every feature should be initiated here:
74-
MachinePool: {Default: true, PreRelease: featuregate.Beta},
7575
ClusterResourceSet: {Default: true, PreRelease: featuregate.Beta},
76+
MachinePool: {Default: true, PreRelease: featuregate.Beta},
77+
MachineSetPreflightChecks: {Default: true, PreRelease: featuregate.Beta},
7678
ClusterTopology: {Default: false, PreRelease: featuregate.Alpha},
7779
KubeadmBootstrapFormatIgnition: {Default: false, PreRelease: featuregate.Alpha},
7880
RuntimeSDK: {Default: false, PreRelease: featuregate.Alpha},
79-
MachineSetPreflightChecks: {Default: false, PreRelease: featuregate.Alpha},
8081
}

internal/controllers/machineset/machineset_controller_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2929
"k8s.io/apimachinery/pkg/util/intstr"
3030
"k8s.io/client-go/tools/record"
31-
utilfeature "k8s.io/component-base/featuregate/testing"
3231
"k8s.io/utils/ptr"
3332
"sigs.k8s.io/controller-runtime/pkg/client"
3433
"sigs.k8s.io/controller-runtime/pkg/client/fake"
@@ -37,7 +36,6 @@ import (
3736

3837
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3938
"sigs.k8s.io/cluster-api/controllers/external"
40-
"sigs.k8s.io/cluster-api/feature"
4139
"sigs.k8s.io/cluster-api/internal/contract"
4240
"sigs.k8s.io/cluster-api/internal/test/builder"
4341
"sigs.k8s.io/cluster-api/internal/util/ssa"
@@ -1445,8 +1443,6 @@ func TestMachineSetReconciler_syncMachines(t *testing.T) {
14451443

14461444
func TestMachineSetReconciler_reconcileUnhealthyMachines(t *testing.T) {
14471445
t.Run("should delete unhealthy machines if preflight checks pass", func(t *testing.T) {
1448-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
1449-
14501446
g := NewWithT(t)
14511447

14521448
controlPlaneStable := builder.ControlPlane("default", "cp1").
@@ -1505,8 +1501,6 @@ func TestMachineSetReconciler_reconcileUnhealthyMachines(t *testing.T) {
15051501
})
15061502

15071503
t.Run("should update the unhealthy machine MachineOwnerRemediated condition if preflight checks did not pass", func(t *testing.T) {
1508-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
1509-
15101504
g := NewWithT(t)
15111505

15121506
// An upgrading control plane should cause the preflight checks to not pass.
@@ -1920,8 +1914,6 @@ func TestMachineSetReconciler_reconcileUnhealthyMachines(t *testing.T) {
19201914

19211915
func TestMachineSetReconciler_syncReplicas(t *testing.T) {
19221916
t.Run("should hold off on creating new machines when preflight checks do not pass", func(t *testing.T) {
1923-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
1924-
19251917
g := NewWithT(t)
19261918

19271919
// An upgrading control plane should cause the preflight checks to not pass.

internal/controllers/machineset/machineset_preflight_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ func TestMachineSetReconciler_runPreflightChecks(t *testing.T) {
6868
Build()
6969

7070
t.Run("should run preflight checks if the feature gate is enabled", func(t *testing.T) {
71-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
72-
7371
tests := []struct {
7472
name string
7573
cluster *clusterv1.Cluster

0 commit comments

Comments
 (0)