Skip to content

Commit 55ddf75

Browse files
authored
Merge branch 'kubernetes-sigs:main' into af/fixNodeTaintPanic
2 parents ef0b820 + 19299de commit 55ddf75

File tree

55 files changed

+1611
-563
lines changed

Some content is hidden

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

55 files changed

+1611
-563
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,6 @@ updates:
2424
- "minor"
2525
- "patch"
2626

27-
- package-ecosystem: "docker"
28-
directory: "/"
29-
schedule:
30-
interval: daily
31-
labels:
32-
- "area/dependency"
33-
- "release-note-none"
34-
- "ok-to-test"
35-
groups:
36-
all:
37-
update-types:
38-
- "minor"
39-
- "patch"
40-
4127
- package-ecosystem: "github-actions"
4228
directory: "/"
4329
schedule:

.github/workflows/link-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222

23-
- uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # v1.0.15
23+
- uses: gaurav-nelson/github-action-markdown-link-check@3c3b66f1f7d0900e37b71eca45b63ea9eedfce31 # v1.0.17
2424
with:
2525
use-quiet-mode: 'yes'
2626
config-file: ".markdownlinkcheck.json"

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1818

19-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
19+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2020
with:
21-
go-version: "1.21"
21+
go-version: "1.23"
2222
check-latest: true
2323
cache: false
2424

2525
- name: golangci-lint
26-
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
26+
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
2727
with:
28-
version: v1.61
28+
version: v1.63

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ issues:
196196
- linters:
197197
- gocritic
198198
text: "appendAssign: append result not assigned to the same slice"
199+
# Specific exclude rules for deprecated fields that are still part of the codebase.
200+
# These should be removed as the referenced deprecated item is removed from the project.
201+
- linters:
202+
- staticcheck
203+
text: "SA1019: (s.GCPManagedControlPlane.Status.CurrentVersion|s.scope.GCPManagedControlPlane.Status.CurrentVersion|spec.ControlPlaneVersion|s.GCPManagedControlPlane.Spec.ControlPlaneVersion|s.scope.GCPManagedControlPlane.Spec.ControlPlaneVersion) is deprecated: This field will soon be removed and you are expected to use Version instead."
199204

200205
run:
201206
timeout: 10m

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Build the manager binary
16-
FROM golang:1.22.8@sha256:b274ff14d8eb9309b61b1a45333bf0559a554ebcf6732fa2012dbed9b01ea56f as builder
16+
FROM golang:1.23.7@sha256:7fb9682dbc6c9743cd911cedb39c84790e8dfeaaf87d229b78f3f6658fce507a as builder
1717
WORKDIR /workspace
1818

1919
# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy

Makefile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export GOPROXY
3232
# Active module mode, as we use go modules to manage dependencies
3333
export GO111MODULE=on
3434

35+
# Go version
36+
GOLANG_VERSION := 1.22.11
37+
3538
# Kubebuilder
36-
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.30.0
39+
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.31.0
3740
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?=60s
3841
export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?=60s
3942

@@ -59,23 +62,23 @@ CONVERSION_VERIFIER:= $(TOOLS_BIN_DIR)/conversion-verifier
5962
# Binaries.
6063
CLUSTERCTL := $(BIN_DIR)/clusterctl
6164

62-
CONTROLLER_GEN_VER := v0.16.3
65+
CONTROLLER_GEN_VER := v0.17.1
6366
CONTROLLER_GEN_BIN := controller-gen
6467
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
6568

66-
CONVERSION_GEN_VER := v0.30.5
69+
CONVERSION_GEN_VER := v0.31.5
6770
CONVERSION_GEN_BIN := conversion-gen
6871
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)
6972

7073
ENVSUBST_VER := v1.4.2
7174
ENVSUBST_BIN := envsubst
7275
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)
7376

74-
GOLANGCI_LINT_VER := v1.61.0
77+
GOLANGCI_LINT_VER := v1.63.4
7578
GOLANGCI_LINT_BIN := golangci-lint
7679
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
7780

78-
KIND_VER := v0.24.0
81+
KIND_VER := v0.26.0
7982
KIND_BIN := kind
8083
KIND := $(TOOLS_BIN_DIR)/$(KIND_BIN)-$(KIND_VER)
8184

