Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cce1879

Browse files
committedSep 26, 2024·
add "make generate-crds-venconn"
1 parent 2aeaa9b commit cce1879

File tree

5 files changed

+44
-33
lines changed

5 files changed

+44
-33
lines changed
 

‎deploy/charts/venafi-kubernetes-agent/crd_bases/jetstack.io_venaficonnections.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
44
kind: CustomResourceDefinition
55
metadata:
66
annotations:
7-
controller-gen.kubebuilder.io/version: v0.14.0
7+
controller-gen.kubebuilder.io/version: v0.16.1
88
name: venaficonnections.jetstack.io
99
spec:
1010
group: jetstack.io
@@ -140,7 +140,7 @@ spec:
140140
/v1/auth/oidc/login
141141
type: string
142142
clientId:
143-
description: 'DEPRECATED: This field does nothing and
143+
description: 'Deprecated: This field does nothing and
144144
will be removed in the future.'
145145
type: string
146146
role:
@@ -168,7 +168,6 @@ spec:
168168
The fields are Vault keys pointing to the secrets passed to the next
169169
SecretSource step.
170170
171-
172171
Example 1 (TPP, username and password): imagining that you have stored
173172
the username and password for TPP under the keys "username" and
174173
"password", you will want to set this field to `["username",
@@ -352,7 +351,7 @@ spec:
352351
/v1/auth/oidc/login
353352
type: string
354353
clientId:
355-
description: 'DEPRECATED: This field does nothing and
354+
description: 'Deprecated: This field does nothing and
356355
will be removed in the future.'
357356
type: string
358357
role:
@@ -380,7 +379,6 @@ spec:
380379
The fields are Vault keys pointing to the secrets passed to the next
381380
SecretSource step.
382381
383-
384382
Example 1 (TPP, username and password): imagining that you have stored
385383
the username and password for TPP under the keys "username" and
386384
"password", you will want to set this field to `["username",
@@ -550,7 +548,7 @@ spec:
550548
/v1/auth/oidc/login
551549
type: string
552550
clientId:
553-
description: 'DEPRECATED: This field does nothing and
551+
description: 'Deprecated: This field does nothing and
554552
will be removed in the future.'
555553
type: string
556554
role:
@@ -578,7 +576,6 @@ spec:
578576
The fields are Vault keys pointing to the secrets passed to the next
579577
SecretSource step.
580578
581-
582579
Example 1 (TPP, username and password): imagining that you have stored
583580
the username and password for TPP under the keys "username" and
584581
"password", you will want to set this field to `["username",
@@ -761,7 +758,7 @@ spec:
761758
/v1/auth/oidc/login
762759
type: string
763760
clientId:
764-
description: 'DEPRECATED: This field does nothing and
761+
description: 'Deprecated: This field does nothing and
765762
will be removed in the future.'
766763
type: string
767764
role:
@@ -789,7 +786,6 @@ spec:
789786
The fields are Vault keys pointing to the secrets passed to the next
790787
SecretSource step.
791788
792-
793789
Example 1 (TPP, username and password): imagining that you have stored
794790
the username and password for TPP under the keys "username" and
795791
"password", you will want to set this field to `["username",
@@ -959,7 +955,7 @@ spec:
959955
/v1/auth/oidc/login
960956
type: string
961957
clientId:
962-
description: 'DEPRECATED: This field does nothing and
958+
description: 'Deprecated: This field does nothing and
963959
will be removed in the future.'
964960
type: string
965961
role:
@@ -987,7 +983,6 @@ spec:
987983
The fields are Vault keys pointing to the secrets passed to the next
988984
SecretSource step.
989985
990-
991986
Example 1 (TPP, username and password): imagining that you have stored
992987
the username and password for TPP under the keys "username" and
993988
"password", you will want to set this field to `["username",

‎deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd.without-validations.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
{{- if .Values.crds.venafiConnection.include }}
2-
{{- if (or (semverCompare "<1.25" .Capabilities.KubeVersion.GitVersion) .Values.crds.forceRemoveValidationAnnotations) }}
1+
# DO NOT EDIT. Use 'make generate-crds-venconn' to regenerate.
2+
---
33
apiVersion: apiextensions.k8s.io/v1
44
kind: CustomResourceDefinition
55
metadata:
66
annotations:
77
controller-gen.kubebuilder.io/version: v0.14.0
8-
# This annotation prevents the CRD from being pruned by Helm when this chart is deleted.
9-
"helm.sh/resource-policy": keep
108
name: venaficonnections.jetstack.io
11-
labels:
12-
{{- include "venafi-connection.labels" $ | nindent 4 }}
139
spec:
1410
group: jetstack.io
1511
names:
@@ -141,7 +137,7 @@ spec:
141137
/v1/auth/oidc/login
142138
type: string
143139
clientId:
144-
description: "DEPRECATED: This field does nothing and will be removed in the future."
140+
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
145141
type: string
146142
role:
147143
description: |-
@@ -293,7 +289,7 @@ spec:
293289
- url
294290
type: object
295291
vaas:
296-
description: "Deprecated: The 'vaas' field is deprecated use the field called 'vcp' instead."
292+
description: 'Deprecated: The ''vaas'' field is deprecated use the field called ''vcp'' instead.'
297293
properties:
298294
accessToken:
299295
description: |-
@@ -340,7 +336,7 @@ spec:
340336
/v1/auth/oidc/login
341337
type: string
342338
clientId:
343-
description: "DEPRECATED: This field does nothing and will be removed in the future."
339+
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
344340
type: string
345341
role:
346342
description: |-
@@ -526,7 +522,7 @@ spec:
526522
/v1/auth/oidc/login
527523
type: string
528524
clientId:
529-
description: "DEPRECATED: This field does nothing and will be removed in the future."
525+
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
530526
type: string
531527
role:
532528
description: |-
@@ -720,7 +716,7 @@ spec:
720716
/v1/auth/oidc/login
721717
type: string
722718
clientId:
723-
description: "DEPRECATED: This field does nothing and will be removed in the future."
719+
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
724720
type: string
725721
role:
726722
description: |-
@@ -906,7 +902,7 @@ spec:
906902
/v1/auth/oidc/login
907903
type: string
908904
clientId:
909-
description: "DEPRECATED: This field does nothing and will be removed in the future."
905+
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
910906
type: string
911907
role:
912908
description: |-
@@ -1119,5 +1115,3 @@ spec:
11191115
storage: true
11201116
subresources:
11211117
status: {}
1122-
{{- end }}
1123-
{{- end }}

‎deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
{{- if .Values.crds.venafiConnection.include }}
2-
{{- if not (or (semverCompare "<1.25" .Capabilities.KubeVersion.GitVersion) .Values.crds.forceRemoveValidationAnnotations) }}
1+
# DO NOT EDIT. Use 'make generate-crds-venconn' to regenerate.
2+
---
33
apiVersion: apiextensions.k8s.io/v1
44
kind: CustomResourceDefinition
55
metadata:
66
annotations:
77
controller-gen.kubebuilder.io/version: v0.14.0
8-
# This annotation prevents the CRD from being pruned by Helm when this chart is deleted.
9-
"helm.sh/resource-policy": keep
108
name: venaficonnections.jetstack.io
11-
labels:
12-
{{- include "venafi-connection.labels" $ | nindent 4 }}
139
spec:
1410
group: jetstack.io
1511
names:
@@ -1143,5 +1139,3 @@ spec:
11431139
storage: true
11441140
subresources:
11451141
status: {}
1146-
{{- end }}
1147-
{{- end }}

‎make/02_mod.mk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@ release: $(helm_chart_archive)
1313
@echo "RELEASE_HELM_CHART_TAR=$(helm_chart_archive)" >> "$(GITHUB_OUTPUT)"
1414

1515
@echo "Release complete!"
16+
17+
.PHONY: generate-crds-venconn
18+
## Pulls the VenafiConnection CRD from the venafi-connection-lib Go module.
19+
## @category [shared] Generate/ Verify
20+
generate-crds-venconn: $(addprefix $(helm_chart_source_dir)/templates/,venafi-connection-crd.yaml venafi-connection-crd.without-validations.yaml)
21+
22+
$(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml: go.mod | $(NEEDS_GO)
23+
@echo "# DO NOT EDIT. Use 'make generate-crds-venconn' to regenerate." >$@
24+
$(GO) run ./make/connection_crd >>$@
25+
$(helm_chart_source_dir)/templates/venafi-connection-crd.without-validations.yaml: $(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml | $(NEEDS_YQ)
26+
$(YQ) 'del(.. | ."x-kubernetes-validations"?) | del(.metadata.creationTimestamp)' $< >$@
27+
$(helm_chart_source_dir)/templates/venafi-connection-crd.yaml: $(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml | $(NEEDS_YQ)
28+
$(YQ) 'del(.metadata.creationTimestamp)' $< >$@
29+
30+
shared_generate_targets += generate-crds-venconn

‎make/connection_crd/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
crd "github.com/jetstack/venafi-connection-lib/config/crd/bases"
7+
)
8+
9+
// With this tool, we no longer have to use something like `helm template` to
10+
// pull the CRD manifest from the venafi-connection-lib project.
11+
func main() {
12+
fmt.Print(string(crd.VenafiConnectionCrd))
13+
}

0 commit comments

Comments
 (0)
Please sign in to comment.