Skip to content

Commit c125458

Browse files
authored
Merge pull request #3298 from willie-yao/bump-capi-1.4.0
Bump CAPI to v1.4.1
2 parents 8fefb1a + c5b2ffc commit c125458

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+228
-227
lines changed

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ run:
22
deadline: 10m
33
skip-files:
44
- 'zz_generated\.(\w*)\.go$'
5+
skip-dirs:
6+
- 'api/v1alpha3'
7+
- 'api/v1alpha4'
8+
- 'exp/api/v1alpha3'
9+
- 'exp/api/v1alpha4'
510
build-tags:
611
- e2e
712
linters:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ KPROMO_VER := v3.5.1
101101
KPROMO_BIN := kpromo
102102
KPROMO := $(TOOLS_BIN_DIR)/$(KPROMO_BIN)-$(KPROMO_VER)
103103

104-
GO_APIDIFF_VER := v0.5.0
104+
GO_APIDIFF_VER := v0.6.0
105105
GO_APIDIFF_BIN := go-apidiff
106106
GO_APIDIFF := $(TOOLS_BIN_DIR)/$(GO_APIDIFF_BIN)
107107

@@ -281,7 +281,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) $(KIND) ## Create
281281
./hack/create-custom-cloud-provider-config.sh
282282

283283
# Deploy CAPI
284-
curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.5/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -
284+
curl --retry $(CURL_RETRIES) -sSL https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.1/cluster-api-components.yaml | $(ENVSUBST) | $(KUBECTL) apply -f -
285285