@@ -87,12 +90,12 @@ RELEASE_NOTES_VER := v0.11.0
8790
RELEASE_NOTES_BIN := release-notes
8891
RELEASE_NOTES := $(TOOLS_BIN_DIR)/$(RELEASE_NOTES_BIN)-$(RELEASE_NOTES_VER)
8992

90-
GINKGO_VER := v2.20.2
93+
GINKGO_VER := v2.22.2
9194
GINKGO_BIN := ginkgo
9295
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)
9396
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo
9497

95-
KUBECTL_VER := v1.30.5
98+
KUBECTL_VER := v1.31.5
9699
KUBECTL_BIN := kubectl
97100
KUBECTL := $(TOOLS_BIN_DIR)/$(KUBECTL_BIN)-$(KUBECTL_VER)
98101

@@ -111,7 +114,7 @@ GOTESTSUM_BIN := gotestsum
111114
GOTESTSUM := $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)
112115

113116
# Other tools versions
114-
CERT_MANAGER_VER := v1.14.4
117+
CERT_MANAGER_VER := v1.16.3
115118

116119
# Define Docker related variables. Releases should modify and double check these vars.
117120
export GCP_PROJECT ?= $(shell gcloud config get-value project)
@@ -145,8 +148,6 @@ endif
145148
# Build time versioning details.
146149
LDFLAGS := $(shell hack/version.sh)
147150

148-
GOLANG_VERSION := 1.21.10
149-
150151
# CI
151152
CAPG_WORKER_CLUSTER_KUBECONFIG ?= "/tmp/kubeconfig"
152153

OWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
approvers:
44
- sig-cluster-lifecycle-leads
5-
- sig-gcp-leads
65
- cluster-api-admins
76
- cluster-api-maintainers
87
- cluster-api-gcp-maintainers

OWNERS_ALIASES

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ aliases:
88
- vincepri
99

1010
cluster-api-admins:
11-
- CecileRobertMichon
11+
- fabriziopandini
12+
- sbueringer
1213
- vincepri
1314

1415
cluster-api-maintainers:
@@ -18,14 +19,12 @@ aliases:
1819
- sbueringer
1920
- vincepri
2021

21-
sig-gcp-leads:
22-
- abgworrall
23-
2422
cluster-api-gcp-maintainers:
2523
- cpanato
24+
- damdo
2625
- dims
2726
- richardcase
27+
- salasberryfin
2828

2929
cluster-api-gcp-reviewers:
30-
- damdo
31-
- salasberryfin
30+

Tiltfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,23 @@ def validate_auth():
9898

9999
tilt_helper_dockerfile_header = """
100100
# Tilt image
101-
FROM golang:1.18 as tilt-helper
101+
FROM golang:1.23.6 as tilt-helper
102+
# Install delve. Note this should be kept in step with the Go release minor version.
103+
RUN go install github.com/go-delve/delve/cmd/[email protected]
102104
# Support live reloading with Tilt
103-
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
104-
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/start.sh && \
105-
chmod +x /start.sh && chmod +x /restart.sh
105+
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/restart.sh && \
106+
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/start.sh && \
107+
chmod +x /start.sh && chmod +x /restart.sh && chmod +x /go/bin/dlv && \
108+
touch /process.txt && chmod 0777 /process.txt `# pre-create PID file to allow even non-root users to run the image`
106109
"""
107110

108111
tilt_dockerfile_header = """
109-
FROM gcr.io/distroless/base:debug as tilt
112+
FROM golang:1.23.6 as tilt
110113
WORKDIR /
114+
COPY --from=tilt-helper /process.txt .
111115
COPY --from=tilt-helper /start.sh .
112116
COPY --from=tilt-helper /restart.sh .
117+
COPY --from=tilt-helper /go/bin/dlv .
113118
COPY manager .
114119
"""
115120

