Skip to content

Commit 9d1355f

Browse files
Merge pull request #1797 from alexander-demicev/cherrypick-v025
Cherry pick commits to release/v0.25
2 parents cb6476e + 83e9e30 commit 9d1355f

File tree

147 files changed

+151
-11891
lines changed

Some content is hidden

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

147 files changed

+151
-11891
lines changed

.envrc.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export VSPHERE_PASSWORD=""
1010
export VSPHERE_USERNAME=""
1111
export VSPHERE_SSH_AUTHORIZED_KEY=""
1212
export CONTROL_PLANE_ENDPOINT_IP=""
13-
export CPI_IMAGE_K8S_VERSION=""
1413
export EXP_CLUSTER_RESOURCE_SET="true/false"
1514
export GOVC_URL=""
1615
export GOVC_USERNAME=""

.github/dependabot.yaml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -60,64 +60,6 @@ updates:
6060
- dependency-name: "go.etcd.io/*"
6161
- dependency-name: "google.golang.org/grpc"
6262

63-
# ETCD backup/restore module
64-
- package-ecosystem: "gomod"
65-
directory: "exp/day2/"
66-
schedule:
67-
interval: "weekly"
68-
labels:
69-
- "kind/cleanup"
70-
- "area/dependency"
71-
groups:
72-
testing-dependencies:
73-
patterns:
74-
- "github.com/onsi/ginkgo/v2"
75-
- "github.com/onsi/gomega"
76-
provider-dependencies:
77-
patterns:
78-
- "*cluster-api-provider*"
79-
other-dependencies:
80-
patterns:
81-
- "*"
82-
ignore:
83-
# Ignore Cluster-API as its upgraded manually.
84-
- dependency-name: "sigs.k8s.io/cluster-api"
85-
# Ignore controller-runtime as its upgraded manually.
86-
- dependency-name: "sigs.k8s.io/controller-runtime"
87-
# Ignore k8s and its transitives modules as they are upgraded manually
88-
# together with controller-runtime.
89-
- dependency-name: "k8s.io/*"
90-
- dependency-name: "go.etcd.io/*"
91-
- dependency-name: "google.golang.org/grpc"
92-
93-
# Clusterclass progressive rebase implementation
94-
- package-ecosystem: "gomod"
95-
directory: "/exp/clusterclass"
96-
schedule:
97-
interval: "weekly"
98-
labels:
99-
- "kind/cleanup"
100-
- "area/dependency"
101-
groups:
102-
testing-dependencies:
103-
patterns:
104-
- "github.com/onsi/ginkgo/v2"
105-
- "github.com/onsi/gomega"
106-
provider-dependencies:
107-
patterns:
108-
- "*cluster-api-provider*"
109-
other-dependencies:
110-
patterns:
111-
- "*"
112-
ignore:
113-
# Ignore controller-runtime as its upgraded manually.
114-
- dependency-name: "sigs.k8s.io/controller-runtime"
115-
# Ignore k8s and its transitives modules as they are upgraded manually
116-
# together with controller-runtime.
117-
- dependency-name: "k8s.io/*"
118-
- dependency-name: "go.etcd.io/*"
119-
- dependency-name: "google.golang.org/grpc"
120-
12163
# Examples package
12264
- package-ecosystem: "gomod"
12365
directory: "/examples"

.github/workflows/test_chart.yaml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,16 @@ jobs:
5656
- name: Run chart-testing (lint)
5757
run: ct lint --validate-maintainers=false --charts out/charts/rancher-turtles/
5858

59+
- name: Install kind
60+
run: |
61+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-$(uname)-amd64
62+
chmod +x ./kind
63+
sudo mv ./kind /usr/local/bin/kind
64+
5965
- name: Create kind cluster
60-
uses: helm/[email protected]
61-
with:
62-
cluster_name: kind
63-
node_image: kindest/node:v1.31.4
66+
run: |
67+
kind create cluster --name kind \
68+
--image kindest/node@sha256:abd489f042d2b644e2d033f5c2d900bc707798d075e8186cb65e3f1367a9d5a1
6469
6570
- name: Display kind version
6671
run: kind version
@@ -96,25 +101,9 @@ jobs:
96101
exit 1
97102
fi
98103
99-
- name: Wait for RKE2 bootstrap provider rollout
100-
run: sleep 30 && kubectl rollout status deployment rke2-bootstrap-controller-manager -n rke2-bootstrap-system --timeout=10m
101-
102-
- name: Wait for RKE2 control plane provider rollout
103-
run: sleep 30 && kubectl rollout status deployment rke2-control-plane-controller-manager -n rke2-control-plane-system --timeout=10m
104-
105-
- name: Wait for CAAPF provider rollout
106-
run: sleep 30 && kubectl rollout status deployment caapf-controller-manager -n rancher-turtles-system --timeout=10m
107-
108104
- name: Run chart-testing (un-install)
109105
run: helm uninstall rancher-turtles -n rancher-turtles-system --cascade foreground --wait --debug --timeout=10m
110106

