Skip to content

Commit 03c068a

Browse files
sedefsavasAnkitasw
authored andcommitted
Bump API version in e2e tests
Co-authored-by: Ankita Swamy <[email protected]> Co-authored-by: Sedef Savas <[email protected]>
1 parent 586c87c commit 03c068a

File tree

97 files changed

+415
-482
lines changed

Some content is hidden

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

97 files changed

+415
-482
lines changed

.golangci.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,25 @@ linters-settings:
8585
alias: utilconversion
8686
- pkg: k8s.io/apimachinery/pkg/conversion
8787
alias: apiconversion
88-
- pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1beta1
88+
- pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1beta2
8989
alias: infrav1
90-
- pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3
91-
alias: expinfrav1alpha3
92-
- pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4
93-
alias: expinfrav1alpha4
90+
- pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1beta1
91+
alias: infrav1beta1
9492
- pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1
93+
alias: expinfrav1beta1
94+
- pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta2
9595
alias: expinfrav1
96-
- pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4
97-
alias: infrav1alpha4
98-
- pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3
99-
alias: infrav1alpha3
10096
- pkg: k8s.io/client-go/kubernetes/scheme
10197
alias: cgscheme
10298
- pkg: k8s.io/client-go/tools/record
10399
alias: cgrecord
104-
- pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3
105-
alias: eksbootstrapv1alpha3
106-
- pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4
107-
alias: eksbootstrapv1alpha4
108100
- pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1
101+
alias: eksbootstrapv1beta1
102+
- pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta2
109103
alias: eksbootstrapv1
110-
- pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3
111-
alias: ekscontrolplanev1alpha3
112-
- pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4
113-
alias: ekscontrolplanev1alpha4
114104
- pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1
105+
alias: ekscontrolplanev1beta1
106+
- pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta2
115107
alias: ekscontrolplanev1
116108
- pkg: "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/controllers"
117109
alias: eksbootstrapcontrollers
@@ -125,10 +117,6 @@ linters-settings:
125117
alias: runtimeserializer
126118
- pkg: "k8s.io/apimachinery/pkg/runtime/serializer/yaml"
127119
alias: yamlserializer
128-
- pkg: "sigs.k8s.io/cluster-api/api/v1alpha3"
129-
alias: clusterv1alpha3
130-
- pkg: "sigs.k8s.io/cluster-api/api/v1alpha4"
131-
alias: clusterv1alpha4
132120
- pkg: "sigs.k8s.io/cluster-api/api/v1beta1"
133121
alias: clusterv1
134122
- pkg: "sigs.k8s.io/cluster-api/util/defaulting"
@@ -210,7 +198,7 @@ issues:
210198
- linters:
211199
- godot
212200
text: "Comment should end in a period"
213-
path: "(.*)/(v1alpha3|v1alpha4|v1alpha1)/(.*)types.go"
201+
path: "(.*)/(v1beta1|v1beta2)/(.*)types.go"
214202
- linters:
215203
- errcheck
216204
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked

api/v1beta1/bastion.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@ package v1beta1
1919
import (
2020
"fmt"
2121
"net"
22-
"regexp"
2322

2423
"k8s.io/apimachinery/pkg/util/validation/field"
2524
)
2625

27-
var (
28-
sshKeyValidNameRegex = regexp.MustCompile(`^[[:graph:]]+([[:print:]]*[[:graph:]]+)*$`)
29-
)
30-
3126
// Validate will validate the bastion fields.
3227
func (b *Bastion) Validate() []*field.Error {
3328
var errs field.ErrorList
@@ -48,16 +43,3 @@ func (b *Bastion) Validate() []*field.Error {
4843
}
4944
return errs
5045
}
51-
52-
func validateSSHKeyName(sshKeyName *string) field.ErrorList {
53-
var allErrs field.ErrorList
54-
switch {
55-
case sshKeyName == nil:
56-
// nil is accepted
57-
case sshKeyName != nil && *sshKeyName == "":
58-
// empty string is accepted
59-
case sshKeyName != nil && !sshKeyValidNameRegex.Match([]byte(*sshKeyName)):
60-
allErrs = append(allErrs, field.Invalid(field.NewPath("sshKeyName"), sshKeyName, "Name is invalid. Must be specified in ASCII and must not start or end in whitespace"))
61-
}
62-
return allErrs
63-
}

api/v1beta1/conversion.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2021 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