api/v1beta1/endpoints.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta1
18+
19+
// ServiceEndpoints contains all the gcp service endpoints that the user may override. Each field corresponds to
20+
// a service where the expected value is the url that is used to override the default API endpoint.
21+
type ServiceEndpoints struct {
22+
// ComputeServiceEndpoint is the custom endpoint url for the Compute Service
23+
// +kubebuilder:validation:Type=string
24+
// +kubebuilder:validation:Format=uri
25+
// +kubebuilder:validation:Pattern=`^https://`
26+
// +optional
27+
ComputeServiceEndpoint string `json:"compute,omitempty"`
28+
29+
// ContainerServiceEndpoint is the custom endpoint url for the Container Service
30+
// +kubebuilder:validation:Type=string
31+
// +kubebuilder:validation:Format=uri
32+
// +kubebuilder:validation:Pattern=`^https://`
33+
// +optional
34+
ContainerServiceEndpoint string `json:"container,omitempty"`
35+
36+
// IAMServiceEndpoint is the custom endpoint url for the IAM Service
37+
// +kubebuilder:validation:Type=string
38+
// +kubebuilder:validation:Format=uri
39+
// +kubebuilder:validation:Pattern=`^https://`
40+
// +optional
41+
IAMServiceEndpoint string `json:"iam,omitempty"`
42+
43+
// ResourceManagerServiceEndpoint is the custom endpoint url for the Resource Manager Service
44+
// +kubebuilder:validation:Type=string
45+
// +kubebuilder:validation:Format=uri
46+
// +kubebuilder:validation:Pattern=`^https://`
47+
// +optional
48+
ResourceManagerServiceEndpoint string `json:"resourceManager,omitempty"`
49+
}

api/v1beta1/gcpcluster_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ type GCPClusterSpec struct {
6868
// LoadBalancer contains configuration for one or more LoadBalancers.
6969
// +optional
7070
LoadBalancer LoadBalancerSpec `json:"loadBalancer,omitempty"`
71+
72+
// ServiceEndpoints contains the custom GCP Service Endpoint urls for each applicable service.
73+
// For instance, the user can specify a new endpoint for the compute service.
74+
// +optional
75+
ServiceEndpoints *ServiceEndpoints `json:"serviceEndpoints,omitempty"`
7176
}
7277

7378
// GCPClusterStatus defines the observed state of GCPCluster.

api/v1beta1/gcpmachine_types.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package v1beta1
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
"sigs.k8s.io/cluster-api/errors"
2322
)
2423

