Skip to content

Commit a2c062d

Browse files
committed
Migrate CRD generation to controller-gen
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent 5b4dc4b commit a2c062d

File tree

21 files changed

+1529
-422
lines changed

21 files changed

+1529
-422
lines changed

Dockerfile.dapper

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ RUN if [ "${ARCH:-$(go env GOARCH)}" = "amd64" ]; then \
1919
RUN mkdir -p /usr/local/lib/docker/cli-plugins; \
2020
curl -o /usr/local/lib/docker/cli-plugins/docker-buildx -fsSL "https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64"; \
2121
chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx
22+
RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.3
2223
ENV DAPPER_ENV REPO TAG DRONE_TAG
2324
ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/
2425
ENV DAPPER_OUTPUT ./bin ./dist

e2e/suite/job_generate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ var _ = Describe("Job Generation", func() {
174174
plan.Spec.Concurrency = 1
175175
plan.Spec.ServiceAccountName = e2e.Namespace.Name
176176
plan.Spec.Window = &upgradeapiv1.TimeWindowSpec{
177-
Days: []string{"never"},
177+
Days: []upgradeapiv1.Day{"never"},
178178
StartTime: "00:00:00",
179179
EndTime: "23:59:59",
180180
TimeZone: "UTC",
@@ -193,7 +193,7 @@ var _ = Describe("Job Generation", func() {
193193
Expect(upgradeapiv1.PlanSpecValidated.IsTrue(plan)).To(BeFalse())
194194
Expect(upgradeapiv1.PlanSpecValidated.GetMessage(plan)).To(ContainSubstring("spec.window is invalid"))
195195

196-
plan.Spec.Window.Days = []string{"su", "mo", "tu", "we", "th", "fr", "sa"}
196+
plan.Spec.Window.Days = []upgradeapiv1.Day{"su", "mo", "tu", "we", "th", "fr", "sa"}
197197
plan, err = e2e.UpdatePlan(plan)
198198
Expect(err).ToNot(HaveOccurred())
199199

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ require (
4444
github.com/kubereboot/kured v1.13.1
4545
github.com/onsi/ginkgo/v2 v2.21.0
4646
github.com/onsi/gomega v1.35.1
47-
github.com/rancher/lasso v0.0.0-20240924233157-8f384efc8813
47+
github.com/rancher/lasso v0.2.2
4848
github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0
49-
github.com/rancher/wrangler/v3 v3.1.0
49+
github.com/rancher/wrangler/v3 v3.2.1
5050
github.com/sirupsen/logrus v1.9.3
5151
github.com/urfave/cli v1.22.15
5252
k8s.io/api v0.32.2
53+
k8s.io/apiextensions-apiserver v0.32.1
5354
k8s.io/apimachinery v0.32.2
5455
k8s.io/client-go v0.32.2
5556
k8s.io/kubectl v0.32.2
@@ -80,17 +81,17 @@ require (
8081
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
8182
github.com/distribution/reference v0.6.0 // indirect
8283
github.com/docker/go-units v0.5.0 // indirect
83-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
84+
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
8485
github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect
85-
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
86+
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
8687
github.com/felixge/httpsnoop v1.0.4 // indirect
8788
github.com/fsnotify/fsnotify v1.7.0 // indirect
8889
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
8990
github.com/ghodss/yaml v1.0.0 // indirect
9091
github.com/go-logr/logr v1.4.2 // indirect
9192
github.com/go-logr/stdr v1.2.2 // indirect
9293
github.com/go-openapi/jsonpointer v0.21.0 // indirect
93-
github.com/go-openapi/jsonreference v0.20.2 // indirect
94+
github.com/go-openapi/jsonreference v0.21.0 // indirect
9495
github.com/go-openapi/swag v0.23.0 // indirect
9596
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
9697
github.com/godbus/dbus/v5 v5.1.0 // indirect
@@ -99,7 +100,7 @@ require (
99100
github.com/google/btree v1.0.1 // indirect
100101
github.com/google/cadvisor v0.51.0 // indirect
101102
github.com/google/cel-go v0.22.0 // indirect
102-
github.com/google/gnostic-models v0.6.8 // indirect
103+
github.com/google/gnostic-models v0.6.9 // indirect
103104
github.com/google/go-cmp v0.6.0 // indirect
104105
github.com/google/gofuzz v1.2.0 // indirect
105106
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
@@ -152,25 +153,24 @@ require (
152153
go.uber.org/zap v1.27.0 // indirect
153154
golang.org/x/crypto v0.35.0 // indirect
154155
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
155-
golang.org/x/mod v0.21.0 // indirect
156-
golang.org/x/net v0.30.0 // indirect
156+
golang.org/x/mod v0.23.0 // indirect
157+
golang.org/x/net v0.35.0 // indirect
157158
golang.org/x/oauth2 v0.23.0 // indirect
158159
golang.org/x/sync v0.11.0 // indirect
159160
golang.org/x/sys v0.30.0 // indirect
160161
golang.org/x/term v0.29.0 // indirect
161162
golang.org/x/text v0.22.0 // indirect
162163
golang.org/x/time v0.7.0 // indirect
163-
golang.org/x/tools v0.26.0 // indirect
164+
golang.org/x/tools v0.30.0 // indirect
164165
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 // indirect
165166
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect
166167
google.golang.org/grpc v1.65.0 // indirect
167-
google.golang.org/protobuf v1.35.1 // indirect
168+
google.golang.org/protobuf v1.35.2 // indirect
168169
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
169170
gopkg.in/inf.v0 v0.9.1 // indirect
170171
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
171172
gopkg.in/yaml.v2 v2.4.0 // indirect
172173
gopkg.in/yaml.v3 v3.0.1 // indirect
173-
k8s.io/apiextensions-apiserver v0.31.1 // indirect
174174
k8s.io/apiserver v0.32.2 // indirect
175175
k8s.io/cloud-provider v0.30.3 // indirect
176176
k8s.io/code-generator v0.32.2 // indirect
@@ -181,7 +181,7 @@ require (
181181
k8s.io/cri-client v0.0.0 // indirect
182182
k8s.io/csi-translation-lib v0.0.0 // indirect
183183
k8s.io/dynamic-resource-allocation v0.0.0 // indirect
184-
k8s.io/gengo v0.0.0-20240826214909-a7b603a56eb7 // indirect
184+
k8s.io/gengo v0.0.0-20250130153323-76c5745d3511 // indirect
185185
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
186186
k8s.io/klog/v2 v2.130.1 // indirect
187187
k8s.io/kms v0.32.2 // indirect
@@ -191,6 +191,6 @@ require (
191191
k8s.io/mount-utils v0.0.0 // indirect
192192
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect
193193
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
194-
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
194+
sigs.k8s.io/structured-merge-diff/v4 v4.4.3 // indirect
195195
sigs.k8s.io/yaml v1.4.0 // indirect
196196
)

0 commit comments

Comments
 (0)