111-
- name: Verify CAPIProvider CRs persist after uninstall
112-
run: |
113-
set -euo pipefail
114-
kubectl get capiprovider rke2-bootstrap -n rke2-bootstrap-system
115-
kubectl get capiprovider rke2-control-plane -n rke2-control-plane-system
116-
kubectl get capiprovider fleet -n rancher-turtles-system
117-
118107
- name: Run chart re-install
119108
run: helm install rancher-turtles out/charts/rancher-turtles/ -n rancher-turtles-system --create-namespace --wait --debug
120109

@@ -142,11 +131,16 @@ jobs:
142131
- name: Package operator chart
143132
run: make release-chart
144133

134+
- name: Install kind
135+
run: |
136+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-$(uname)-amd64
137+
chmod +x ./kind
138+
sudo mv ./kind /usr/local/bin/kind
139+
145140
- name: Create kind cluster
146-
uses: helm/[email protected]
147-
with:
148-
cluster_name: kind
149-
node_image: kindest/node:v1.31.4
141+
run: |
142+
kind create cluster --name kind \
143+
--image kindest/node@sha256:abd489f042d2b644e2d033f5c2d900bc707798d075e8186cb65e3f1367a9d5a1
150144
151145
- name: Display kind version
152146
run: kind version

.golangci.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,12 @@ linters:
119119
- linters:
120120
- dupl
121121
path: internal/controllers/import_controller(_v3)?\.go
122-
- linters:
123-
- dupl
124-
path: exp/day2/controllers/.*.go
125122
- linters:
126123
- revive
127124
text: var-naming
128125
- linters:
129126
- staticcheck
130127
text: ST1003
131-
- linters:
132-
- revive
133-
path: exp/day2/controllers/.*.go
134-
text: 'exported: exported method .*\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported'
135-
- linters:
136-
- unused
137-
path: exp/day2/controllers/.*.go
138128
- linters:
139129
- revive
140130
text: 'package-comments: should have a package comment'

Dockerfile

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -39,59 +39,12 @@ RUN --mount=type=cache,target=/go/pkg/mod \
3939
go build -trimpath -tags "${go_build_tags}" -ldflags "${ldflags} -extldflags '-static'" \
4040
-o manager ${package}
4141

42-
43-
FROM --platform=$BUILDPLATFORM ${builder_image} as day2-operations-builder
44-
WORKDIR /workspace
45-
46-
# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy
47-
ARG goproxy=https://proxy.golang.org
48-
# Run this with docker build --build-arg package=./exp/day2
49-
ENV GOPROXY=$goproxy
50-
51-
# Copy the sources
52-
COPY ./ ./
53-
54-
# Build
55-
ARG ldflags
56-
ARG go_build_tags=""
57-
ARG TARGETOS TARGETARCH
58-
59-
# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder
60-
RUN --mount=type=cache,target=/root/.cache/go-build \
61-
--mount=type=cache,target=/go/pkg/mod \
62-
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
63-
sh -c "cd exp/day2 && ls && go build -trimpath -tags \"${go_build_tags}\" -ldflags \"${ldflags} -extldflags '-static'\" -o manager ${package}"
64-
65-
FROM --platform=$BUILDPLATFORM ${builder_image} as clusterclass-operations-builder
66-
WORKDIR /workspace
67-
68-
# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy
69-
ARG goproxy=https://proxy.golang.org
70-
# Run this with docker build --build-arg package=./exp/etcdrestore
71-
ENV GOPROXY=$goproxy
72-
73-
# Copy the sources
74-
COPY ./ ./
75-
76-
# Build
77-
ARG ldflags
78-
ARG go_build_tags=""
79-
ARG TARGETOS TARGETARCH
80-
81-
# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder
82-
RUN --mount=type=cache,target=/root/.cache/go-build \
83-
--mount=type=cache,target=/go/pkg/mod \
84-
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
85-
sh -c "cd exp/clusterclass && ls && go build -trimpath -tags \"${go_build_tags}\" -ldflags \"${ldflags} -extldflags '-static'\" -o manager ${package}"
86-
8742
# Use distroless as minimal base image to package the manager binary
8843
# Refer to https://github.com/GoogleContainerTools/distroless for more details
8944
FROM gcr.io/distroless/static:nonroot
9045
LABEL org.opencontainers.image.source=https://github.com/rancher/turtles
9146
WORKDIR /
9247
COPY --from=builder /workspace/manager .
93-
COPY --from=day2-operations-builder /workspace/exp/day2/manager turtles-day2-operations
94-
COPY --from=clusterclass-operations-builder /workspace/exp/clusterclass/manager turtles-clusterclass-operations
9548
# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies
9649
USER 65532
9750
ENTRYPOINT ["/manager"]

