Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update Core Operator chart #212

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/core-crd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: core-crd
description: A Helm chart for Kubernetes
type: application
version: 2.1.2
appVersion: "v2.1.1"
version: 2.2.0
appVersion: "v2.2.0"
maintainers:
- name: Calyptia
email: [email protected]
Expand Down
10 changes: 10 additions & 0 deletions charts/core-crd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@

{{- define "ingestCheck.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.images.ingestCheck "global" .Values.global) }}
{{- end -}}

{{- define "validateServiceType" -}}
{{- $validTypes := list "NodePort" "LoadBalancer" "ClusterIP" -}}
{{- $type := .Values.pipelineServiceType | default "LoadBalancer" -}}
{{- if has $type $validTypes -}}
{{- $type -}}
{{- else -}}
LoadBalancer
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/core-crd/templates/pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ spec:
protocol:
type: string
serviceType:
default: LoadBalancer
default: {{ include "validateServiceType" . }}
description: Service Type string describes ingress methods for a service
type: string
type: object
Expand Down
17 changes: 17 additions & 0 deletions charts/core-crd/tests/core-crd_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
suite: Test core crd
release:
namespace: test
templates:
- pipelines.yaml

tests:
- it: checks kind
set:
pipelineServiceType: ClusterIP
asserts:
- isKind:
of: CustomResourceDefinition
- equal:
path: spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.ports.items.properties.serviceType.default
value: ClusterIP

1 change: 1 addition & 0 deletions charts/core-crd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ images:
tag: 0.0.7
pullSecrets: []
cloudUrl: https://cloud-api.calyptia.com
pipelineServiceType: LoadBalancer
4 changes: 2 additions & 2 deletions charts/core-instance/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: Calyptia Core Instance chart
home: https://calyptia.com/products/core/
icon: https://storage.googleapis.com/calyptia_public_resources_bucket/logo-darkmode.svg
type: application
version: 2.1.2
appVersion: "v2.1.1"
version: 2.2.0
appVersion: "v2.2.0"
maintainers:
- name: Calyptia
email: [email protected]
Expand Down
2 changes: 2 additions & 0 deletions charts/core-instance/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ spec:
value: {{ .Values.healthCheckPipelineServiceType | quote }}
- name: INGEST_CHECK_IMAGE
value: {{ template "ingestCheck.image" . }}
- name: ANNOTATIONS
value: {{ .Values.calyptiaAnnotations }}
image: {{ template "fromCloud.image" . }}
imagePullPolicy: {{ .Values.global.pullPolicy | quote }}
name: from-cloud
Expand Down
52 changes: 52 additions & 0 deletions charts/core-instance/tests/core-instance_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tests:
cloudUrl: test_url
coreInstance: ci-1234
cloudToken: xxx
calyptiaAnnotations: "test=1234,nope=4321"
images:
fromCloud:
registry: custom.io
Expand Down Expand Up @@ -107,6 +108,11 @@ tests:
value:
value: custom.io/test/ingestcheck:1.2.3
name: INGEST_CHECK_IMAGE
- equal:
path: spec.template.spec.containers[0].env[12]
value:
value: test=1234,nope=4321
name: ANNOTATIONS

# To Cloud
- equal:
Expand Down Expand Up @@ -139,3 +145,49 @@ tests:
value:
value: "true"
name: NO_TLS_VERIFY
- it: checks annotations
set:
coreInstance: ci-1234
cloudToken: xxx
calyptiaAnnotations: "test=1234,nope=test"
asserts:
- equal:
path: spec.template.spec.containers[0].env[12]
value:
value: test=1234,nope=test
name: ANNOTATIONS
- it: checks annotations white space
set:
coreInstance: ci-1234
cloudToken: xxx
calyptiaAnnotations: "test=some three words,nope=two words"
asserts:
- equal:
path: spec.template.spec.containers[0].env[12]
value:
value: test=some three words,nope=two words
name: ANNOTATIONS
- it: checks annotations special char
set:
coreInstance: ci-1234
cloudToken: xxx
calyptiaAnnotations: "[email protected],nope=two words"
asserts:
- equal:
path: spec.template.spec.containers[0].env[12]
value:
value: [email protected],nope=two words
name: ANNOTATIONS
- it: checks annotations special char
set:
coreInstance: ci-1234
cloudToken: xxx
calyptiaAnnotations: "myspecial/annotation='this has spaces'"
asserts:
- equal:
path: spec.template.spec.containers[0].env[12]
value:
value: myspecial/annotation='this has spaces'
name: ANNOTATIONS


7 changes: 5 additions & 2 deletions charts/core-instance/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ cloudUrl: "https://cloud-api.calyptia.com"
enableHealthCheckPipeline: false
healthCheckPipelinePort: 2020
healthCheckPipelineServiceType: LoadBalancer
# calyptiaAnnotations is a core-instance specific parameter
# NOT to be confused with standard annotations
calyptiaAnnotations: ""
images:
fromCloud:
registry: ghcr.io
repository: calyptia/core-operator/sync-from-cloud
tag: 2.1.1
tag: 2.2.0
pullSecrets: []
toCloud:
registry: ghcr.io
repository: calyptia/core-operator/sync-to-cloud
tag: 2.1.1
tag: 2.2.0
pullSecrets: []
hotReload:
registry: ghcr.io
Expand Down
4 changes: 2 additions & 2 deletions charts/core-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: Calyptia Core Operator chart
home: https://calyptia.com/products/core/
icon: https://storage.googleapis.com/calyptia_public_resources_bucket/logo-darkmode.svg
type: application
version: 2.1.2
appVersion: "v2.1.1"
version: 2.2.0
appVersion: "v2.2.0"
maintainers:
- name: Calyptia
email: [email protected]
Expand Down
1 change: 1 addition & 0 deletions charts/core-operator/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rules:
- rbac.authorization.k8s.io
- security.openshift.io
resources:
- events
- namespaces
- serviceaccounts
- deployments
Expand Down
2 changes: 1 addition & 1 deletion charts/core-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ images:
operator:
registry: ghcr.io
repository: calyptia/core-operator
tag: 2.1.1
tag: 2.2.0
pullSecrets: []
hotReload:
registry: ghcr.io
Expand Down
Loading