Skip to content

Commit 3161b9c

Browse files
committed
Use v1beta2 for Cluster+MachinePool in e2e
1 parent 7046014 commit 3161b9c

29 files changed

+88
-94
lines changed

test/e2e/aks.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2929
"k8s.io/apimachinery/pkg/types"
3030
"k8s.io/utils/ptr"
31-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
31+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3232
"sigs.k8s.io/cluster-api/test/framework"
3333
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
3434
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -40,7 +40,7 @@ import (
4040
type DiscoverAndWaitForAKSControlPlaneInput struct {
4141
Lister framework.Lister
4242
Getter framework.Getter
43-
Cluster *clusterv1beta1.Cluster
43+
Cluster *clusterv1.Cluster
4444
}
4545

4646
// WaitForAKSControlPlaneInitialized waits for the Azure managed control plane to be initialized.
@@ -132,7 +132,7 @@ const (
132132
)
133133

134134
// value returns the integer equivalent of controlPlaneReplicas
135-
func (r controlPlaneReplicas) value(mp *clusterv1beta1.MachinePool) int {
135+
func (r controlPlaneReplicas) value(mp *clusterv1.MachinePool) int {
136136
switch r {
137137
case atLeastOne:
138138
return 1
@@ -147,7 +147,7 @@ func WaitForAKSSystemNodePoolMachinesToExist(ctx context.Context, input WaitForC
147147
Eventually(func() bool {
148148
opt1 := client.InNamespace(input.Namespace)
149149
opt2 := client.MatchingLabels(map[string]string{
150-
clusterv1beta1.ClusterNameLabel: input.ClusterName,
150+
clusterv1.ClusterNameLabel: input.ClusterName,
151151
})
152152
opt3 := client.MatchingLabels(map[string]string{
153153
infrav1.LabelAgentPoolMode: string(infrav1.NodePoolModeSystem),
@@ -201,7 +201,7 @@ func WaitForAKSSystemNodePoolMachinesToExist(ctx context.Context, input WaitForC
201201
continue
202202
}
203203

204-
ownerMachinePool := &clusterv1beta1.MachinePool{}
204+
ownerMachinePool := &clusterv1.MachinePool{}
205205
if err := input.Getter.Get(ctx, types.NamespacedName{Namespace: input.Namespace, Name: ref.Name},
206206
ownerMachinePool); err != nil {
207207
LogWarningf("Failed to get machinePool: %+v", err)

test/e2e/aks_adopt.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
. "github.com/onsi/gomega"
2626
apierrors "k8s.io/apimachinery/pkg/api/errors"
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
28+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2929
clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
3030
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
3131
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -36,8 +36,8 @@ import (
3636
type AKSAdoptSpecInput struct {
3737
ApplyInput clusterctl.ApplyClusterTemplateAndWaitInput
3838
ApplyResult *clusterctl.ApplyClusterTemplateAndWaitResult
39-
Cluster *clusterv1beta1.Cluster
40-
MachinePools []*clusterv1beta1.MachinePool
39+
Cluster *clusterv1.Cluster
40+
MachinePools []*clusterv1.MachinePool
4141
}
4242

4343
// AKSAdoptSpec tests adopting an existing AKS cluster into management by CAPZ. It first relies on a CAPZ AKS

test/e2e/aks_autoscaler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ import (
2828
. "github.com/onsi/gomega"
2929
"k8s.io/apimachinery/pkg/types"
3030
"k8s.io/utils/ptr"
31-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
31+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3232
"sigs.k8s.io/controller-runtime/pkg/client"
3333

3434
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3535
)
3636

3737
type AKSAutoscaleSpecInput struct {
38-
Cluster *clusterv1beta1.Cluster
39-
MachinePool *clusterv1beta1.MachinePool
38+
Cluster *clusterv1.Cluster
39+
MachinePool *clusterv1.MachinePool
4040
WaitIntervals []interface{}
4141
}
4242

test/e2e/aks_azure_cluster_autoscaler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ import (
2828
. "github.com/onsi/gomega"
2929
"k8s.io/apimachinery/pkg/types"
3030
"k8s.io/utils/ptr"
31-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
3231

3332
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
33+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3434
)
3535

3636
type AKSAzureClusterAutoscalerSettingsSpecInput struct {
37-
Cluster *clusterv1beta1.Cluster
37+
Cluster *clusterv1.Cluster
3838
WaitIntervals []interface{}
3939
}
4040

test/e2e/aks_byo_node.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
"k8s.io/utils/ptr"
3131
bootstrapv1beta1 "sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta1"
32-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
3332
v1beta1conditions "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
3433
"sigs.k8s.io/controller-runtime/pkg/client"
3534

test/e2e/aks_clusterclass.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
. "github.com/onsi/gomega"
2929
"k8s.io/apimachinery/pkg/types"
3030
"k8s.io/utils/ptr"
31-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
3231
"sigs.k8s.io/controller-runtime/pkg/client"
3332

3433
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"

test/e2e/aks_fleets_member.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
. "github.com/onsi/gomega"
3232
"k8s.io/apimachinery/pkg/types"
3333
"k8s.io/utils/ptr"
34-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
34+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3535
v1beta1conditions "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
3636
"sigs.k8s.io/controller-runtime/pkg/client"
3737

@@ -40,7 +40,7 @@ import (
4040
)
4141

4242
type AKSFleetsMemberInput struct {
43-
Cluster *clusterv1beta1.Cluster
43+
Cluster *clusterv1.Cluster
4444
WaitIntervals []interface{}
4545
}
4646

test/e2e/aks_machinepools.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
. "github.com/onsi/gomega"
2929
"k8s.io/apimachinery/pkg/types"
3030
"k8s.io/utils/ptr"
31-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
31+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3232
"sigs.k8s.io/cluster-api/test/framework"
3333
"sigs.k8s.io/controller-runtime/pkg/client"
3434

@@ -38,8 +38,8 @@ import (
3838

3939
type AKSMachinePoolSpecInput struct {
4040
MgmtCluster framework.ClusterProxy
41-
Cluster *clusterv1beta1.Cluster
42-
MachinePools []*clusterv1beta1.MachinePool
41+
Cluster *clusterv1.Cluster
42+
MachinePools []*clusterv1.MachinePool
4343
WaitIntervals []interface{}
4444
}
4545

@@ -49,7 +49,7 @@ func AKSMachinePoolSpec(ctx context.Context, inputGetter func() AKSMachinePoolSp
4949

5050
for _, mp := range input.MachinePools {
5151
wg.Add(1)
52-
go func(mp *clusterv1beta1.MachinePool) {
52+
go func(mp *clusterv1.MachinePool) {
5353
defer GinkgoRecover()
5454
defer wg.Done()
5555

@@ -60,7 +60,7 @@ func AKSMachinePoolSpec(ctx context.Context, inputGetter func() AKSMachinePoolSp
6060
ClusterProxy: input.MgmtCluster,
6161
Cluster: input.Cluster,
6262
Replicas: ptr.Deref(mp.Spec.Replicas, 0) + 1,
63-
MachinePools: []*clusterv1beta1.MachinePool{mp},
63+
MachinePools: []*clusterv1.MachinePool{mp},
6464
WaitForMachinePoolToScale: input.WaitIntervals,
6565
})
6666

@@ -69,7 +69,7 @@ func AKSMachinePoolSpec(ctx context.Context, inputGetter func() AKSMachinePoolSp
6969
ClusterProxy: input.MgmtCluster,
7070
Cluster: input.Cluster,
7171
Replicas: ptr.Deref(mp.Spec.Replicas, 0) - 1,
72-
MachinePools: []*clusterv1beta1.MachinePool{mp},
72+
MachinePools: []*clusterv1.MachinePool{mp},
7373
WaitForMachinePoolToScale: input.WaitIntervals,
7474
})
7575

@@ -118,7 +118,7 @@ func AKSMachinePoolSpec(ctx context.Context, inputGetter func() AKSMachinePoolSp
118118
ClusterProxy: input.MgmtCluster,
119119
Cluster: input.Cluster,
120120
Replicas: 0,
121-
MachinePools: []*clusterv1beta1.MachinePool{mp},
121+
MachinePools: []*clusterv1.MachinePool{mp},
122122
WaitForMachinePoolToScale: input.WaitIntervals,
123123
})
124124
}
@@ -128,7 +128,7 @@ func AKSMachinePoolSpec(ctx context.Context, inputGetter func() AKSMachinePoolSp
128128
ClusterProxy: input.MgmtCluster,
129129
Cluster: input.Cluster,
130130
Replicas: originalReplicas,
131-
MachinePools: []*clusterv1beta1.MachinePool{mp},
131+
MachinePools: []*clusterv1.MachinePool{mp},
132132
WaitForMachinePoolToScale: input.WaitIntervals,
133133
})
134134
}(mp)

test/e2e/aks_marketplace.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
corev1 "k8s.io/api/core/v1"
3232
"k8s.io/apimachinery/pkg/types"
3333
"k8s.io/utils/ptr"
34-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
34+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3535
v1beta1conditions "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
3636
"sigs.k8s.io/controller-runtime/pkg/client"
3737

@@ -40,7 +40,7 @@ import (
4040
)
4141

4242
type AKSMarketplaceExtensionSpecInput struct {
43-
Cluster *clusterv1beta1.Cluster
43+
Cluster *clusterv1.Cluster
4444
WaitIntervals []interface{}
4545
}
4646

test/e2e/aks_node_labels.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ import (
2929
. "github.com/onsi/gomega"
3030
"k8s.io/apimachinery/pkg/types"
3131
"k8s.io/utils/ptr"
32-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
32+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
3333
"sigs.k8s.io/controller-runtime/pkg/client"
3434

3535
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
3636
)
3737

3838
type AKSNodeLabelsSpecInput struct {
39-
Cluster *clusterv1beta1.Cluster
40-
MachinePools []*clusterv1beta1.MachinePool
39+
Cluster *clusterv1.Cluster
40+
MachinePools []*clusterv1.MachinePool
4141
WaitForUpdate []interface{}
4242
}
4343

@@ -64,7 +64,7 @@ func AKSNodeLabelsSpec(ctx context.Context, inputGetter func() AKSNodeLabelsSpec
6464

6565
for _, mp := range input.MachinePools {
6666
wg.Add(1)
67-
go func(mp *clusterv1beta1.MachinePool) {
67+
go func(mp *clusterv1.MachinePool) {
6868
defer GinkgoRecover()
6969
defer wg.Done()
7070

0 commit comments

Comments
 (0)