Skip to content

Commit c8a5f18

Browse files
committed
MachineSet: Promote MachineSetPreflightChecks to Beta
1 parent 404084f commit c8a5f18

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"
@@ -1439,8 +1437,6 @@ func TestMachineSetReconciler_syncMachines(t *testing.T) {
14391437

14401438
func TestMachineSetReconciler_reconcileUnhealthyMachines(t *testing.T) {
14411439
t.Run("should delete unhealthy machines if preflight checks pass", func(t *testing.T) {
1442-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
1443-
14441440
g := NewWithT(t)
14451441

14461442
controlPlaneStable := builder.ControlPlane("default", "cp1").
@@ -1499,8 +1495,6 @@ func TestMachineSetReconciler_reconcileUnhealthyMachines(t *testing.T) {
14991495
})
15001496

15011497
t.Run("should update the unhealthy machine MachineOwnerRemediated condition if preflight checks did not pass", func(t *testing.T) {
1502-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
1503-
15041498
g := NewWithT(t)
15051499

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

19151909
func TestMachineSetReconciler_syncReplicas(t *testing.T) {
19161910
t.Run("should hold off on creating new machines when preflight checks do not pass", func(t *testing.T) {
1917-
utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.MachineSetPreflightChecks, true)
1918-
19191911
g := NewWithT(t)
19201912

19211913
// 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)