2524
const (
@@ -135,11 +134,21 @@ const (
135134
ConfidentialComputePolicyEnabled ConfidentialComputePolicy = "Enabled"
136135
// ConfidentialComputePolicyDisabled disables confidential compute for the GCP machine.
137136
ConfidentialComputePolicyDisabled ConfidentialComputePolicy = "Disabled"
137+
// ConfidentialComputePolicySEV sets AMD SEV as the VM instance's confidential computing technology of choice.
138+
ConfidentialComputePolicySEV ConfidentialComputePolicy = "AMDEncryptedVirtualization"
139+
// ConfidentialComputePolicySEVSNP sets AMD SEV-SNP as the VM instance's confidential computing technology of choice.
140+
ConfidentialComputePolicySEVSNP ConfidentialComputePolicy = "AMDEncryptedVirtualizationNestedPaging"
141+
// ConfidentialComputePolicyTDX sets Intel TDX as the VM instance's confidential computing technology of choice.
142+
ConfidentialComputePolicyTDX ConfidentialComputePolicy = "IntelTrustedDomainExtensions"
138143
)
139144

140-
// Confidential VM supports Compute Engine machine types in the following series:
145+
// Confidential VM Technology support depends on the configured machine types.
141146
// reference: https://cloud.google.com/compute/confidential-vm/docs/os-and-machine-type#machine-type
142-
var confidentialComputeSupportedMachineSeries = []string{"n2d", "c2d"}
147+
var (
148+
confidentialMachineSeriesSupportingSev = []string{"n2d", "c2d", "c3d"}
149+
confidentialMachineSeriesSupportingSevsnp = []string{"n2d"}
150+
confidentialMachineSeriesSupportingTdx = []string{"c3"}
151+
)
143152

144153
// HostMaintenancePolicy represents the desired behavior ase of a host maintenance event.
145154
type HostMaintenancePolicy string
@@ -336,10 +345,15 @@ type GCPMachineSpec struct {
336345
// +optional
337346
OnHostMaintenance *HostMaintenancePolicy `json:"onHostMaintenance,omitempty"`
338347

339-
// ConfidentialCompute Defines whether the instance should have confidential compute enabled.
340-
// If enabled OnHostMaintenance is required to be set to "Terminate".
348+
// ConfidentialCompute Defines whether the instance should have confidential compute enabled or not, and the confidential computing technology of choice.
349+
// If Disabled, the machine will not be configured to be a confidential computing instance.
350+
// If Enabled, confidential computing will be configured and AMD Secure Encrypted Virtualization will be configured by default. That is subject to change over time. If using AMD Secure Encrypted Virtualization is vital, use AMDEncryptedVirtualization explicitly instead.
351+
// If AMDEncryptedVirtualization, it will configure AMD Secure Encrypted Virtualization (AMD SEV) as the confidential computing technology.
352+
// If AMDEncryptedVirtualizationNestedPaging, it will configure AMD Secure Encrypted Virtualization Secure Nested Paging (AMD SEV-SNP) as the confidential computing technology.
353+
// If IntelTrustedDomainExtensions, it will configure Intel TDX as the confidential computing technology.
354+
// If enabled (any value other than Disabled) OnHostMaintenance is required to be set to "Terminate".
341355
// If omitted, the platform chooses a default, which is subject to change over time, currently that default is false.
342-
// +kubebuilder:validation:Enum=Enabled;Disabled
356+
// +kubebuilder:validation:Enum=Enabled;Disabled;AMDEncryptedVirtualization;AMDEncryptedVirtualizationNestedPaging;IntelTrustedDomainExtensions
343357
// +optional
344358
ConfidentialCompute *ConfidentialComputePolicy `json:"confidentialCompute,omitempty"`
345359

@@ -386,7 +400,7 @@ type GCPMachineStatus struct {
386400
// can be added as events to the Machine object and/or logged in the
387401
// controller's output.
388402
// +optional
389-
FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`
403+
FailureReason *string `json:"failureReason,omitempty"`
390404

391405
// FailureMessage will be set in the event that there is a terminal problem
392406
// reconciling the Machine and will contain a more verbose string suitable

api/v1beta1/gcpmachine_webhook.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,27 @@ func (m *GCPMachine) Default() {
109109
}
110110

111111
func validateConfidentialCompute(spec GCPMachineSpec) error {
112-
if spec.ConfidentialCompute != nil && *spec.ConfidentialCompute == ConfidentialComputePolicyEnabled {
112+
if spec.ConfidentialCompute != nil && *spec.ConfidentialCompute != ConfidentialComputePolicyDisabled {
113113
if spec.OnHostMaintenance == nil || *spec.OnHostMaintenance == HostMaintenancePolicyMigrate {
114114
return fmt.Errorf("ConfidentialCompute require OnHostMaintenance to be set to %s, the current value is: %s", HostMaintenancePolicyTerminate, HostMaintenancePolicyMigrate)
115115
}
116116

117117
machineSeries := strings.Split(spec.InstanceType, "-")[0]
118-
if !slices.Contains(confidentialComputeSupportedMachineSeries, machineSeries) {
119-
return fmt.Errorf("ConfidentialCompute require instance type in the following series: %s", confidentialComputeSupportedMachineSeries)
118+
switch *spec.ConfidentialCompute {
119+
case ConfidentialComputePolicyEnabled, ConfidentialComputePolicySEV:
120+
if !slices.Contains(confidentialMachineSeriesSupportingSev, machineSeries) {
121+
return fmt.Errorf("ConfidentialCompute %s requires any of the following machine series: %s. %s was found instead", *spec.ConfidentialCompute, strings.Join(confidentialMachineSeriesSupportingSev, ", "), spec.InstanceType)
122+
}
123+
case ConfidentialComputePolicySEVSNP:
124+
if !slices.Contains(confidentialMachineSeriesSupportingSevsnp, machineSeries) {
125+
return fmt.Errorf("ConfidentialCompute %s requires any of the following machine series: %s. %s was found instead", *spec.ConfidentialCompute, strings.Join(confidentialMachineSeriesSupportingSevsnp, ", "), spec.InstanceType)
126+
}
127+
case ConfidentialComputePolicyTDX:
128+
if !slices.Contains(confidentialMachineSeriesSupportingTdx, machineSeries) {
129+
return fmt.Errorf("ConfidentialCompute %s requires any of the following machine series: %s. %s was found instead", *spec.ConfidentialCompute, strings.Join(confidentialMachineSeriesSupportingTdx, ", "), spec.InstanceType)
130+
}
131+
default:
132+
return fmt.Errorf("invalid ConfidentialCompute %s", *spec.ConfidentialCompute)
120133
}
121134
}
122135
return nil

0 commit comments

Comments
 (0)