Skip to content

Commit

Permalink
updated code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeindel committed Oct 6, 2023
1 parent ca84d2f commit 552c4a9
Show file tree
Hide file tree
Showing 21 changed files with 488 additions and 526 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ revendor:
@GO111MODULE=on go mod tidy
@GO111MODULE=on go mod vendor
@chmod +x $(REPO_ROOT)/vendor/github.com/gardener/controller-manager-library/hack/run-in.sh
@chmod +x $(REPO_ROOT)/vendor/k8s.io/code-generator/*.sh

.PHONY: check
check:
Expand Down Expand Up @@ -53,6 +54,7 @@ generate:
@./hack/generate-code
@GO111MODULE=on go generate ./pkg/apis/cert/...
@./hack/copy-crds.sh
@go fmt ./pkg/...

.PHONY: docker-images
docker-images:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if .Values.createCRDs.certificates }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand All @@ -9,8 +8,7 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: certificaterevocations.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down Expand Up @@ -286,4 +284,3 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if .Values.createCRDs.certificates }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand All @@ -9,8 +8,7 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: certificates.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down Expand Up @@ -359,4 +357,3 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if .Values.createCRDs.issuers }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand All @@ -9,8 +8,7 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: issuers.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down Expand Up @@ -219,4 +217,3 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
23 changes: 17 additions & 6 deletions hack/generate-code
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,20 @@ source "$PROJECT_ROOT/build/settings.src"

rm -rf "$SCRIPT_ROOT/pkg/client/cert"

bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-groups.sh \
"deepcopy,client,informer,lister" \
$PKGPATH/pkg/client/$APINAME \
$PKGPATH/pkg/apis \
$APINAME:$APIVERSION \
-h "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}

source "${CODEGEN_PKG}/kube_codegen.sh"

kube::codegen::gen_helpers \
--input-pkg-root $PKGPATH/pkg/apis \
--output-base "${PROJECT_ROOT}/../../.." \
--boilerplate "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"

echo base "${PROJECT_ROOT}/../../.."

kube::codegen::gen_client \
--with-watch \
--input-pkg-root $PKGPATH/pkg/apis \
--output-pkg-root $PKGPATH/pkg/client/$APINAME \
--output-base "${PROJECT_ROOT}/../../.." \
--boilerplate "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: certificaterevocations.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/cert/crds/cert.gardener.cloud_certificates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: certificates.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/cert/crds/cert.gardener.cloud_issuers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: issuers.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down
9 changes: 3 additions & 6 deletions pkg/apis/cert/crds/zz_generated_crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: certificaterevocations.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down Expand Up @@ -306,8 +305,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: certificates.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down Expand Up @@ -664,8 +662,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.13.0
name: issuers.cert.gardener.cloud
spec:
group: cert.gardener.cloud
Expand Down
208 changes: 0 additions & 208 deletions pkg/apis/cert/v1alpha1/certificate.go

This file was deleted.

Loading

0 comments on commit 552c4a9

Please sign in to comment.