Makefile

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ BIN_DIR := bin
5959
TEST_DIR := test
6060
TOOLS_DIR := hack/tools
6161
TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/$(BIN_DIR))
62-
EXP_DAY2_DIR := exp/day2
63-
EXP_CLUSTERCLASS_DIR := exp/clusterclass
6462

6563
$(TOOLS_BIN_DIR):
6664
mkdir -p $@
@@ -157,7 +155,7 @@ HELM_VER := v3.18.4
157155
HELM_BIN := helm
158156
HELM := $(TOOLS_BIN_DIR)/$(HELM_BIN)-$(HELM_VER)
159157

160-
CLUSTERCTL_VER := v1.10.5
158+
CLUSTERCTL_VER := v1.10.6
161159
CLUSTERCTL_BIN := clusterctl
162160
CLUSTERCTL := $(TOOLS_BIN_DIR)/$(CLUSTERCTL_BIN)-$(CLUSTERCTL_VER)
163161

@@ -230,8 +228,6 @@ generate: vendor ## Run all generators
230228
$(MAKE) vendor
231229
$(MAKE) generate-modules
232230
$(MAKE) generate-manifests-api
233-
$(MAKE) generate-exp-day2-manifests-api
234-
$(MAKE) generate-exp-clusterclass-manifests-api
235231
$(MAKE) generate-manifests-external
236232
$(MAKE) generate-go-deepcopy
237233
$(MAKE) vendor-clean
@@ -252,37 +248,16 @@ generate-manifests-api: controller-gen ## Generate ClusterRole and CustomResourc
252248
output:crd:artifacts:config=./config/crd/bases \
253249
output:rbac:dir=./config/rbac \
254250

255-
.PHONY: generate-exp-day2-manifests-api
256-
generate-exp-day2-manifests-api: controller-gen ## Generate ClusterRole and CustomResourceDefinition objects for experimental API.
257-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./exp/day2/api/v1alpha1/..." \
258-
paths=./exp/day2/controllers/... \
259-
paths=./exp/day2/webhooks/... \
260-
output:crd:artifacts:config=./exp/day2/config/crd/bases \
261-
output:rbac:dir=./exp/day2/config/rbac \
262-
output:webhook:dir=./exp/day2/config/webhook \
263-
webhook
264-
265-
.PHONY: generate-exp-clusterclass-manifests-api
266-
generate-exp-clusterclass-manifests-api: controller-gen ## Generate ClusterRole and CustomResourceDefinition objects for experimental API.
267-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths="./exp/clusterclass/api/v1alpha1/..." \
268-
paths=./exp/clusterclass/internal/controller/... \
269-
output:crd:artifacts:config=./exp/clusterclass/config/crd/bases \
270-
output:rbac:dir=./exp/clusterclass/config/rbac
271-
272251
.PHONY: generate-modules
273252
generate-modules: ## Run go mod tidy to ensure modules are up to date
274253
go mod tidy
275254
cd $(TEST_DIR); go mod tidy
276-
cd $(EXP_DAY2_DIR); go mod tidy
277-
cd $(EXP_CLUSTERCLASS_DIR); go mod tidy
278255

279256
.PHONY: generate-go-deepcopy
280257
generate-go-deepcopy: ## Run deepcopy generation
281258
$(CONTROLLER_GEN) \
282259
object:headerFile=./hack/boilerplate.go.txt \
283-
paths=./api/... \
284-
paths=./exp/day2/api/...
285-
paths=./exp/clusterclass/api/...
260+
paths=./api/...
286261

287262
# Run go mod
288263
.PHONY: vendor
@@ -334,18 +309,10 @@ updatecli-apply: $(UPDATECLI)
334309
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION))
335310

336311
.PHONY: test
337-
test: $(SETUP_ENVTEST) manifests test-exp-day2 test-exp-clusterclass ## Run all generators and exp tests.
312+
test: $(SETUP_ENVTEST) manifests ## Run all generators and tests.
338313
go clean -testcache
339314
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -tags $(TARGET_BUILD) ./... $(TEST_ARGS)
340315

341-
.PHONY: test-exp-day2
342-
test-exp-day2: $(SETUP_ENVTEST) ## Run tests for experimental day2 API.
343-
cd $(EXP_DAY2_DIR); KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -tags $(TARGET_BUILD) ./... $(TEST_ARGS)
344-
345-
.PHONY: test-exp-clusterclass
346-
test-exp-clusterclass: $(SETUP_ENVTEST) ## Run tests for experimental clusterclass API.
347-
cd $(EXP_CLUSTERCLASS_DIR); KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -tags $(TARGET_BUILD) ./... $(TEST_ARGS)
348-
349316
##@ Build
350317

