Skip to content

Commit

Permalink
fix: verify templates render properly
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Witlin <[email protected]>
  • Loading branch information
coolguy1771 committed Aug 29, 2024
1 parent 666b183 commit 1e055ec
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 96 deletions.
121 changes: 66 additions & 55 deletions charts/adcs-issuer/templates/adcsissuer-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-
controller-gen.kubebuilder.io/version: v0.7.0
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- include "chart.labels" . | nindent 4 }}
spec:
group: adcs.certmanager.csf.nokia.com
names:
Expand All @@ -17,63 +17,74 @@ spec:
singular: adcsissuer
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: AdcsIssuer is the Schema for the adcsissuers API
type: object
properties:
apiVersion:
description: APIVersion defines the versioned schema of this representation of an object.
type: string
kind:
description: Kind is a string value representing the REST resource this object represents.
type: string
metadata:
type: object
spec:
description: AdcsIssuerSpec defines the desired state of AdcsIssuer
type: object
properties:
caBundle:
description: CABundle is a PEM encoded TLS certificate to use to verify connections to the ADCS server.
type: string
format: byte
credentialsRef:
description: CredentialsRef is a reference to a Secret containing the username and password for the ADCS server.
type: object
properties:
name:
description: Name of the referent.
type: string
required:
- name
retryInterval:
description: How often to retry in case of communication errors (in time.ParseDuration() format). Default: 1 hour.
type: string
statusCheckInterval:
description: How often to check for request status in the server (in time.ParseDuration() format). Default: 6 hours.
type: string
templateName:
description: Which ADCS Template should this issuer use. Defaults to the value specified in main.go or as a CLI option.
type: string
url:
description: URL is the base URL for the ADCS instance.
type: string
required:
- credentialsRef
- url
status:
description: AdcsIssuerStatus defines the observed state of AdcsIssuer
type: object
served: true
storage: true
subresources:
status: {}
- name: v1
schema:
openAPIV3Schema:
description: AdcsIssuer is the Schema for the adcsissuers API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: AdcsIssuerSpec defines the desired state of AdcsIssuer
properties:
caBundle:
description: CABundle is a PEM encoded TLS certifiate to use to verify
connections to the ADCS server.
format: byte
type: string
credentialsRef:
description: CredentialsRef is a reference to a Secret containing the
username and password for the ADCS server. The secret must contain
two keys, 'username' and 'password'.
properties:
name:
description: Name of the referent.
type: string
required:
- name
type: object
retryInterval:
description: How often to retry in case of communication errors (in
time.ParseDuration() format) Default 1 hour.
type: string
statusCheckInterval:
description: How often to check for request status in the server (in
time.ParseDuration() format) Default 6 hours.
type: string
templateName:
description: Which ADCS Template should this issuer use Defaults to
the what is specified in main.go or as an cli option.
type: string
url:
description: URL is the base URL for the ADCS instance
type: string
required:
- credentialsRef
- url
type: object
status:
description: AdcsIssuerStatus defines the observed state of AdcsIssuer
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

{{- end }}
2 changes: 1 addition & 1 deletion charts/adcs-issuer/templates/adcsrequest-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ status:
conditions: []
storedVersions: []

{{- end }}
{{- end }}
39 changes: 1 addition & 38 deletions charts/adcs-issuer/templates/simulator-clusterissuer.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if .Values.simulator.enabled }}

