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.8 #1318

Merged
merged 7 commits into from
Oct 14, 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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.58
version: v1.61
8 changes: 7 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ linters:
- errcheck
- errchkjson
- errname
- exportloopref
- copyloopvar
- fatcontext
- ginkgolinter
- gocheckcompilerdirectives
Expand Down Expand Up @@ -148,6 +148,12 @@ issues:
- linters:
- gosec
text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
- linters:
- gosec
text: "G115: integer overflow conversion int -> int32"
- linters:
- govet
text: "printf: non-constant format string in call to sigs.k8s.io/cluster-api/util/conditions.MarkFalse"
- linters:
- revive
text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.21.10@sha256:45f2cab1eebfb90d214ab8ce896cefc320e5c8768b4b34bb402652d90c670875 as builder
FROM golang:1.22.8@sha256:b274ff14d8eb9309b61b1a45333bf0559a554ebcf6732fa2012dbed9b01ea56f as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export GOPROXY
export GO111MODULE=on

# Kubebuilder
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.29.0
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.30.0
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?=60s
export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?=60s

Expand All @@ -59,23 +59,23 @@ CONVERSION_VERIFIER:= $(TOOLS_BIN_DIR)/conversion-verifier
# Binaries.
CLUSTERCTL := $(BIN_DIR)/clusterctl

CONTROLLER_GEN_VER := v0.14.0
CONTROLLER_GEN_VER := v0.16.3
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)

CONVERSION_GEN_VER := v0.29.3
CONVERSION_GEN_VER := v0.30.5
CONVERSION_GEN_BIN := conversion-gen
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)

ENVSUBST_VER := v1.4.2
ENVSUBST_BIN := envsubst
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)

GOLANGCI_LINT_VER := v1.58.2
GOLANGCI_LINT_VER := v1.61.0
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

KIND_VER := v0.22.0
KIND_VER := v0.24.0
KIND_BIN := kind
KIND := $(TOOLS_BIN_DIR)/$(KIND_BIN)-$(KIND_VER)

Expand All @@ -87,12 +87,12 @@ RELEASE_NOTES_VER := v0.11.0
RELEASE_NOTES_BIN := release-notes
RELEASE_NOTES := $(TOOLS_BIN_DIR)/$(RELEASE_NOTES_BIN)-$(RELEASE_NOTES_VER)

GINKGO_VER := v2.19.0
GINKGO_VER := v2.20.2
GINKGO_BIN := ginkgo
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo

KUBECTL_VER := v1.29.3
KUBECTL_VER := v1.30.5
KUBECTL_BIN := kubectl
KUBECTL := $(TOOLS_BIN_DIR)/$(KUBECTL_BIN)-$(KUBECTL_VER)

Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/gcpcluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func TestGCPCluster_ValidateUpdate(t *testing.T) {
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
warn, err := test.newCluster.ValidateUpdate(test.oldCluster)
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/gcpclustertemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func TestGCPClusterTemplate_ValidateUpdate(t *testing.T) {
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
warn, err := test.newTemplate.ValidateUpdate(test.oldTemplate)
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/gcpmachine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ func TestGCPMachine_ValidateCreate(t *testing.T) {
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
warn, err := test.GCPMachine.ValidateCreate()
Expand Down
1 change: 0 additions & 1 deletion api/v1beta1/gcpmachinetemplate_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func TestGCPMachineTemplate_ValidateCreate(t *testing.T) {
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
warn, err := test.template.ValidateCreate()
Expand Down
2 changes: 1 addition & 1 deletion cloud/scope/managedcontrolplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (s *ManagedControlPlaneScope) GetCredential() *Credential {

// GetAllNodePools gets all node pools for the control plane.
func (s *ManagedControlPlaneScope) GetAllNodePools(ctx context.Context) ([]infrav1exp.GCPManagedMachinePool, []clusterv1exp.MachinePool, error) {
if s.AllManagedMachinePools == nil || len(s.AllManagedMachinePools) == 0 {
if len(s.AllManagedMachinePools) == 0 {
listOptions := []client.ListOption{
client.InNamespace(s.GCPManagedControlPlane.Namespace),
client.MatchingLabels(map[string]string{clusterv1.ClusterNameLabel: s.Cluster.Name}),
Expand Down
2 changes: 1 addition & 1 deletion cloud/scope/managedmachinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func ConvertToSdkNodePool(nodePool infrav1exp.GCPManagedMachinePool, machinePool
sdkNodePool.Config.DiskType = string(*nodePool.Spec.DiskType)
}
if nodePool.Spec.DiskSizeGB != nil {
sdkNodePool.Config.DiskSizeGb = int32(*nodePool.Spec.DiskSizeGB)
sdkNodePool.Config.DiskSizeGb = int32(*nodePool.Spec.DiskSizeGB) //nolint:gosec
}
if len(nodePool.Spec.NodeNetwork.Tags) != 0 {
sdkNodePool.Config.Tags = nodePool.Spec.NodeNetwork.Tags
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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -151,12 +151,10 @@ spec:
in "auto" mode. When set to false, the VPC network is created in
"custom" mode.


An auto mode VPC network starts with one subnet per region. Each
subnet has a predetermined range as described in Auto mode VPC
network IP ranges.


Defaults to true.
type: boolean
hostProject:
Expand Down Expand Up @@ -222,7 +220,6 @@ spec:
If unspecified, the purpose defaults to PRIVATE_RFC_1918.
The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.


Possible values:
"INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal
HTTP(S) Load Balancing.
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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpclustertemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -168,12 +168,10 @@ spec:
in "auto" mode. When set to false, the VPC network is created in
"custom" mode.


An auto mode VPC network starts with one subnet per region. Each
subnet has a predetermined range as described in Auto mode VPC
network IP ranges.


Defaults to true.
type: boolean
hostProject:
Expand Down Expand Up @@ -239,7 +237,6 @@ spec:
If unspecified, the purpose defaults to PRIVATE_RFC_1918.
The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.


Possible values:
"INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal
HTTP(S) Load Balancing.
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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpmachines.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -112,6 +112,8 @@ spec:
maxLength: 160
pattern: projects\/[-_[A-Za-z0-9]+\/locations\/[-_[A-Za-z0-9]+\/keyRings\/[-_[A-Za-z0-9]+\/cryptoKeys\/[-_[A-Za-z0-9]+
type: string
required:
- kmsKeyName
type: object
suppliedKey:
description: SuppliedKey provides the key used to create
Expand Down Expand Up @@ -336,6 +338,8 @@ spec:
maxLength: 160
pattern: projects\/[-_[A-Za-z0-9]+\/locations\/[-_[A-Za-z0-9]+\/keyRings\/[-_[A-Za-z0-9]+\/cryptoKeys\/[-_[A-Za-z0-9]+
type: string
required:
- kmsKeyName
type: object
suppliedKey:
description: SuppliedKey provides the key used to create or manage
Expand Down Expand Up @@ -451,7 +455,6 @@ spec:
reconciling the Machine and will contain a more verbose string suitable
for logging and human consumption.


This field should not be set for transitive errors that a controller
faces that are expected to be fixed automatically over
time (like service outages), but instead indicate that something is
Expand All @@ -461,7 +464,6 @@ spec:
spec, values that are unsupported by the controller, or the
responsible controller itself being critically misconfigured.


Any transient errors that occur during the reconciliation of Machines
can be added as events to the Machine object and/or logged in the
controller's output.
Expand All @@ -472,7 +474,6 @@ spec:
reconciling the Machine and will contain a succinct value suitable
for machine interpretation.


This field should not be set for transitive errors that a controller
faces that are expected to be fixed automatically over
time (like service outages), but instead indicate that something is
Expand All @@ -482,7 +483,6 @@ spec:
spec, values that are unsupported by the controller, or the
responsible controller itself being critically misconfigured.


Any transient errors that occur during the reconciliation of Machines
can be added as events to the Machine object and/or logged in the
controller's output.
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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -125,6 +125,8 @@ spec:
maxLength: 160
pattern: projects\/[-_[A-Za-z0-9]+\/locations\/[-_[A-Za-z0-9]+\/keyRings\/[-_[A-Za-z0-9]+\/cryptoKeys\/[-_[A-Za-z0-9]+
type: string
required:
- kmsKeyName
type: object
suppliedKey:
description: SuppliedKey provides the key used to
Expand Down Expand Up @@ -352,6 +354,8 @@ spec:
maxLength: 160
pattern: projects\/[-_[A-Za-z0-9]+\/locations\/[-_[A-Za-z0-9]+\/keyRings\/[-_[A-Za-z0-9]+\/cryptoKeys\/[-_[A-Za-z0-9]+
type: string
required:
- kmsKeyName
type: object
suppliedKey:
description: SuppliedKey provides the key used to create
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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpmanagedclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -147,12 +147,10 @@ spec:
in "auto" mode. When set to false, the VPC network is created in
"custom" mode.


An auto mode VPC network starts with one subnet per region. Each
subnet has a predetermined range as described in Auto mode VPC
network IP ranges.


Defaults to true.
type: boolean
hostProject:
Expand Down Expand Up @@ -218,7 +216,6 @@ spec:
If unspecified, the purpose defaults to PRIVATE_RFC_1918.
The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.


Possible values:
"INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal
HTTP(S) Load Balancing.
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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpmanagedcontrolplanes.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.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.14.0
controller-gen.kubebuilder.io/version: v0.16.3
name: gcpmanagedmachinepools.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ spec:
port: healthz
initialDelaySeconds: 10
periodSeconds: 10
terminationMessagePolicy: FallbackToLogsOnError
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
Loading