Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit d7148f7

Browse files
committed
breaking: capi v1.6.0 update
breaking: remove linux/armv7 builds cause they're slow feat: profiling - add flags for profiling - process profiling and tls options - NOTE: actual profiling may still need more work, this is mostly focused on handling flags - add flags support for secure metrics server - switch default metrics server to secured refactor: main.go - use infrav1 instead of infrav1beta1 in main.go - functionize inits of webhooks, reconcilers and health checks in - don't set ctrl options in line for better readability - use caching for namespace watches - process restconfig options - e2e test signature update for 1.6 compatibility refactor: machine controller and scope - remove instance id - get rid of getproviderid() - add providerid() - add deviceid which is providerid without prefix - use deviceid for all api calls - device/provider id usage now is more similar to upstream and other providers fix: add RBAC rules for kubebuilder fix: fix controller gen calls in makefile - don't need two calls - include main.go - add cleanup like upstream has fix: use real context in metal-go calls doc: Add v0.8.x upgrade notes chore: run make generate chore: use new capi preferred api registration scheme chore: use packet device id string as provider id (upstream removed noderefutil wrapped provider ids) chore: metadata updates for 1.6 e2e tests chore: bump calico to 3.27 chore: Bump kube-vip version to 0.6.4 chore: Bump CPEM to 3.7.0 chore: update readme explain tag changes Signed-off-by: Chris Privitere <[email protected]>
1 parent 9cb902b commit d7148f7

34 files changed

+1445
-1182
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
labels: ${{ steps.docker_meta.outputs.labels }}
112112
cache-from: type=gha
113113
cache-to: type=gha,mode=max
114-
platforms: linux/amd64, linux/arm64, linux/arm/v7
114+
platforms: linux/amd64, linux/arm64
115115

116116
# If PR, put image tags in the PR comments
117117
# from https://github.com/marketplace/actions/create-or-update-comment

.github/workflows/release.yaml

Lines changed: 95 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Upload Release Asset
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77
env:
88
IMAGE_NAME: cluster-api-provider-packet
99
GHCR_REGISTRY: ghcr.io/${{ github.repository_owner }}
@@ -12,7 +12,6 @@ env:
1212
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1313

1414
jobs:
15-
1615
build-image:
1716
name: Build and Push Image
1817
runs-on: ubuntu-latest
@@ -21,78 +20,77 @@ jobs:
2120
packages: write # needed to push docker image to ghcr.io
2221

