Skip to content
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
9 changes: 3 additions & 6 deletions helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ helm repo update
### Install from local chart

```bash
# Basic install with OpenAI
# Basic install with OpenAI (provider auto-enables when apiKey is set)
helm install gomodel ./helm \
-n gomodel --create-namespace \
--set providers.openai.enabled=true \
--set providers.openai.apiKey="sk-..."

# Multi-provider setup with Redis cache
helm install gomodel ./helm \
-n gomodel --create-namespace \
--set providers.openai.enabled=true \
--set providers.openai.apiKey="sk-..." \
--set providers.anthropic.enabled=true \
--set providers.anthropic.apiKey="sk-ant-..." \
--set redis.enabled=true

Expand Down Expand Up @@ -86,7 +83,7 @@ stringData:
GEMINI_API_KEY: "..."
```

Then reference it:
Then reference it (use `enabled=true` when using existingSecret since apiKey isn't set directly):

```bash
helm install gomodel ./helm \
Expand Down Expand Up @@ -141,4 +138,4 @@ helm uninstall gomodel -n gomodel

- Add a values-demo.yaml file with a demo setup ready to run
- Consider adding prometheus + grafana stack as an optional subchart
- Add an example for production-ready redis configuration with persistence and authentication enabled
- Add an example for production-ready redis configuration with persistence and authentication enabled
12 changes: 6 additions & 6 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ To get the application URL:
{{- end }}

{{- $enabledProviders := list }}
{{- if .Values.providers.openai.enabled }}{{ $enabledProviders = append $enabledProviders "openai" }}{{ end }}
{{- if .Values.providers.anthropic.enabled }}{{ $enabledProviders = append $enabledProviders "anthropic" }}{{ end }}
{{- if .Values.providers.gemini.enabled }}{{ $enabledProviders = append $enabledProviders "gemini" }}{{ end }}
{{- if .Values.providers.groq.enabled }}{{ $enabledProviders = append $enabledProviders "groq" }}{{ end }}
{{- if .Values.providers.xai.enabled }}{{ $enabledProviders = append $enabledProviders "xai" }}{{ end }}
{{- if or .Values.providers.openai.enabled .Values.providers.openai.apiKey }}{{ $enabledProviders = append $enabledProviders "openai" }}{{ end }}
{{- if or .Values.providers.anthropic.enabled .Values.providers.anthropic.apiKey }}{{ $enabledProviders = append $enabledProviders "anthropic" }}{{ end }}
{{- if or .Values.providers.gemini.enabled .Values.providers.gemini.apiKey }}{{ $enabledProviders = append $enabledProviders "gemini" }}{{ end }}
{{- if or .Values.providers.groq.enabled .Values.providers.groq.apiKey }}{{ $enabledProviders = append $enabledProviders "groq" }}{{ end }}
{{- if or .Values.providers.xai.enabled .Values.providers.xai.apiKey }}{{ $enabledProviders = append $enabledProviders "xai" }}{{ end }}
Comment on lines +37 to +41
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

This logic correctly preserves backward compatibility by checking both enabled flag and apiKey, but it's inconsistent with the template helpers which only check apiKey. This discrepancy means NOTES.txt might show a provider as enabled when it won't actually be configured in the deployment. Consider adding a check for existingSecret as well: {{- if or .Values.providers.openai.enabled .Values.providers.openai.apiKey .Values.providers.existingSecret }}

Suggested change
{{- if or .Values.providers.openai.enabled .Values.providers.openai.apiKey }}{{ $enabledProviders = append $enabledProviders "openai" }}{{ end }}
{{- if or .Values.providers.anthropic.enabled .Values.providers.anthropic.apiKey }}{{ $enabledProviders = append $enabledProviders "anthropic" }}{{ end }}
{{- if or .Values.providers.gemini.enabled .Values.providers.gemini.apiKey }}{{ $enabledProviders = append $enabledProviders "gemini" }}{{ end }}
{{- if or .Values.providers.groq.enabled .Values.providers.groq.apiKey }}{{ $enabledProviders = append $enabledProviders "groq" }}{{ end }}
{{- if or .Values.providers.xai.enabled .Values.providers.xai.apiKey }}{{ $enabledProviders = append $enabledProviders "xai" }}{{ end }}
{{- if or .Values.providers.openai.enabled .Values.providers.openai.apiKey .Values.providers.openai.existingSecret }}{{ $enabledProviders = append $enabledProviders "openai" }}{{ end }}
{{- if or .Values.providers.anthropic.enabled .Values.providers.anthropic.apiKey .Values.providers.anthropic.existingSecret }}{{ $enabledProviders = append $enabledProviders "anthropic" }}{{ end }}
{{- if or .Values.providers.gemini.enabled .Values.providers.gemini.apiKey .Values.providers.gemini.existingSecret }}{{ $enabledProviders = append $enabledProviders "gemini" }}{{ end }}
{{- if or .Values.providers.groq.enabled .Values.providers.groq.apiKey .Values.providers.groq.existingSecret }}{{ $enabledProviders = append $enabledProviders "groq" }}{{ end }}
{{- if or .Values.providers.xai.enabled .Values.providers.xai.apiKey .Values.providers.xai.existingSecret }}{{ $enabledProviders = append $enabledProviders "xai" }}{{ end }}

Copilot uses AI. Check for mistakes.

{{- if eq (len $enabledProviders) 0 }}

⚠️ WARNING: No providers enabled!
Enable at least one provider (e.g., providers.openai.enabled=true)
Provide an API key for at least one provider (e.g., providers.openai.apiKey)
{{- else }}

Enabled providers: {{ join ", " $enabledProviders }}
Expand Down
6 changes: 2 additions & 4 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ Generate provider API key entries for the Secret stringData.
*/}}
{{- define "gomodel.providerSecretData" -}}
{{- range $name, $config := .Values.providers }}
{{- if and (kindIs "map" $config) (hasKey $config "enabled") }}
{{- if and $config.enabled $config.apiKey }}
{{- if and (kindIs "map" $config) (hasKey $config "apiKey") $config.apiKey }}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The logic change removes support for the enabled flag when using existingSecret. When providers.existingSecret is set, individual provider apiKey values are empty (as documented), but users still need to explicitly enable providers. The condition should be {{- if and (kindIs \"map\" $config) (or (and (hasKey $config \"enabled\") $config.enabled) (and (hasKey $config \"apiKey\") $config.apiKey)) }} to support both the auto-enable behavior and the existingSecret scenario.

Copilot uses AI. Check for mistakes.
{{ upper $name }}_API_KEY: {{ $config.apiKey | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand All @@ -122,7 +120,7 @@ Generate provider environment variables for the Deployment.
{{- define "gomodel.providerEnvVars" -}}
{{- $secretName := include "gomodel.providerSecretName" . -}}
{{- range $name, $config := .Values.providers }}
{{- if and (kindIs "map" $config) (hasKey $config "enabled") $config.enabled }}
{{- if and (kindIs "map" $config) (hasKey $config "apiKey") $config.apiKey }}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Same issue as in gomodel.providerSecretData - when using existingSecret, apiKey values are empty but providers still need to be enabled. The condition should support both auto-enable via apiKey and explicit enablement via the enabled flag.

Suggested change
{{- if and (kindIs "map" $config) (hasKey $config "apiKey") $config.apiKey }}
{{- if and (kindIs "map" $config) (or (and (hasKey $config "apiKey") $config.apiKey) (and (hasKey $config "enabled") $config.enabled)) }}

Copilot uses AI. Check for mistakes.
- name: {{ upper $name }}_API_KEY
valueFrom:
secretKeyRef:
Expand Down
Loading