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

Commit 73f4046

Browse files
authored
Merge pull request #539 from cprivitere/capi-1.3
✨ Update Cluster API Provider Packet to be based on cluster API 1.3
2 parents 74304df + 7d2dab3 commit 73f4046

22 files changed

+438
-1278
lines changed

.github/actions/setup-go/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
version:
55
description: 'Go Version to setup'
66
required: true
7-
default: "1.17"
7+
default: "1.19"
88
runs:
99
using: "composite"
1010
steps:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# Build the manager binary
18-
ARG GOVER=1.17.7
18+
ARG GOVER=1.19.7
1919
FROM golang:${GOVER} as builder
2020

2121
WORKDIR /workspace

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ endif
6060
## Binaries.
6161

6262
# Sync to controller-tools version in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/hack/tools/go.mod
63-
CONTROLLER_GEN_VER := v0.8.0
63+
CONTROLLER_GEN_VER := v0.10.0
6464
CONTROLLER_GEN_BIN := controller-gen
6565
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
6666

6767
# Sync to k8s.io/* verisons in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/go.mod
68-
CONVERSION_GEN_VER := v0.23.5
68+
CONVERSION_GEN_VER := v0.25.0
6969
CONVERSION_GEN_BIN := conversion-gen
7070
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)
7171

@@ -75,7 +75,7 @@ ENVSUBST_BIN := envsubst
7575
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)
7676

7777
# Bump as necessary/desired to latest that supports our version of go at https://github.com/golangci/golangci-lint/releases
78-
GOLANGCI_LINT_VER := v1.47.3
78+
GOLANGCI_LINT_VER := v1.52.1
7979
GOLANGCI_LINT_BIN := golangci-lint
8080
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
8181

@@ -86,7 +86,7 @@ KUSTOMIZE_BIN := kustomize
8686
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)
8787

8888
# Sync to github.com/onsi/ginkgo verison in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/go.mod
89-
GINKGO_VER := v1.16.5
89+
GINKGO_VER := v2.6.0
9090
GINKGO_BIN := ginkgo
9191
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER)
9292

@@ -119,7 +119,7 @@ endif
119119
# Build time versioning details.
120120
LDFLAGS := $(shell hack/version.sh)
121121

122-
GOLANG_VERSION := 1.17.7
122+
GOLANG_VERSION := 1.19.6
123123

124124
## --------------------------------------
125125
## Help
@@ -159,15 +159,16 @@ $(E2E_CONF_FILE): $(ENVSUBST) $(E2E_CONF_FILE_SOURCE)
159159
run-e2e-tests: $(KUSTOMIZE) $(GINKGO) $(E2E_CONF_FILE) e2e-test-templates $(if $(SKIP_IMAGE_BUILD),,e2e-image) ## Run the e2e tests
160160
$(MAKE) set-manifest-image MANIFEST_IMG=$(REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(TAG)
161161
$(MAKE) set-manifest-pull-policy PULL_POLICY=IfNotPresent
162-
cd test/e2e; time $(GINKGO) -v -trace -progress -v -tags=e2e \
162+
cd test/e2e; time $(GINKGO) -v --trace --progress --tags=e2e \
163163
--randomizeAllSpecs -race $(GINKGO_ADDITIONAL_ARGS) \
164-
-focus=$(GINKGO_FOCUS) -skip=$(GINKGO_SKIP) \
164+
--focus=$(GINKGO_FOCUS) --skip=$(GINKGO_SKIP) \
165165
-nodes=$(GINKGO_NODES) --noColor=$(GINKGO_NOCOLOR) \
166+
--output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" \
166167
--flakeAttempts=$(GINKGO_FLAKE_ATTEMPTS) ./ -- \
167168
-e2e.artifacts-folder="$(ARTIFACTS)" \
168169
-e2e.config="$(E2E_CONF_FILE)" \
169170
-e2e.skip-resource-cleanup=$(SKIP_CLEANUP) \
170-
-e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER)
171+
-e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER)
171172

172173
.PHONY: test-e2e-conformance
173174
test-e2e-conformance:
@@ -241,7 +242,7 @@ $(CONVERSION_GEN): ## Build conversion-gen.
241242
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) k8s.io/code-generator/cmd/conversion-gen $(CONVERSION_GEN_BIN) $(CONVERSION_GEN_VER)
242243