351318
.PHONY: build
@@ -591,26 +558,13 @@ release: clean-release $(RELEASE_DIR) ## Builds and push container images using
591558
build-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_RELEASE_DIR) $(CHART_PACKAGE_DIR) ## Builds the chart to publish with a release
592559
$(KUSTOMIZE) build ./config/chart > $(CHART_DIR)/templates/rancher-turtles-components.yaml
593560
$(KUSTOMIZE) build ./config/operatorchart > $(CHART_DIR)/templates/operator-crds.yaml
594-
$(KUSTOMIZE) build ./exp/day2/config/chart > $(CHART_DIR)/templates/rancher-turtles-exp-day2-components.yaml
595-
$(KUSTOMIZE) build ./exp/clusterclass/config/default > $(CHART_DIR)/templates/rancher-turtles-exp-clusterclass-components.yaml
596-
./scripts/process-manifests.sh day2operations $(CHART_DIR)/templates/rancher-turtles-exp-day2-components.yaml
597-
./scripts/process-manifests.sh clusterclass-operations $(CHART_DIR)/templates/rancher-turtles-exp-clusterclass-components.yaml
561+
598562
cp -rf $(CHART_DIR)/* $(CHART_RELEASE_DIR)
599563

600564
sed -i -e 's/tag:.*/tag: '${RELEASE_TAG}'/' $(CHART_RELEASE_DIR)/values.yaml
601565
sed -i -e 's/imagePullPolicy:.*/imagePullPolicy: '$(PULL_POLICY)'/' $(CHART_RELEASE_DIR)/values.yaml
602566
sed -i -e 's|repository:.*|repository: '${CONTROLLER_IMG}'|' $(CHART_RELEASE_DIR)/values.yaml
603567

604-
# day2operations
605-
sed -i -e '/day2operations:/,/^[^[:space:]]/ s@^\([[:space:]]*image:\).*@\1 '"${CONTROLLER_IMG}"'@' $(CHART_RELEASE_DIR)/values.yaml
606-
sed -i -e '/day2operations:/,/^[^[:space:]]/ s@^\([[:space:]]*imageVersion:\).*@\1 '"${RELEASE_TAG}"'@' $(CHART_RELEASE_DIR)/values.yaml
607-
sed -i -e '/day2operations:/,/^[^[:space:]]/ s@^\([[:space:]]*imagePullPolicy:\).*@\1 '"${PULL_POLICY}"'@' $(CHART_RELEASE_DIR)/values.yaml
608-
609-
# clusterclass-operations
610-
sed -i -e '/clusterclass-operations:/,/^[^[:space:]]/ s@^\([[:space:]]*image:\).*@\1 '"${CONTROLLER_IMG}"'@' $(CHART_RELEASE_DIR)/values.yaml
611-
sed -i -e '/clusterclass-operations:/,/^[^[:space:]]/ s@^\([[:space:]]*imageVersion:\).*@\1 '"${RELEASE_TAG}"'@' $(CHART_RELEASE_DIR)/values.yaml
612-
sed -i -e '/clusterclass-operations:/,/^[^[:space:]]/ s@^\([[:space:]]*imagePullPolicy:\).*@\1 '"${PULL_POLICY}"'@' $(CHART_RELEASE_DIR)/values.yaml
613-
614568
cd $(CHART_RELEASE_DIR) && $(HELM) dependency update
615569
$(HELM) package $(CHART_RELEASE_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR)
616570

PROJECT

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,4 @@ resources:
1717
kind: CAPIProvider
1818
path: github.com/rancher/turtles/api/v1alpha1
1919
version: v1alpha1
20-
- api:
21-
crdVersion: v1
22-
namespaced: true
23-
controller: true
24-
domain: cattle.io
25-
group: turtles-capi
26-
kind: ETCDMachineSnapshot
27-
path: github.com/rancher/turtles/exp/day2/api/v1alpha1
28-
version: v1alpha1
29-
- api:
30-
crdVersion: v1
31-
namespaced: true
32-
controller: true
33-
domain: cattle.io
34-
group: turtles-capi
35-
kind: ETCDSnapshotRestore
36-
path: github.com/rancher/turtles/exp/day2/api/v1alpha1
37-
version: v1alpha1
38-
- api:
39-
crdVersion: v1
40-
namespaced: true
41-
controller: true
42-
domain: cattle.io
43-
group: turtles-capi
44-
kind: RKE2EtcdMachineSnapshotConfig
45-
path: github.com/rancher/turtles/exp/day2/api/v1alpha1
46-
version: v1alpha1
4720
version: "3"

0 commit comments

Comments
 (0)