286286
# Deploy CAPZ
287287
$(KIND) load docker-image $(CONTROLLER_IMG)-$(ARCH):$(TAG) --name=$(KIND_CLUSTER_NAME)

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ settings = {
1919
"deploy_cert_manager": True,
2020
"preload_images_for_kind": True,
2121
"kind_cluster_name": "capz",
22-
"capi_version": "v1.3.5",
22+
"capi_version": "v1.4.1",
2323
"cert_manager_version": "v1.11.0",
2424
"kubernetes_version": "v1.24.6",
2525
"aks_kubernetes_version": "v1.24.6",

api/v1beta1/azuremachine_default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (m *AzureMachine) SetDefaults(client client.Client) error {
229229
}
230230

231231
// Fetch the Cluster.
232-
clusterName, ok := m.Labels[clusterv1.ClusterLabelName]
232+
clusterName, ok := m.Labels[clusterv1.ClusterNameLabel]
233233
if !ok {
234234
errs = append(errs, errors.Errorf("failed to fetch ClusterName for AzureMachine %s/%s", m.Namespace, m.Name))
235235
}

api/v1beta1/azuremachine_default_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ func hardcodedAzureMachineWithSSHKey(sshPublicKey string) *AzureMachine {
549549
return &AzureMachine{
550550
ObjectMeta: metav1.ObjectMeta{
551551
Labels: map[string]string{
552-
clusterv1.ClusterLabelName: "test-cluster",
552+
clusterv1.ClusterNameLabel: "test-cluster",
553553
},
554554
},
555555
Spec: AzureMachineSpec{

api/v1beta1/azuremachine_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ func TestAzureMachine_Default(t *testing.T) {
746746
publicKeyNotExistTest := test{machine: createMachineWithSSHPublicKey("")}
747747
testObjectMeta := metav1.ObjectMeta{
748748
Labels: map[string]string{
749-
clusterv1.ClusterLabelName: "test-cluster",
749+
clusterv1.ClusterNameLabel: "test-cluster",
750750
},
751751
}
752752

api/v1beta1/azuremanagedcontrolplane_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ func (m *AzureManagedControlPlane) validateManagedClusterNetwork(cli client.Clie
373373
ctx := context.Background()
374374

375375
// Fetch the Cluster.
376-
clusterName, ok := m.Labels[clusterv1.ClusterLabelName]
376+
clusterName, ok := m.Labels[clusterv1.ClusterNameLabel]
377377
if !ok {
378378
return nil
379379
}

api/v1beta1/azuremanagedmachinepool_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (m *AzureManagedMachinePool) validateLastSystemNodePool(cli client.Client)
289289
ctx := context.Background()
290290

291291
// Fetch the Cluster.
292-
clusterName, ok := m.Labels[clusterv1.ClusterLabelName]
292+
clusterName, ok := m.Labels[clusterv1.ClusterNameLabel]
293293
if !ok {
294294
return nil
295295
}
@@ -314,7 +314,7 @@ func (m *AzureManagedMachinePool) validateLastSystemNodePool(cli client.Client)
314314

315315
opt1 := client.InNamespace(m.Namespace)
316316
opt2 := client.MatchingLabels(map[string]string{
317-
clusterv1.ClusterLabelName: clusterName,
317+
clusterv1.ClusterNameLabel: clusterName,
318318
LabelAgentPoolMode: string(NodePoolModeSystem),
319319
})
320320

api/v1beta1/azuremanagedmachinepool_webhook_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,12 @@ func TestAzureManagedMachinePoolUpdatingWebhook(t *testing.T) {
547547
name: "Can't update SubnetName with error",
548548
new: &AzureManagedMachinePool{
549549
Spec: AzureManagedMachinePoolSpec{
550-
SubnetName: pointer.StringPtr("my-subnet"),
550+
SubnetName: pointer.String("my-subnet"),
551551
},
552552
},
553553
old: &AzureManagedMachinePool{
554554
Spec: AzureManagedMachinePoolSpec{
555-
SubnetName: pointer.StringPtr("my-subnet-1"),
555+
SubnetName: pointer.String("my-subnet-1"),
556556
},
557557
},
558558
wantErr: true,
@@ -561,7 +561,7 @@ func TestAzureManagedMachinePoolUpdatingWebhook(t *testing.T) {
561561
name: "Can update SubnetName if subnetName is empty",
562562
new: &AzureManagedMachinePool{
563563
Spec: AzureManagedMachinePoolSpec{
564-
SubnetName: pointer.StringPtr("my-subnet"),
564+
SubnetName: pointer.String("my-subnet"),
565565
},
566566
},
567567
old: &AzureManagedMachinePool{
@@ -575,12 +575,12 @@ func TestAzureManagedMachinePoolUpdatingWebhook(t *testing.T) {
575575
name: "Can't update SubnetName without error",
576576
new: &AzureManagedMachinePool{
577577
Spec: AzureManagedMachinePoolSpec{
578-
SubnetName: pointer.StringPtr("my-subnet"),
578+
SubnetName: pointer.String("my-subnet"),
579579
},
580580
},
581581
old: &AzureManagedMachinePool{
582582
Spec: AzureManagedMachinePoolSpec{
583-
SubnetName: pointer.StringPtr("my-subnet"),
583+
SubnetName: pointer.String("my-subnet"),
584584
},
585585
},
586586
wantErr: false,
@@ -650,7 +650,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
650650
name: "invalid subnetname",
651651
ammp: &AzureManagedMachinePool{
652652
Spec: AzureManagedMachinePoolSpec{
653-
SubnetName: pointer.StringPtr("1+subnet"),
653+
SubnetName: pointer.String("1+subnet"),
654654
},
655655
},
656656
wantErr: true,
@@ -660,7 +660,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
660660
name: "invalid subnetname",
661661
ammp: &AzureManagedMachinePool{
662662
Spec: AzureManagedMachinePoolSpec{
663-
SubnetName: pointer.StringPtr("1"),
663+
SubnetName: pointer.String("1"),
664664
},
665665
},
666666
wantErr: true,
@@ -670,7 +670,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
670670
name: "invalid subnetname",
671671
ammp: &AzureManagedMachinePool{
672672
Spec: AzureManagedMachinePoolSpec{
673-
SubnetName: pointer.StringPtr("-a_b-c"),
673+
SubnetName: pointer.String("-a_b-c"),
674674
},
675675
},
676676
wantErr: true,
@@ -680,7 +680,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
680680
name: "invalid subnetname",
681681
ammp: &AzureManagedMachinePool{
682682
Spec: AzureManagedMachinePoolSpec{
683-
SubnetName: pointer.StringPtr("E-a_b-c"),
683+
SubnetName: pointer.String("E-a_b-c"),
684684
},
685685
},
686686
wantErr: true,
@@ -690,7 +690,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
690690
name: "invalid subnetname",
691691
ammp: &AzureManagedMachinePool{
692692
Spec: AzureManagedMachinePoolSpec{
693-
SubnetName: pointer.StringPtr("-_-_"),
693+
SubnetName: pointer.String("-_-_"),
694694
},
695695
},
696696
wantErr: true,
@@ -700,7 +700,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
700700
name: "invalid subnetname",
701701
ammp: &AzureManagedMachinePool{
702702
Spec: AzureManagedMachinePoolSpec{
703-
SubnetName: pointer.StringPtr("abc@#$"),
703+
SubnetName: pointer.String("abc@#$"),
704704
},
705705
},
706706
wantErr: true,
@@ -710,7 +710,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
710710
name: "invalid subnetname with character length 81",
711711
ammp: &AzureManagedMachinePool{
712712
Spec: AzureManagedMachinePoolSpec{
713-
SubnetName: pointer.StringPtr("3DgIb8EZMkLs0KlyPaTcNxoJU9ufmW6jvXrweqz1hVp5nS4RtH2QY7AFOiC5nS4RtH2QY7AFOiC3DgIb8"),
713+
SubnetName: pointer.String("3DgIb8EZMkLs0KlyPaTcNxoJU9ufmW6jvXrweqz1hVp5nS4RtH2QY7AFOiC5nS4RtH2QY7AFOiC3DgIb8"),
714714
},
715715
},
716716
wantErr: true,
@@ -720,7 +720,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
720720
name: "valid subnetname with character length 80",
721721
ammp: &AzureManagedMachinePool{
722722
Spec: AzureManagedMachinePoolSpec{
723-
SubnetName: pointer.StringPtr("3DgIb8EZMkLs0KlyPaTcNxoJU9ufmW6jvXrweqz1hVp5nS4RtH2QY7AFOiC5nS4RtH2QY7AFOiC3DgIb"),
723+
SubnetName: pointer.String("3DgIb8EZMkLs0KlyPaTcNxoJU9ufmW6jvXrweqz1hVp5nS4RtH2QY7AFOiC5nS4RtH2QY7AFOiC3DgIb"),
724724
},
725725
},
726726
wantErr: false,
@@ -729,7 +729,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
729729
name: "valid subnetname",
730730
ammp: &AzureManagedMachinePool{
731731
Spec: AzureManagedMachinePoolSpec{
732-
SubnetName: pointer.StringPtr("1abc"),
732+
SubnetName: pointer.String("1abc"),
733733
},
734734
},
735735
wantErr: false,
@@ -738,7 +738,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
738738
name: "valid subnetname",
739739
ammp: &AzureManagedMachinePool{
740740
Spec: AzureManagedMachinePoolSpec{
741-
SubnetName: pointer.StringPtr("1-a-b-c"),
741+
SubnetName: pointer.String("1-a-b-c"),
742742
},
743743
},
744744
wantErr: false,
@@ -747,7 +747,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
747747
name: "valid subnetname",
748748
ammp: &AzureManagedMachinePool{
749749
Spec: AzureManagedMachinePoolSpec{
750-
SubnetName: pointer.StringPtr("my-subnet"),
750+
SubnetName: pointer.String("my-subnet"),
751751
},
752752
},
753753
wantErr: false,
@@ -1118,7 +1118,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) {
11181118
ammp: &AzureManagedMachinePool{
11191119
Spec: AzureManagedMachinePoolSpec{
11201120
KubeletConfig: &KubeletConfig{
1121-
FailSwapOn: pointer.BoolPtr(true),
1121+
FailSwapOn: pointer.Bool(true),
11221122
},
11231123
LinuxOSConfig: &LinuxOSConfig{
11241124
SwapFileSizeMB: pointer.Int32(1500),
@@ -1203,7 +1203,7 @@ func TestAzureManagedMachinePool_validateLastSystemNodePool(t *testing.T) {
12031203
ammp: systemMachinePool,
12041204
cluster: &clusterv1.Cluster{
12051205
ObjectMeta: metav1.ObjectMeta{
1206-
Name: systemMachinePool.GetLabels()[clusterv1.ClusterLabelName],
1206+
Name: systemMachinePool.GetLabels()[clusterv1.ClusterNameLabel],
12071207
Namespace: systemMachinePool.Namespace,
12081208
DeletionTimestamp: &deletionTime,
12091209
},
@@ -1218,7 +1218,7 @@ func TestAzureManagedMachinePool_validateLastSystemNodePool(t *testing.T) {
12181218
ammp: systemMachinePool,
12191219
cluster: &clusterv1.Cluster{
12201220
ObjectMeta: metav1.ObjectMeta{
1221-
Name: systemMachinePool.GetLabels()[clusterv1.ClusterLabelName],
1221+
Name: systemMachinePool.GetLabels()[clusterv1.ClusterNameLabel],
12221222
Namespace: systemMachinePool.Namespace,
12231223
DeletionTimestamp: &deletionTime,
12241224
},
@@ -1233,7 +1233,7 @@ func TestAzureManagedMachinePool_validateLastSystemNodePool(t *testing.T) {
12331233
ammp: systemMachinePool,
12341234
cluster: &clusterv1.Cluster{
12351235
ObjectMeta: metav1.ObjectMeta{
1236-
Name: systemMachinePool.GetLabels()[clusterv1.ClusterLabelName],
1236+
Name: systemMachinePool.GetLabels()[clusterv1.ClusterNameLabel],
12371237
Namespace: systemMachinePool.Namespace,
12381238
},
12391239
},
@@ -1244,7 +1244,7 @@ func TestAzureManagedMachinePool_validateLastSystemNodePool(t *testing.T) {
12441244
ammp: systemMachinePool,
12451245
cluster: &clusterv1.Cluster{
12461246
ObjectMeta: metav1.ObjectMeta{
1247-
Name: systemMachinePool.GetLabels()[clusterv1.ClusterLabelName],
1247+
Name: systemMachinePool.GetLabels()[clusterv1.ClusterNameLabel],
12481248
Namespace: systemMachinePool.Namespace,
12491249
DeletionTimestamp: &deletionTime,
12501250
},
@@ -1284,7 +1284,7 @@ func getManagedMachinePoolWithSystemMode() *AzureManagedMachinePool {
12841284
ObjectMeta: metav1.ObjectMeta{
12851285
Namespace: metav1.NamespaceDefault,
12861286
Labels: map[string]string{
1287-
clusterv1.ClusterLabelName: "test-cluster",
1287+
clusterv1.ClusterNameLabel: "test-cluster",
12881288
LabelAgentPoolMode: string(NodePoolModeSystem),
12891289
},
12901290
},

azure/scope/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ func (s *ClusterScope) GenerateLegacyFQDN() (ip string, domain string) {
797797
// ListOptionsLabelSelector returns a ListOptions with a label selector for clusterName.
798798
func (s *ClusterScope) ListOptionsLabelSelector() client.ListOption {
799799
return client.MatchingLabels(map[string]string{
800-
clusterv1.ClusterLabelName: s.Cluster.Name,
800+
clusterv1.ClusterNameLabel: s.Cluster.Name,
801801
})
802802
}
803803

0 commit comments

Comments
 (0)