243244
$(GINKGO): ## Build ginkgo.
244-
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/onsi/ginkgo/ginkgo $(GINKGO_BIN) $(GINKGO_VER)
245+
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/onsi/ginkgo/v2/ginkgo $(GINKGO_BIN) $(GINKGO_VER)
245246

246247
## --------------------------------------
247248
## Linting

api/v1alpha3/zz_generated.conversion.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/infrastructure.cluster.x-k8s.io_packetclusters.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.8.0
6+
controller-gen.kubebuilder.io/version: v0.10.0
77
creationTimestamp: null
88
name: packetclusters.infrastructure.cluster.x-k8s.io
99
spec:
@@ -212,9 +212,3 @@ spec:
212212
storage: true
213213
subresources:
214214
status: {}
215-
status:
216-
acceptedNames:
217-
kind: ""
218-
plural: ""
219-
conditions: []
220-
storedVersions: []

config/crd/bases/infrastructure.cluster.x-k8s.io_packetmachines.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.8.0
6+
controller-gen.kubebuilder.io/version: v0.10.0
77
creationTimestamp: null
88
name: packetmachines.infrastructure.cluster.x-k8s.io
99
spec:
@@ -328,9 +328,3 @@ spec:
328328
storage: true
329329
subresources:
330330
status: {}
331-
status:
332-
acceptedNames:
333-
kind: ""
334-
plural: ""
335-
conditions: []
336-
storedVersions: []

config/crd/bases/infrastructure.cluster.x-k8s.io_packetmachinetemplates.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.8.0
6+
controller-gen.kubebuilder.io/version: v0.10.0
77
creationTimestamp: null
88
name: packetmachinetemplates.infrastructure.cluster.x-k8s.io
99
spec:
@@ -173,9 +173,3 @@ spec:
173173
type: object
174174
served: true
175175
storage: true
176-
status:
177-
acceptedNames:
178-
kind: ""
179-
plural: ""
180-
conditions: []
181-
storedVersions: []

controllers/packetcluster_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (r *PacketClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl
168168
WithEventFilter(predicates.ResourceIsNotExternallyManaged(log)).
169169
Watches(
170170
&source.Kind{Type: &clusterv1.Cluster{}},
171-
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("PacketCluster"))),
171+
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("PacketCluster"), mgr.GetClient(), &infrav1.PacketCluster{})),
172172
builder.WithPredicates(predicates.ClusterUpdateUnpaused(log)),
173173
).
174174
Complete(r)

go.mod

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,77 @@
11
module sigs.k8s.io/cluster-api-provider-packet
22

3-
go 1.17
3+
go 1.19
44

55
require (
6-
github.com/onsi/gomega v1.20.2
7-
github.com/packethost/packngo v0.26.0
6+
github.com/onsi/gomega v1.24.1
7+
github.com/packethost/packngo v0.29.0
88
github.com/pkg/errors v0.9.1
9-
github.com/spf13/cobra v1.5.0
9+
github.com/spf13/cobra v1.6.1
1010
github.com/spf13/pflag v1.0.5
11-
k8s.io/api v0.24.4
12-
k8s.io/apimachinery v0.24.4
13-
k8s.io/client-go v0.24.4
14-
k8s.io/component-base v0.24.4
15-
k8s.io/klog/v2 v2.60.1
16-
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
17-
sigs.k8s.io/cluster-api v1.1.5
18-
sigs.k8s.io/controller-runtime v0.11.2
11+
k8s.io/api v0.25.8
12+
k8s.io/apimachinery v0.25.8
13+
k8s.io/client-go v0.25.8
14+
k8s.io/component-base v0.25.8
15+
k8s.io/klog/v2 v2.80.1
16+
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
17+
sigs.k8s.io/cluster-api v1.3.5
18+
sigs.k8s.io/controller-runtime v0.13.1
1919
)
2020

