Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Bump CAPI to v1.6.x #4739

Merged
merged 7 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ E2E_SKIP_EKS_UPGRADE ?= "false"
EKS_SOURCE_TEMPLATE ?= eks/cluster-template-eks-control-plane-only.yaml

# set up `setup-envtest` to install kubebuilder dependency
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.24.2
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.28.3
damdo marked this conversation as resolved.
Show resolved Hide resolved
SETUP_ENVTEST_VER := v0.0.0-20230131074648-f5014c077fc3
SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
Expand Down Expand Up @@ -219,6 +219,7 @@ generate-go-apis: ## Alias for .build/generate-go-apis

.build/generate-go-apis: .build $(API_FILES) $(CONTROLLER_GEN) $(DEFAULTER_GEN) $(CONVERSION_GEN) ## Generate all Go api files
$(CONTROLLER_GEN) \
paths=./ \
Ankitasw marked this conversation as resolved.
Show resolved Hide resolved
paths=./api/... \
paths=./$(EXP_DIR)/api/... \
paths=./bootstrap/eks/api/... \
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions api/v1beta2/awsmachine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

utildefaulting "sigs.k8s.io/cluster-api/util/defaulting"
)
Expand Down Expand Up @@ -284,14 +284,14 @@ func TestAWSMachineUpdate(t *testing.T) {
},
newMachine: &AWSMachine{
Spec: AWSMachineSpec{
ProviderID: pointer.String("ID"),
ProviderID: ptr.To[string]("ID"),
InstanceType: "test",
AdditionalTags: Tags{
"key-1": "value-1",
},
AdditionalSecurityGroups: []AWSResourceReference{
{
ID: pointer.String("ID"),
ID: ptr.To[string]("ID"),
},
},
CloudInit: CloudInit{
Expand All @@ -316,13 +316,13 @@ func TestAWSMachineUpdate(t *testing.T) {
Spec: AWSMachineSpec{
ImageLookupOrg: "test",
InstanceType: "test",
ProviderID: pointer.String("ID"),
ProviderID: ptr.To[string]("ID"),
AdditionalTags: Tags{
"key-1": "value-1",
},
AdditionalSecurityGroups: []AWSResourceReference{
{
ID: pointer.String("ID"),
ID: ptr.To[string]("ID"),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta2/awsmachinetemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/aws/aws-sdk-go/aws"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

func TestAWSMachineTemplateValidateCreate(t *testing.T) {
Expand All @@ -38,7 +38,7 @@ func TestAWSMachineTemplateValidateCreate(t *testing.T) {
Spec: AWSMachineTemplateSpec{
Template: AWSMachineTemplateResource{
Spec: AWSMachineSpec{
ProviderID: pointer.String("something"),
ProviderID: ptr.To[string]("something"),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bootstrap/eks/api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bootstrap/eks/api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions bootstrap/eks/controllers/eksconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
Expand Down Expand Up @@ -261,14 +261,14 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1
// If not, we also check if the cluster is ipv6 based.
if config.Spec.ServiceIPV6Cidr != nil && *config.Spec.ServiceIPV6Cidr != "" {
nodeInput.ServiceIPV6Cidr = config.Spec.ServiceIPV6Cidr
nodeInput.IPFamily = pointer.String("ipv6")
nodeInput.IPFamily = ptr.To[string]("ipv6")
}

// we don't want to override any manually set configuration options.
if config.Spec.ServiceIPV6Cidr == nil && controlPlane.Spec.NetworkSpec.VPC.IsIPv6Enabled() {
log.Info("Adding ipv6 data to userdata....")
nodeInput.ServiceIPV6Cidr = pointer.String(controlPlane.Spec.NetworkSpec.VPC.IPv6.CidrBlock)
nodeInput.IPFamily = pointer.String("ipv6")
nodeInput.ServiceIPV6Cidr = ptr.To[string](controlPlane.Spec.NetworkSpec.VPC.IPv6.CidrBlock)
nodeInput.IPFamily = ptr.To[string]("ipv6")
}

// generate userdata
Expand Down Expand Up @@ -355,7 +355,7 @@ func (r *EKSConfigReconciler) storeBootstrapData(ctx context.Context, cluster *c
}
}

config.Status.DataSecretName = pointer.String(secret.Name)
config.Status.DataSecretName = ptr.To[string](secret.Name)
config.Status.Ready = true
conditions.MarkTrue(config, eksbootstrapv1.DataSecretAvailableCondition)
return nil
Expand Down Expand Up @@ -443,7 +443,7 @@ func (r *EKSConfigReconciler) createBootstrapSecret(ctx context.Context, cluster
Kind: "EKSConfig",
Name: config.Name,
UID: config.UID,
Controller: pointer.Bool(true),
Controller: ptr.To[bool](true),
},
},
},
Expand Down
24 changes: 12 additions & 12 deletions bootstrap/eks/internal/userdata/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/format"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/v2/bootstrap/eks/api/v1beta2"
)
Expand Down Expand Up @@ -77,7 +77,7 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
ContainerRuntime: pointer.String("containerd"),
ContainerRuntime: ptr.To[string]("containerd"),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -95,7 +95,7 @@ runcmd:
"node-labels": "node-role.undistro.io/infra=true",
"register-with-taints": "dedicated=infra:NoSchedule",
},
ContainerRuntime: pointer.String("containerd"),
ContainerRuntime: ptr.To[string]("containerd"),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -109,8 +109,8 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
ServiceIPV6Cidr: pointer.String("fe80:0000:0000:0000:0204:61ff:fe9d:f156/24"),
IPFamily: pointer.String("ipv6"),
ServiceIPV6Cidr: ptr.To[string]("fe80:0000:0000:0000:0204:61ff:fe9d:f156/24"),
IPFamily: ptr.To[string]("ipv6"),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -124,7 +124,7 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
UseMaxPods: pointer.Bool(false),
UseMaxPods: ptr.To[bool](false),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -138,7 +138,7 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
APIRetryAttempts: pointer.Int(5),
APIRetryAttempts: ptr.To[int](5),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -152,8 +152,8 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
PauseContainerAccount: pointer.String("12345678"),
PauseContainerVersion: pointer.String("v1"),
PauseContainerAccount: ptr.To[string]("12345678"),
PauseContainerVersion: ptr.To[string]("v1"),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -167,7 +167,7 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
DNSClusterIP: pointer.String("192.168.0.1"),
DNSClusterIP: ptr.To[string]("192.168.0.1"),
},
},
expectedBytes: []byte(`#cloud-config
Expand All @@ -181,7 +181,7 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
DockerConfigJSON: pointer.String("{\"debug\":true}"),
DockerConfigJSON: ptr.To[string]("{\"debug\":true}"),
},
},
expectedBytes: []byte(`#cloud-config
Expand Down Expand Up @@ -244,7 +244,7 @@ runcmd:
args: args{
input: &NodeInput{
ClusterName: "test-cluster",
BootstrapCommandOverride: pointer.String("/custom/mybootstrap.sh"),
BootstrapCommandOverride: ptr.To[string]("/custom/mybootstrap.sh"),
},
},
expectedBytes: []byte(`#cloud-config
Expand Down
1 change: 0 additions & 1 deletion cmd/clusterawsadm/api/ami/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha1

import (
runtime "k8s.io/apimachinery/pkg/runtime"
utilpointer "k8s.io/utils/pointer"
utilpointer "k8s.io/utils/ptr"

infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1"
Expand Down Expand Up @@ -49,7 +49,7 @@ func SetDefaults_BootstrapUser(obj *BootstrapUser) { //nolint:golint,stylecheck
// SetDefaults_AWSIAMConfigurationSpec is used by defaulter-gen.
func SetDefaults_AWSIAMConfigurationSpec(obj *AWSIAMConfigurationSpec) { //nolint:golint,stylecheck
if obj.NameSuffix == nil {
obj.NameSuffix = utilpointer.String(iamv1.DefaultNameSuffix)
obj.NameSuffix = utilpointer.To[string](iamv1.DefaultNameSuffix)
}
if obj.Partition == "" {
obj.Partition = DefaultPartitionName
Expand Down Expand Up @@ -98,7 +98,7 @@ func SetDefaults_AWSIAMConfiguration(obj *AWSIAMConfiguration) { //nolint:golint
obj.APIVersion = SchemeGroupVersion.String()
obj.Kind = "AWSIAMConfiguration"
if obj.Spec.NameSuffix == nil {
obj.Spec.NameSuffix = utilpointer.String(iamv1.DefaultNameSuffix)
obj.Spec.NameSuffix = utilpointer.To[string](iamv1.DefaultNameSuffix)
}
if obj.Spec.StackName == "" {
obj.Spec.StackName = DefaultStackName
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/clusterawsadm/api/bootstrap/v1beta1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1beta1

import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1"
Expand Down Expand Up @@ -60,7 +60,7 @@ func SetDefaults_BootstrapUser(obj *BootstrapUser) { //nolint:golint,stylecheck
// SetDefaults_AWSIAMConfigurationSpec is used by defaulter-gen.
func SetDefaults_AWSIAMConfigurationSpec(obj *AWSIAMConfigurationSpec) { //nolint:golint,stylecheck
if obj.NameSuffix == nil {
obj.NameSuffix = pointer.String(iamv1.DefaultNameSuffix)
obj.NameSuffix = ptr.To[string](iamv1.DefaultNameSuffix)
}
if obj.Partition == "" {
obj.Partition = DefaultPartitionName
Expand Down Expand Up @@ -113,7 +113,7 @@ func SetDefaults_AWSIAMConfiguration(obj *AWSIAMConfiguration) { //nolint:golint
obj.APIVersion = SchemeGroupVersion.String()
obj.Kind = "AWSIAMConfiguration"
if obj.Spec.NameSuffix == nil {
obj.Spec.NameSuffix = pointer.String(iamv1.DefaultNameSuffix)
obj.Spec.NameSuffix = ptr.To[string](iamv1.DefaultNameSuffix)
}
if obj.Spec.StackName == "" {
obj.Spec.StackName = DefaultStackName
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/clusterawsadm/cloudformation/bootstrap/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/awslabs/goformation/v4/cloudformation"
"github.com/sergi/go-diff/diffmatchpatch"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"sigs.k8s.io/yaml"

infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestRenderCloudformation(t *testing.T) {
fixture: "customsuffix",
template: func() Template {
t := NewTemplate()
t.Spec.NameSuffix = pointer.String(".custom-suffix.com")
t.Spec.NameSuffix = ptr.To[string](".custom-suffix.com")
return t
},
},
Expand Down
6 changes: 3 additions & 3 deletions cmd/clusterawsadm/cloudformation/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
go_cfn "github.com/awslabs/goformation/v4/cloudformation"
"github.com/pkg/errors"
"k8s.io/klog/v2"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/awserrors"
)
Expand Down Expand Up @@ -59,8 +59,8 @@ func (s *Service) ReconcileBootstrapStack(stackName string, t go_cfn.Template, t
stackTags := []*cfn.Tag{}
for k, v := range tags {
stackTags = append(stackTags, &cfn.Tag{
Key: pointer.String(k),
Value: pointer.String(v),
Key: ptr.To[string](k),
Value: ptr.To[string](v),
})
}
//nolint:nestif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
controller-gen.kubebuilder.io/version: v0.13.0
name: eksconfigs.bootstrap.cluster.x-k8s.io
spec:
group: bootstrap.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
controller-gen.kubebuilder.io/version: v0.13.0
name: eksconfigtemplates.bootstrap.cluster.x-k8s.io
spec:
group: bootstrap.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
controller-gen.kubebuilder.io/version: v0.13.0
name: awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io
spec:
group: controlplane.cluster.x-k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
controller-gen.kubebuilder.io/version: v0.13.0
name: rosacontrolplanes.controlplane.cluster.x-k8s.io
spec:
group: controlplane.cluster.x-k8s.io
Expand Down
Loading