-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sunny Yip <[email protected]>
- Loading branch information
Showing
12 changed files
with
480 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ maintainers: | |
email: [email protected] | ||
|
||
type: application | ||
version: 0.4.1 | ||
appVersion: "v0.7.1" | ||
version: 0.5.0 | ||
appVersion: "v0.8.0" | ||
|
||
dependencies: | ||
- name: nats | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright Kusari, Inc. and contributors | ||
# Licensed under the MIT license. See LICENSE file in the project root for details. | ||
{{ if .Values.guac.cdCertifier.enabled }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.guac.cdCertifier.name }} | ||
{{- if .Values.guac.cdCertifier.annotations }} | ||
annotations: | ||
{{ toYaml .Values.guac.cdCertifier.annotations | indent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "guac.labels" . | nindent 4 }} | ||
app.kubernetes.io/name: {{ .Values.guac.cdCertifier.name }} | ||
app.kubernetes.io/component: {{ .Values.guac.cdCertifier.name }} | ||
spec: | ||
replicas: {{ .Values.guac.cdCertifier.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "guac.selectorLabels" . | nindent 6 }} | ||
app.kubernetes.io/name: {{ .Values.guac.cdCertifier.name }} | ||
app.kubernetes.io/component: {{ .Values.guac.cdCertifier.name }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "guac.selectorLabels" . | nindent 8 }} | ||
app.kubernetes.io/name: {{ .Values.guac.cdCertifier.name }} | ||
app.kubernetes.io/component: {{ .Values.guac.cdCertifier.name }} | ||
spec: | ||
serviceAccountName: {{ .Values.guac.cdCertifier.name }} | ||
containers: | ||
- name: {{ .Values.guac.cdCertifier.name }} | ||
{{- if .Values.guac.guacImage.digest }} | ||
image: "{{ .Values.guac.guacImage.repository }}@{{ .Values.guac.guacImage.digest }}" | ||
{{- else }} | ||
image: "{{ .Values.guac.guacImage.repository }}:{{ .Values.guac.guacImage.tag | default .Chart.AppVersion}}" | ||
{{- end }} | ||
imagePullPolicy: "{{ .Values.guac.guacImage.pullPolicy }}" | ||
command: | ||
{{ toYaml .Values.guac.cdCertifier.image.command | indent 10 }} | ||
workingDir: {{ .Values.guac.guacImage.workingDir }} | ||
{{- if .Values.guac.cdCertifier.ports }} | ||
ports: | ||
{{ toYaml .Values.guac.cdCertifier.image.ports | indent 10 }} | ||
{{- end }} | ||
{{- if .Values.guac.cdCertifier.resources }} | ||
resources: {{- toYaml .Values.guac.cdCertifier.resources | nindent 10 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: guac-config | ||
mountPath: {{ .Values.guac.guacImage.workingDir }} | ||
readOnly: true | ||
|
||
{{- if or .Values.guac.common.env .Values.guac.cdCertifier.env }} | ||
env: | ||
{{- if .Values.guac.common.env }} | ||
{{ toYaml .Values.guac.common.env | indent 10 }} | ||
{{- end }} | ||
{{- if .Values.guac.cdCertifier.env }} | ||
{{ toYaml .Values.guac.cdCertifier.env | indent 10 }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{ toYaml .Values.imagePullSecrets | indent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: guac-config | ||
configMap: | ||
name: guac-cm | ||
{{- if .Values.guac.cdCertifier.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml .Values.guac.cdCertifier.nodeSelector | indent 8 }} | ||
{{- end }} | ||
|
||
{{- if or .Values.guac.common.tolerations .Values.guac.cdCertifier.tolerations }} | ||
tolerations: | ||
{{- if .Values.guac.common.tolerations }} | ||
{{ toYaml .Values.guac.common.tolerations | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.guac.cdCertifier.tolerations }} | ||
{{ toYaml .Values.guac.cdCertifier.tolerations | indent 8 }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright Kusari, Inc. and contributors | ||
# Licensed under the MIT license. See LICENSE file in the project root for details. | ||
{{ if .Values.guac.cdCertifier.enabled }} | ||
{{ if .Values.guac.cdCertifier.serviceAccount.create }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Values.guac.cdCertifier.name }} | ||
{{- if .Values.guac.cdCertifier.annotations }} | ||
annotations: | ||
{{ toYaml .Values.guac.cdCertifier.serviceAccount.annotations | indent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "guac.labels" . | nindent 4 }} | ||
app.kubernetes.io/name: {{ .Values.guac.cdCertifier.name }} | ||
app.kubernetes.io/component: {{ .Values.guac.cdCertifier.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Copyright Kusari, Inc. and contributors | ||
# Licensed under the MIT license. See LICENSE file in the project root for details. | ||
suite: CD Certifier Deployment tests | ||
templates: | ||
- cd-certifier-deployment.yaml | ||
|
||
tests: | ||
- it: deployment should render | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- hasDocuments: | ||
count: 1 | ||
|
||
- it: should run the cdCertifier image | ||
values: | ||
- ./values_digest_and_tag.yaml | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].name | ||
value: cd-certifier | ||
- equal: | ||
path: spec.template.spec.containers[0].image | ||
value: ghcr.io/guacsec/guac@sha256:167e823f36e268f66b12a79d4c4b39df23c2f87847817c161b6c6ddbc9ee5c4e | ||
|
||
- it: should run the cdCertifier sub command | ||
values: | ||
- ./values_digest_and_tag.yaml | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].command[0] | ||
value: "sh" | ||
- equal: | ||
path: spec.template.spec.containers[0].command[1] | ||
value: "-c" | ||
- equal: | ||
path: spec.template.spec.containers[0].command[2] | ||
value: "/opt/guac/guaccollect cd" | ||
|
||
- it: should respect spec level parameters | ||
values: | ||
- ./values_digest_and_tag.yaml | ||
asserts: | ||
- equal: | ||
path: spec.replicas | ||
value: 1 | ||
- equal: | ||
path: spec.selector.matchLabels["app.kubernetes.io/name"] | ||
value: cd-certifier | ||
- equal: | ||
path: spec.template.metadata.labels["app.kubernetes.io/name"] | ||
value: cd-certifier | ||
|
||
- it: should use tag if only tag is specified | ||
values: | ||
- ./values_tag_no_digest.yaml | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].image | ||
value: ghcr.io/guacsec/guac:latest | ||
|
||
- it: should include tolerations | ||
values: | ||
- ./values_combine.yaml | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.tolerations[0].key | ||
value: "kusari.cloud/common" | ||
- equal: | ||
path: spec.template.spec.tolerations[0].value | ||
value: common | ||
- equal: | ||
path: spec.template.spec.tolerations[0].effect | ||
value: NoSchedule | ||
- equal: | ||
path: spec.template.spec.tolerations[0].operator | ||
value: Equal | ||
|
||
- equal: | ||
path: spec.template.spec.tolerations[1].key | ||
value: "kusari.cloud/own" | ||
- equal: | ||
path: spec.template.spec.tolerations[1].value | ||
value: own | ||
- equal: | ||
path: spec.template.spec.tolerations[1].effect | ||
value: NoSchedule | ||
- equal: | ||
path: spec.template.spec.tolerations[1].operator | ||
value: Equal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ guac: | |
osvCertifier: | ||
name: osv-certifier | ||
|
||
cdCertifier: | ||
name: cd-certifier | ||
|
||
ingestor: | ||
name: ingestor | ||
|
||
|
Oops, something went wrong.