2121
require (
22-
github.com/PuerkitoBio/purell v1.1.1 // indirect
23-
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2422
github.com/beorn7/perks v1.0.1 // indirect
2523
github.com/blang/semver v3.5.1+incompatible // indirect
2624
github.com/cespare/xxhash/v2 v2.1.2 // indirect
2725
github.com/coredns/caddy v1.1.0 // indirect
28-
github.com/coredns/corefile-migration v1.0.17 // indirect
26+
github.com/coredns/corefile-migration v1.0.20 // indirect
2927
github.com/davecgh/go-spew v1.1.1 // indirect
3028
github.com/docker/distribution v2.8.1+incompatible // indirect
31-
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
32-
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
29+
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
30+
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
3331
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
34-
github.com/fsnotify/fsnotify v1.5.1 // indirect
35-
github.com/go-logr/logr v1.2.0 // indirect
32+
github.com/fsnotify/fsnotify v1.6.0 // indirect
33+
github.com/go-logr/logr v1.2.3 // indirect
3634
github.com/go-openapi/jsonpointer v0.19.5 // indirect
37-
github.com/go-openapi/jsonreference v0.19.5 // indirect
38-
github.com/go-openapi/swag v0.19.14 // indirect
39-
github.com/gobuffalo/flect v0.2.4 // indirect
35+
github.com/go-openapi/jsonreference v0.20.0 // indirect
36+
github.com/go-openapi/swag v0.22.3 // indirect
37+
github.com/gobuffalo/flect v0.3.0 // indirect
4038
github.com/gogo/protobuf v1.3.2 // indirect
4139
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
42-
github.com/golang/protobuf v1.5.2 // indirect
43-
github.com/google/gnostic v0.5.7-v3refs // indirect
44-
github.com/google/go-cmp v0.5.8 // indirect
40+
github.com/golang/protobuf v1.5.3 // indirect
41+
github.com/google/gnostic v0.6.9 // indirect
42+
github.com/google/go-cmp v0.5.9 // indirect
4543
github.com/google/gofuzz v1.2.0 // indirect
46-
github.com/google/uuid v1.1.2 // indirect
47-
github.com/imdario/mergo v0.3.12 // indirect
48-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
44+
github.com/google/uuid v1.3.0 // indirect
45+
github.com/imdario/mergo v0.3.13 // indirect
46+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
4947
github.com/josharian/intern v1.0.0 // indirect
5048
github.com/json-iterator/go v1.1.12 // indirect
51-
github.com/mailru/easyjson v0.7.6 // indirect
49+
github.com/mailru/easyjson v0.7.7 // indirect
5250
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
5351
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5452
github.com/modern-go/reflect2 v1.0.2 // indirect
5553
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5654
github.com/opencontainers/go-digest v1.0.0 // indirect
57-
github.com/prometheus/client_golang v1.12.1 // indirect
55+
github.com/prometheus/client_golang v1.13.0 // indirect
5856
github.com/prometheus/client_model v0.2.0 // indirect
59-
github.com/prometheus/common v0.32.1 // indirect
60-
github.com/prometheus/procfs v0.7.3 // indirect
61-
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
62-
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
63-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
64-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
65-
golang.org/x/text v0.3.7 // indirect
66-
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
57+
github.com/prometheus/common v0.37.0 // indirect
58+
github.com/prometheus/procfs v0.8.0 // indirect
59+
golang.org/x/net v0.8.0 // indirect
60+
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
61+
golang.org/x/sys v0.6.0 // indirect
62+
golang.org/x/term v0.6.0 // indirect
63+
golang.org/x/text v0.8.0 // indirect
64+
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
6765
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
6866
google.golang.org/appengine v1.6.7 // indirect
69-
google.golang.org/protobuf v1.28.0 // indirect
67+
google.golang.org/protobuf v1.28.1 // indirect
7068
gopkg.in/inf.v0 v0.9.1 // indirect
7169
gopkg.in/yaml.v2 v2.4.0 // indirect
7270
gopkg.in/yaml.v3 v3.0.1 // indirect
73-
k8s.io/apiextensions-apiserver v0.23.5 // indirect
74-
k8s.io/cluster-bootstrap v0.23.0 // indirect
75-
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
76-
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
77-
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
71+
k8s.io/apiextensions-apiserver v0.25.0 // indirect
72+
k8s.io/cluster-bootstrap v0.25.0 // indirect
73+
k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea // indirect
74+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
75+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
7876
sigs.k8s.io/yaml v1.3.0 // indirect
7977
)

0 commit comments

Comments
 (0)