2322
steps:
24-
25-
- name: Checkout git repo
26-
uses: actions/checkout@v4
27-
28-
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v3
30-
31-
- name: Set up Docker Buildx
32-
uses: docker/setup-buildx-action@v3
33-
34-
- name: Login to ghcr.io registry
35-
uses: docker/login-action@v3
36-
with:
37-
registry: ghcr.io
38-
username: ${{ github.actor }}
39-
password: ${{ secrets.GITHUB_TOKEN }}
40-
41-
- name: Log into DockerHub
42-
uses: docker/login-action@v3
43-
env:
44-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
45-
if: ${{ env.DOCKER_USERNAME != '' }}
46-
with:
47-
username: ${{ secrets.DOCKER_USERNAME }}
48-
password: ${{ secrets.DOCKER_PASSWORD }}
49-
50-
- name: Log into quay.io
51-
uses: docker/login-action@v3
52-
env:
53-
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
54-
if: ${{ env.QUAY_USERNAME != '' }}
55-
with:
56-
registry: quay.io
57-
username: ${{ secrets.QUAY_USERNAME }}
58-
password: ${{ secrets.QUAY_PASSWORD }}
59-
60-
- name: Docker meta
61-
id: docker_meta
62-
uses: docker/metadata-action@v5
63-
with:
64-
images: |
65-
${{ env.QUAY_REGISTRY }}/${{ env.IMAGE_NAME }}
66-
${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
67-
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
68-
flavor: |
69-
latest=auto
70-
tags: |
23+
- name: Checkout git repo
24+
uses: actions/checkout@v4
25+
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Login to ghcr.io registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Log into DockerHub
40+
uses: docker/login-action@v3
41+
env:
42+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
43+
if: ${{ env.DOCKER_USERNAME != '' }}
44+
with:
45+
username: ${{ secrets.DOCKER_USERNAME }}
46+
password: ${{ secrets.DOCKER_PASSWORD }}
47+
48+
- name: Log into quay.io
49+
uses: docker/login-action@v3
50+
env:
51+
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
52+
if: ${{ env.QUAY_USERNAME != '' }}
53+
with:
54+
registry: quay.io
55+
username: ${{ secrets.QUAY_USERNAME }}
56+
password: ${{ secrets.QUAY_PASSWORD }}
57+
58+
- name: Docker meta
59+
id: docker_meta
60+
uses: docker/metadata-action@v5
61+
with:
62+
images: |
63+
${{ env.QUAY_REGISTRY }}/${{ env.IMAGE_NAME }}
64+
${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
65+
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
66+
flavor: |
67+
latest=auto
68+
tags: |
7169
type=semver,pattern={{version}}
7270
type=ref,event=branch
7371
type=ref,event=tag
7472
type=ref,event=pr
7573
type=sha
7674
77-
- name: Setup Env
78-
run: |
79-
DOCKER_BUILD_LDFLAGS="$(hack/version.sh)"
80-
echo 'DOCKER_BUILD_LDFLAGS<<EOF' >> $GITHUB_ENV
81-
echo $DOCKER_BUILD_LDFLAGS >> $GITHUB_ENV
82-
echo 'EOF' >> $GITHUB_ENV
83-
84-
- name: Docker Build and Push
85-
uses: docker/build-push-action@v5
86-
with:
87-
context: .
88-
push: true
89-
build-args: |
90-
LDFLAGS=${{ env.DOCKER_BUILD_LDFLAGS }}
91-
tags: ${{ steps.docker_meta.outputs.tags }}
92-
labels: ${{ steps.docker_meta.outputs.labels }}
93-
cache-from: type=gha
94-
cache-to: type=gha,mode=max
95-
platforms: linux/amd64, linux/arm64, linux/arm/v7
75+
- name: Setup Env
76+
run: |
77+
DOCKER_BUILD_LDFLAGS="$(hack/version.sh)"
78+
echo 'DOCKER_BUILD_LDFLAGS<<EOF' >> $GITHUB_ENV
79+
echo $DOCKER_BUILD_LDFLAGS >> $GITHUB_ENV
80+
echo 'EOF' >> $GITHUB_ENV
81+
82+
- name: Docker Build and Push
83+
uses: docker/build-push-action@v5
84+
with:
85+
context: .
86+
push: true
87+
build-args: |
88+
LDFLAGS=${{ env.DOCKER_BUILD_LDFLAGS }}
89+
tags: ${{ steps.docker_meta.outputs.tags }}
90+
labels: ${{ steps.docker_meta.outputs.labels }}
91+
cache-from: type=gha
92+
cache-to: type=gha,mode=max
93+
platforms: linux/amd64, linux/arm64
9694

9795
outputs:
9896
image-tag: "${{ steps.docker_meta.outputs.version }}"
@@ -106,33 +104,32 @@ jobs:
106104
REGISTRY: quay.io/${{ secrets.QUAY_ORG }}
107105

108106
steps:
109-
110-
- name: checkout
111-
uses: actions/checkout@v4
112-
113-
- uses: actions/setup-go@v4
114-
with:
115-
go-version-file: './go.mod'
116-
117-
- name: Make Release
118-
run: make release
119-
120-
- name: Generate Release Notes
121-
run: |
122-
release_notes=$(gh api repos/{owner}/{repo}/releases/generate-notes -F tag_name=${{ github.ref }} --jq .body)
123-
echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
124-
echo "${release_notes}" >> $GITHUB_ENV
125-
echo 'EOF' >> $GITHUB_ENV
126-
env:
127-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128-
OWNER: ${{ github.repository_owner }}
129-
REPO: ${{ github.event.repository.name }}
130-
131-
- name: Create Release
132-
uses: softprops/action-gh-release@v1
133-
if: startsWith(github.ref, 'refs/tags/')
134-
with:
135-
files: out/release/*
136-
body: ${{ env.RELEASE_NOTES }}
137-
draft: false
138-
prerelease: false
107+
- name: checkout
108+
uses: actions/checkout@v4
109+
110+
- uses: actions/setup-go@v4
111+
with:
112+
go-version-file: "./go.mod"
113+
114+
- name: Make Release
115+
run: make release
116+
117+
- name: Generate Release Notes
118+
run: |
119+
release_notes=$(gh api repos/{owner}/{repo}/releases/generate-notes -F tag_name=${{ github.ref }} --jq .body)
120+
echo 'RELEASE_NOTES<<EOF' >> $GITHUB_ENV
121+
echo "${release_notes}" >> $GITHUB_ENV
122+
echo 'EOF' >> $GITHUB_ENV
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
OWNER: ${{ github.repository_owner }}
126+
REPO: ${{ github.event.repository.name }}
127+
128+
- name: Create Release
129+
uses: softprops/action-gh-release@v1
130+
if: startsWith(github.ref, 'refs/tags/')
131+
with:
132+
files: out/release/*
133+
body: ${{ env.RELEASE_NOTES }}
134+
draft: false
135+
prerelease: false

Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ endif
6969
## Binaries.
7070

7171
# Sync to controller-tools version in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/hack/tools/go.mod
72-
CONTROLLER_GEN_VER := v0.12.0
72+
CONTROLLER_GEN_VER := v0.13.0
7373
CONTROLLER_GEN_BIN := controller-gen
7474
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
7575

7676
# Sync to k8s.io/* versions in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/go.mod
77-
CONVERSION_GEN_VER := v0.27.8
77+
CONVERSION_GEN_VER := v0.28.4
7878
CONVERSION_GEN_BIN := conversion-gen
7979
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)
8080

@@ -84,7 +84,7 @@ ENVSUBST_BIN := envsubst
8484
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)
8585

8686
# Bump as necessary/desired to latest that supports our version of go at https://github.com/golangci/golangci-lint/releases
87-
GOLANGCI_LINT_VER := v1.53.3
87+
GOLANGCI_LINT_VER := v1.55.2
8888
GOLANGCI_LINT_BIN := golangci-lint
8989
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
9090

@@ -95,7 +95,7 @@ KUSTOMIZE_BIN := kustomize
9595
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)
9696

9797
# Sync to github.com/onsi/ginkgo verison in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/go.mod
98-
GINKGO_VER := v2.11.0
98+
GINKGO_VER := v2.13.1
9999
GINKGO_BIN := ginkgo
100100
GINKGO := $(abspath $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER))
101101
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo
@@ -296,17 +296,17 @@ generate-go: $(CONTROLLER_GEN) $(CONVERSION_GEN) ## Runs Go related generate tar
296296

297297
.PHONY: generate-manifests
298298
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
299+
$(MAKE) clean-generated-yaml SRC_DIRS="$(CRD_ROOT),$(WEBHOOK_ROOT)/manifests.yaml"
299300
$(CONTROLLER_GEN) \
301+
paths=./ \
300302
paths=./api/... \
303+
paths=./controllers/... \
301304
crd:crdVersions=v1 \
302305
rbac:roleName=manager-role \
303306
output:crd:dir=$(CRD_ROOT) \
307+
output:rbac:dir=$(RBAC_ROOT) \
304308
output:webhook:dir=$(WEBHOOK_ROOT) \
305309
webhook
306-
$(CONTROLLER_GEN) \
307-
paths=./controllers/... \
308-
output:rbac:dir=$(RBAC_ROOT) \
309-
rbac:roleName=manager-role
310310

311311
## --------------------------------------
312312
## Docker
@@ -405,6 +405,10 @@ clean-bin: ## Remove all generated binaries
405405
rm -rf bin
406406
rm -rf hack/tools/bin
407407

408+
.PHONY: clean-generated-yaml
409+
clean-generated-yaml: ## Remove files generated by conversion-gen from the mentioned dirs. Example SRC_DIRS="./api/v1alpha4"
410+
(IFS=','; for i in $(SRC_DIRS); do find $$i -type f -name '*.yaml' -exec rm -f {} \;; done)
411+
408412
.PHONY: clean-temporary
409413
clean-temporary: ## Remove all temporary files and folders
410414
rm -f minikube.kubeconfig

0 commit comments

Comments
 (0)