Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion deployments/kubernetes/chart/forecastle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: forecastle
description: forecastle chart that runs on kubernetes
icon: https://github.com/stakater/Forecastle/raw/master/assets/web/forecastle-round-100px.png
version: 1.2.0
version: 1.3.0
appVersion: "v2.0.0"
Comment on lines +5 to 6

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart version is bumped to 1.3.0, but values.yaml still sets forecastle.labels.version: 1.2.0 (used in _helpers.tpl for resource labels). This will make labels inconsistent with the chart release version. Consider updating the default label value to 1.3.0 or deriving it from .Chart.Version to avoid manual drift.

Copilot uses AI. Check for mistakes.
keywords:
- forecastle
Expand Down
46 changes: 46 additions & 0 deletions deployments/kubernetes/chart/forecastle/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,47 @@ spec:
{{- if .Values.forecastle.openshiftOauthProxy.resources }}
resources:
{{ toYaml .Values.forecastle.openshiftOauthProxy.resources | indent 10 }}
{{- end }}
{{- end }}
{{- if .Values.forecastle.oidcProxy.enabled }}
- name: oauth-proxy
image: "{{ .Values.forecastle.oidcProxy.image }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
name: public
Comment on lines +52 to +88

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both forecastle.openshiftOauthProxy.enabled and forecastle.oidcProxy.enabled can be set to true, which would render two containers with the same name (oauth-proxy) and the same port name (public) in a single Pod—Kubernetes will reject this manifest. Add a chart-level validation/guard to enforce mutual exclusivity (e.g., fail rendering if both are enabled), or rename one container/port to avoid collisions and make the behavior explicit.

Copilot uses AI. Check for mistakes.
args:
- --https-address=:8443
- --provider=oidc
- --oidc-issuer-url={{ .Values.forecastle.oidcProxy.issuerUrl }}
- --client-id={{ .Values.forecastle.oidcProxy.clientId }}
- --redirect-url={{ .Values.forecastle.oidcProxy.redirectUrl }}
- --upstream=http://localhost:3000
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --email-domain=*
- --scope={{ .Values.forecastle.oidcProxy.scopes }}
Comment on lines +79 to +99

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidcProxy adds an oauth2-proxy sidecar listening on 8443, but the chart’s Service template currently switches to port 443/targetPort 8443 only when openshiftOauthProxy.enabled is true. With oidcProxy.enabled=true (and OpenShift proxy disabled), the Service will still route to port 3000, bypassing the proxy / breaking TLS termination. Update templates/service.yaml to treat oidcProxy.enabled the same way (or use a combined condition like or openshiftOauthProxy.enabled oidcProxy.enabled).

Copilot uses AI. Check for mistakes.
env:
- name: OAUTH2_PROXY_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.forecastle.oidcProxy.clientSecretRef.name }}
key: {{ .Values.forecastle.oidcProxy.clientSecretRef.key }}
- name: OAUTH2_PROXY_COOKIE_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.forecastle.oidcProxy.cookieSecretRef.name }}
key: {{ .Values.forecastle.oidcProxy.cookieSecretRef.key }}

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When oidcProxy.enabled=true, several required settings can still render as empty/invalid Kubernetes fields (e.g., image: "", secretKeyRef.name/key with empty values, empty --oidc-issuer-url, --client-id, --redirect-url). Consider using Helm required/fail to enforce these values when enabled (and/or provide sensible defaults like the OpenShift proxy does via default). This prevents rendering manifests that will be rejected by the API server or crash-loop immediately.

Copilot uses AI. Check for mistakes.
volumeMounts:
- mountPath: /etc/tls/private
name: oauth-proxy-tls
{{- with .Values.forecastle.oidcProxy.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.forecastle.oidcProxy.resources }}
resources:
{{ toYaml .Values.forecastle.oidcProxy.resources | indent 10 }}
{{- end }}
{{- end }}
Comment on lines +79 to 122

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds new conditional rendering paths for the Deployment (oidcProxy), but the chart has existing helm-unittest coverage in chart/forecastle/tests/deployment_test.yaml and no new tests were added for the new sidecar. Add tests that assert: (1) oidcProxy.enabled=true renders the oauth-proxy container with --provider=oidc and the expected env/volumeMounts, and (2) mutual exclusivity/validation behavior if both proxies are enabled.

Copilot uses AI. Check for mistakes.
volumes:
Expand All @@ -85,6 +126,11 @@ spec:
secret:
secretName: openshift-oauth-proxy-tls
{{- end }}
{{- if .Values.forecastle.oidcProxy.enabled }}
- name: oauth-proxy-tls
secret:
secretName: oauth-proxy-tls
{{- end }}
serviceAccountName: {{ template "forecastle.name" . }}
{{- with .Values.forecastle.deployment.podSecurityContext }}
securityContext:
Expand Down
15 changes: 15 additions & 0 deletions deployments/kubernetes/chart/forecastle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ forecastle:
# memory: 64Mi
# image: stakater/oauth-proxy:v0.0.2
securityContext: {}
oidcProxy:
enabled: false
image: ""
issuerUrl: ""
clientId: ""
redirectUrl: ""
scopes: "openid email profile"
clientSecretRef:
name: ""
key: ""
cookieSecretRef:
name: ""
key: ""
Comment on lines +103 to +115

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidcProxy defaults (image, issuerUrl, clientId, redirectUrl, and secret refs) are empty strings. If a user sets oidcProxy.enabled=true and forgets to override one of these, the rendered manifests will be invalid or the proxy will fail to start. Consider either providing a sane default image (similar to openshiftOauthProxy.image) and/or adding chart validations (via required/fail) so Helm fails fast with a clear message when required fields are missing.

Copilot uses AI. Check for mistakes.
resources: {}
securityContext: {}
service:
annotations: {}
expose: "false"
Expand Down
Loading