Skip to content

Commit 4b01cba

Browse files
sxdfcanovai
authored andcommitted
ci: add controller-gen task
Add a task to run controller-gen, and put it as a dependency for the uncommitted and manifest task. Signed-off-by: Jonathan Gonzalez V. <[email protected]> Signed-off-by: Francesco Canovai <[email protected]>
1 parent ee1f84b commit 4b01cba

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Taskfile.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ tasks:
4646
4747
uncommitted:
4848
desc: Check for uncommitted changes
49+
deps:
50+
- controller-gen
4951
env:
5052
# renovate: datasource=git-refs depName=uncommitted lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
5153
DAGGER_UNCOMMITTED_SHA: c899668d635076ee593adaabfa7184fc753306ba
@@ -244,8 +246,30 @@ tasks:
244246
build --dir . --file containers/Dockerfile.sidecar --platform linux/amd64 --platform linux/arm64
245247
publish --ref {{.SIDECAR_IMAGE_NAME}} --tags {{.IMAGE_VERSION}}
246248
249+
250+
controller-gen:
251+
desc: Run controller-gen
252+
env:
253+
# renovate: datasource=git-refs depName=controller-gen lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
254+
DAGGER_CONTROLLER_GEN_SHA: 1ad0ee66473e3a405d1078fcc55df00f2507d14a
255+
cmds:
256+
- >
257+
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
258+
controller-gen --source . --args object:headerFile=hack/boilerplate.go.txt --args paths=./api/...
259+
file --path api/v1/zz_generated.deepcopy.go export --path api/v1/zz_generated.deepcopy.go
260+
- >
261+
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
262+
controller-gen --source . --args rbac:roleName=plugin-barman-cloud --args crd --args webhook --args paths=./api/...
263+
--args output:crd:artifacts:config=config/crd/bases directory --path config/crd/bases export --path config/crd/bases
264+
sources:
265+
- ./api/**/*.go
266+
generates:
267+
- ./api/v1/zz_generated.deepcopy.go
268+
247269
manifest:
248270
desc: Update the image in the Kustomization
271+
deps:
272+
- controller-gen
249273
requires:
250274
# We expect this to run in a GitHub workflow, so we put a few GitHub-specific vars here
251275
# to prevent running this task locally by accident.

config/crd/bases/barmancloud.cnpg.io_objectstores.yaml

Lines changed: 1 addition & 1 deletion
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.16.1
6+
controller-gen.kubebuilder.io/version: v0.16.2
77
name: objectstores.barmancloud.cnpg.io
88
spec:
99
group: barmancloud.cnpg.io

0 commit comments

Comments
 (0)