apiVersion: adcs.certmanager.csf.nokia.com/v1
kind: ClusterAdcsIssuer
metadata:
Expand All @@ -9,43 +8,7 @@ metadata:
{{- include "chart.labels" . | nindent 4 }}
spec:
caBundle: |
{{- .Values.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I/yx3CTHdn6fhpSmrJlxX9Ng2gU
ahtQiMPqwn/7+2MUUEkChz3RWQWSbqEM3DFi9MiYHmP/cfBQrGXHZvw7nk026uuq
GKlbIUk+pZTbhMgePYR3AgMBAAGjgYAwfjAdBgNVHQ4EFgQUTKZUB+EXTViSnWiv
3X4eR7xtiuEwHwYDVR0jBBgwFoAUTKZUB+EXTViSnWiv3X4eR7xtiuEwDwYDVR0T
AQH/BAUwAwEB/zArBgNVHREEJDAiggtleGFtcGxlLmNvbYINKi5leGFtcGxlLmNv
bYcECgAAATANBgkqhkiG9w0BAQsFAAOCAgEAcd5greti44ukjgxWSNoYFs6HZ659
OostxKLH0jMFSUQxvt5trK9kjw27hWYg5C73WIc3Xle/byPSykTQsxq9ti96qe0T
U4+hsfdFVekqlN83h3pZ/LoD9yElX2vzFkLaiqn/7GWdf6m472zpgXx6oPlP6GTV
n9pbqPhbutMSAjpomrR5SiuePosViV1UjPv6QUvKWuS+GOP0HzY+Ku1yfez1/pRp
0t5JTgMNUoYSkjC4dSyPBy9HQMxR7Oig3MNzYeuC90sYvv6GJ4n9sqQxcj+aDc3g
bDxFZV9Qu19W+zCgLP25aqsc3R52c0dEbByZVEj2u36U7o2sgERPViv3Nw9qcfZE
mTZ/+UQ9yuYrf9aKc0qSU5qVouzx1nG9TQbX/5ghZgmwULRLTig2owAibD05JU0e
aynSCbmEJkdIPx5drKzbaB9RKJ//jrkpmUSCO8B9RjRVZmmIItxdn28pyDy7A8JX
XYwBFQIftCB1WPixxrliTiYrQotKgK4T7A/ytTayFMtaMvBqM7oulj5v3PowcfZj
hkezaNPsRx4cLSG/9Pc02Q0EHCjLzl8S8F8/m06njYu9kPdG77uV25ovSaNynBm4
jf17P52P5zqPwWQsOMOu51OTDhyagDh1qVJayr4k9skApIyYEBTshBBuOwrP/nxF
F8SDNn5wjsYpUIs=
-----END CERTIFICATE-----
EOF
}}
{{- .Values.simulator.caBundle | default "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tL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xeWZlejEvcFJwDQowdDVKVGdNTlVvWVNrakM0ZFN5UEJ5OUhRTXhSN09pZzNNTnpZZXVDOTBzWXZ2NkdKNG45c3FReGNqK2FEYzNnDQpiRHhGWlY5UXUxOVcrekNnTFAyNWFxc2MzUjUyYzBkRWJCeVpWRWoydTM2VTdvMnNnRVJQVml2M053OXFjZlpFDQptVFovK1VROXl1WXJmOWFLYzBxU1U1cVZvdXp4MW5HOVRRYlgvNWdoWmdtd1VMUkxUaWcyb3dBaWJEMDVKVTBlDQpheW5TQ2JtRUprZElQeDVkckt6YmFCOVJLSi8vanJrcG1VU0NPOEI5UmpSVlptbUlJdHhkbjI4cHlEeTdBOEpYDQpYWXdCRlFJZnRDQjFXUGl4eHJsaVRpWXJRb3RLZ0s0VDdBL3l0VGF5Rk10YU12QnFNN291bGo1djNQb3djZlpqDQpoa2V6YU5Qc1J4NGNMU0cvOVBjMDJRMEVIQ2pMemw4UzhGOC9tMDZuall1OWtQZEc3N3VWMjVvdlNhTnluQm00DQpqZjE3UDUyUDV6cVB3V1FzT01PdTUxT1REaHlhZ0RoMXFWSmF5cjRrOXNrQXBJeVlFQlRzaEJCdU93clAvbnhGDQpGOFNETm41d2pzWXBVSXM9DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t" | nindent 4 }}
credentialsRef:
name: {{ .Values.simulator.secretName | default "adcs-sim-secret" }} # secret with username and password
statusCheckInterval: 1m
Expand Down
5 changes: 3 additions & 2 deletions charts/adcs-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,15 @@ simulator:
secretCertificateName: adcs-sim-certificate-secret # Name of the secret for simulator certificates.
secretName: adcs-sim-secret # Name of the secret for simulator credentials.
serviceName: adcs-sim-service # Name of the service for the simulator.

# @section Certificate
# Certificate settings for the simulator, managed by cert-manager.
issuerName: adcs-sim-issuer # Name of the cert-manager issuer to use.
issuerKind: Issuer # Kind of the cert-manager issuer (Issuer or ClusterIssuer).
issuerGroup: cert-manager.io # API group of the issuer.
certificateDuration: 2160h # Duration of the certificate validity (default: 90 days).
certificateRenewBefore: 360h # When to renew the certificate before expiry (default: 15 days).
caBundle: "" # CA bundle for the certificate.

# @section Image
# Image settings for the ADCS Simulator.
Expand Down Expand Up @@ -254,7 +255,7 @@ simulator:
memory: 500Mi
requests:
cpu: 100m
memory: 100Mi
memory: 100Mi

# @section Example Certificate
# Configuration for an example certificate used by the simulator.
Expand Down

0 comments on commit 1e055ec

Please sign in to comment.