Skip to content

Commit 7f1227e

Browse files
committed
feat(installer): expose platformSourceCertSecret
Installing from a registry behind a private CA needs the operator's new --platform-source-cert-secret flag; without a chart value it can only be reached by editing the Deployment, which the next helm upgrade reverts. Assisted-by: LLM Signed-off-by: Kirill Ilin <[email protected]>
1 parent c15a0d0 commit 7f1227e

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

‎packages/core/installer/templates/cozystack-operator.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ spec:
200200
{{- if .Values.cozystackOperator.platformSourceSecret }}
201201
- --platform-source-secret={{ .Values.cozystackOperator.platformSourceSecret }}
202202
{{- end }}
203+
{{- if .Values.cozystackOperator.platformSourceCertSecret }}
204+
- --platform-source-cert-secret={{ .Values.cozystackOperator.platformSourceCertSecret }}
205+
{{- end }}
203206
{{- $hasEndpointEnv := or (eq .Values.cozystackOperator.variant "talos") (eq .Values.cozystackOperator.variant "generic") }}
204207
{{- if or .Values.cozystackOperator.platformVersion $hasEndpointEnv }}
205208
env:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
suite: cozystack-operator platform source arguments
2+
3+
templates:
4+
- templates/cozystack-operator.yaml
5+
6+
tests:
7+
- it: passes platformSourceCertSecret to the operator
8+
set:
9+
cozystackOperator.platformSourceUrl: oci://registry.internal:8083/cozystack/cozystack/cozystack-packages
10+
cozystackOperator.platformSourceSecret: registry-creds
11+
cozystackOperator.platformSourceCertSecret: registry-ca
12+
asserts:
13+
- contains:
14+
path: spec.template.spec.containers[0].args
15+
content: --platform-source-cert-secret=registry-ca
16+
documentSelector:
17+
path: kind
18+
value: Deployment
19+
- contains:
20+
path: spec.template.spec.containers[0].args
21+
content: --platform-source-secret=registry-creds
22+
documentSelector:
23+
path: kind
24+
value: Deployment
25+
26+
- it: omits the cert secret flag by default
27+
asserts:
28+
- notContains:
29+
path: spec.template.spec.containers[0].args
30+
content: --platform-source-cert-secret=
31+
documentSelector:
32+
path: kind
33+
value: Deployment

‎packages/core/installer/values.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ cozystackOperator:
6363
# otherwise source-controller will report a failed condition until it is created.
6464
# See FluxCD source-controller docs for the exact key layout per scheme.
6565
platformSourceSecret: ''
66+
# Name of the Secret in cozy-system namespace with TLS material for an OCI
67+
# platform source: `ca.crt` for a registry whose certificate is issued by a
68+
# private CA, and/or `tls.crt`+`tls.key` for client certificate auth (type
69+
# Opaque or kubernetes.io/tls). When non-empty, sets spec.certSecretRef on the
70+
# generated OCIRepository; the operator rewrites that object on every start,
71+
# so a certSecretRef patched onto it by hand does not survive a restart.
72+
# The cozystack-packages source copies the spec, so it inherits the CA too.
73+
# OCI only: for a Git source put `ca.crt` into the platformSourceSecret Secret.
74+
platformSourceCertSecret: ''
6675
# Generic variant configuration (only used when cozystackOperator.variant=generic)
6776
cozystack:
6877
# Kubernetes API server host (IP only, no protocol/port)

0 commit comments

Comments
 (0)