api/v1beta1/conversion_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2021 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

bootstrap/eks/api/v1beta2/groupversion_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
// package v1beta2 contains API Schema definitions for the Amazon EKS Bootstrap v1beta2 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=bootstrap.cluster.x-k8s.io
20+
2021
package v1beta2
2122

2223
import (

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedclusters.yaml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,72 @@ spec:
3737
name: Endpoint
3838
priority: 1
3939
type: string
40-
name: v1alpha3
40+
name: v1beta1
41+
schema:
42+
openAPIV3Schema:
43+
description: AWSManagedCluster is the Schema for the awsmanagedclusters API
44+
properties:
45+
apiVersion:
46+
description: 'APIVersion defines the versioned schema of this representation
47+
of an object. Servers should convert recognized schemas to the latest
48+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
49+
type: string
50+
kind:
51+
description: 'Kind is a string value representing the REST resource this
52+
object represents. Servers may infer this from the endpoint the client
53+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
54+
type: string
55+
metadata:
56+
type: object
57+
spec:
58+
description: AWSManagedClusterSpec defines the desired state of AWSManagedCluster
59+
properties:
60+
controlPlaneEndpoint:
61+
description: ControlPlaneEndpoint represents the endpoint used to
62+
communicate with the control plane.
63+
properties:
64+
host:
65+
description: The hostname on which the API server is serving.
66+
type: string
67+
port:
68+
description: The port on which the API server is serving.
69+
format: int32
70+
type: integer
71+
required:
72+
- host
73+
- port
74+
type: object
75+
type: object
76+
status:
77+
description: AWSManagedClusterStatus defines the observed state of AWSManagedCluster
78+
properties:
79+
failureDomains:
80+
additionalProperties:
81+
description: FailureDomainSpec is the Schema for Cluster API failure
82+
domains. It allows controllers to understand how many failure
83+
domains a cluster can optionally span across.
84+
properties:
85+
attributes:
86+
additionalProperties:
87+
type: string
88+
description: Attributes is a free form map of attributes an
89+
infrastructure provider might use or require.
90+
type: object
91+
controlPlane:
92+
description: ControlPlane determines if this failure domain
93+
is suitable for use by control plane machines.
94+
type: boolean
95+
type: object
96+
description: FailureDomains specifies a list fo available availability
97+
zones that can be used
98+
type: object
99+
ready:
100+
description: Ready is when the AWSManagedControlPlane has a API server
101+
URL.
102+
type: boolean
103+
type: object
104+
type: object
105+
name: v1beta2
41106
schema:
42107
openAPIV3Schema:
43108
description: AWSManagedCluster is the Schema for the awsmanagedclusters API

config/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
commonLabels:
22
cluster.x-k8s.io/v1alpha3: v1alpha3
33
cluster.x-k8s.io/v1alpha4: v1alpha4
4-
cluster.x-k8s.io/v1beta1: v1beta1
4+
cluster.x-k8s.io/v1beta1: v1beta1_v1beta2
55

66
# This kustomization.yaml is not intended to be run by itself,
77
# since it depends on service name and namespace that are out of this kustomize package.

exp/api/v1beta2/awsmachinepool_webhook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ import (
2222
apierrors "k8s.io/apimachinery/pkg/api/errors"
2323
"k8s.io/apimachinery/pkg/runtime"
2424
"k8s.io/apimachinery/pkg/util/validation/field"
25-
"sigs.k8s.io/cluster-api-provider-aws/api/v1beta2"
2625
ctrl "sigs.k8s.io/controller-runtime"
2726
logf "sigs.k8s.io/controller-runtime/pkg/log"
2827
"sigs.k8s.io/controller-runtime/pkg/webhook"
28+
29+
"sigs.k8s.io/cluster-api-provider-aws/api/v1beta2"
2930
)
3031

3132
var log = logf.Log.WithName("awsmachinepool-resource")

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2018 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,7 +47,7 @@ import (
4447
ekscontrolplanev1beta1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1"
4548
ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta2"
4649
ekscontrolplanecontrollers "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/controllers"
47-
expinfrav1beta1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta2"
50+
expinfrav1beta1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1"
4851
expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta2"
4952
"sigs.k8s.io/cluster-api-provider-aws/exp/controlleridentitycreator"
5053
expcontrollers "sigs.k8s.io/cluster-api-provider-aws/exp/controllers"

pkg/cloud/scope/launchtemplate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)