Skip to content

Commit

Permalink
add "make generate-crds-venconn"
Browse files Browse the repository at this point in the history
  • Loading branch information
maelvls committed Sep 26, 2024
1 parent 2aeaa9b commit cce1879
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.1
name: venaficonnections.jetstack.io
spec:
group: jetstack.io
Expand Down Expand Up @@ -140,7 +140,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: 'DEPRECATED: This field does nothing and
description: 'Deprecated: This field does nothing and
will be removed in the future.'
type: string
role:
Expand Down Expand Up @@ -168,7 +168,6 @@ spec:
The fields are Vault keys pointing to the secrets passed to the next
SecretSource step.
Example 1 (TPP, username and password): imagining that you have stored
the username and password for TPP under the keys "username" and
"password", you will want to set this field to `["username",
Expand Down Expand Up @@ -352,7 +351,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: 'DEPRECATED: This field does nothing and
description: 'Deprecated: This field does nothing and
will be removed in the future.'
type: string
role:
Expand Down Expand Up @@ -380,7 +379,6 @@ spec:
The fields are Vault keys pointing to the secrets passed to the next
SecretSource step.
Example 1 (TPP, username and password): imagining that you have stored
the username and password for TPP under the keys "username" and
"password", you will want to set this field to `["username",
Expand Down Expand Up @@ -550,7 +548,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: 'DEPRECATED: This field does nothing and
description: 'Deprecated: This field does nothing and
will be removed in the future.'
type: string
role:
Expand Down Expand Up @@ -578,7 +576,6 @@ spec:
The fields are Vault keys pointing to the secrets passed to the next
SecretSource step.
Example 1 (TPP, username and password): imagining that you have stored
the username and password for TPP under the keys "username" and
"password", you will want to set this field to `["username",
Expand Down Expand Up @@ -761,7 +758,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: 'DEPRECATED: This field does nothing and
description: 'Deprecated: This field does nothing and
will be removed in the future.'
type: string
role:
Expand Down Expand Up @@ -789,7 +786,6 @@ spec:
The fields are Vault keys pointing to the secrets passed to the next
SecretSource step.
Example 1 (TPP, username and password): imagining that you have stored
the username and password for TPP under the keys "username" and
"password", you will want to set this field to `["username",
Expand Down Expand Up @@ -959,7 +955,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: 'DEPRECATED: This field does nothing and
description: 'Deprecated: This field does nothing and
will be removed in the future.'
type: string
role:
Expand Down Expand Up @@ -987,7 +983,6 @@ spec:
The fields are Vault keys pointing to the secrets passed to the next
SecretSource step.
Example 1 (TPP, username and password): imagining that you have stored
the username and password for TPP under the keys "username" and
"password", you will want to set this field to `["username",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{{- if .Values.crds.venafiConnection.include }}
{{- if (or (semverCompare "<1.25" .Capabilities.KubeVersion.GitVersion) .Values.crds.forceRemoveValidationAnnotations) }}
# DO NOT EDIT. Use 'make generate-crds-venconn' to regenerate.
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
# This annotation prevents the CRD from being pruned by Helm when this chart is deleted.
"helm.sh/resource-policy": keep
name: venaficonnections.jetstack.io
labels:
{{- include "venafi-connection.labels" $ | nindent 4 }}
spec:
group: jetstack.io
names:
Expand Down Expand Up @@ -141,7 +137,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: "DEPRECATED: This field does nothing and will be removed in the future."
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
type: string
role:
description: |-
Expand Down Expand Up @@ -293,7 +289,7 @@ spec:
- url
type: object
vaas:
description: "Deprecated: The 'vaas' field is deprecated use the field called 'vcp' instead."
description: 'Deprecated: The ''vaas'' field is deprecated use the field called ''vcp'' instead.'
properties:
accessToken:
description: |-
Expand Down Expand Up @@ -340,7 +336,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: "DEPRECATED: This field does nothing and will be removed in the future."
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
type: string
role:
description: |-
Expand Down Expand Up @@ -526,7 +522,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: "DEPRECATED: This field does nothing and will be removed in the future."
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
type: string
role:
description: |-
Expand Down Expand Up @@ -720,7 +716,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: "DEPRECATED: This field does nothing and will be removed in the future."
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
type: string
role:
description: |-
Expand Down Expand Up @@ -906,7 +902,7 @@ spec:
/v1/auth/oidc/login
type: string
clientId:
description: "DEPRECATED: This field does nothing and will be removed in the future."
description: 'DEPRECATED: This field does nothing and will be removed in the future.'
type: string
role:
description: |-
Expand Down Expand Up @@ -1119,5 +1115,3 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{{- if .Values.crds.venafiConnection.include }}
{{- if not (or (semverCompare "<1.25" .Capabilities.KubeVersion.GitVersion) .Values.crds.forceRemoveValidationAnnotations) }}
# DO NOT EDIT. Use 'make generate-crds-venconn' to regenerate.
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
# This annotation prevents the CRD from being pruned by Helm when this chart is deleted.
"helm.sh/resource-policy": keep
name: venaficonnections.jetstack.io
labels:
{{- include "venafi-connection.labels" $ | nindent 4 }}
spec:
group: jetstack.io
names:
Expand Down Expand Up @@ -1143,5 +1139,3 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions make/02_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ release: $(helm_chart_archive)
@echo "RELEASE_HELM_CHART_TAR=$(helm_chart_archive)" >> "$(GITHUB_OUTPUT)"

@echo "Release complete!"

.PHONY: generate-crds-venconn
## Pulls the VenafiConnection CRD from the venafi-connection-lib Go module.
## @category [shared] Generate/ Verify
generate-crds-venconn: $(addprefix $(helm_chart_source_dir)/templates/,venafi-connection-crd.yaml venafi-connection-crd.without-validations.yaml)

$(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml: go.mod | $(NEEDS_GO)
@echo "# DO NOT EDIT. Use 'make generate-crds-venconn' to regenerate." >$@
$(GO) run ./make/connection_crd >>$@
$(helm_chart_source_dir)/templates/venafi-connection-crd.without-validations.yaml: $(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml | $(NEEDS_YQ)
$(YQ) 'del(.. | ."x-kubernetes-validations"?) | del(.metadata.creationTimestamp)' $< >$@
$(helm_chart_source_dir)/templates/venafi-connection-crd.yaml: $(helm_chart_source_dir)/crd_bases/jetstack.io_venaficonnections.yaml | $(NEEDS_YQ)
$(YQ) 'del(.metadata.creationTimestamp)' $< >$@

shared_generate_targets += generate-crds-venconn
13 changes: 13 additions & 0 deletions make/connection_crd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"fmt"

crd "github.com/jetstack/venafi-connection-lib/config/crd/bases"
)

// With this tool, we no longer have to use something like `helm template` to
// pull the CRD manifest from the venafi-connection-lib project.
func main() {
fmt.Print(string(crd.VenafiConnectionCrd))
}

0 comments on commit cce1879

Please sign in to comment.