You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Gateway reconcile panics when a provider has no env block #272
ProviderSpec.Env is an optional *[]corev1.EnvVar (api/v1alpha1/gateway_types.go L402-404), but updateProvidersSummary dereferences it unconditionally with range *p.Env (internal/controller/gateway_controller.go L276 and L296). Any provider with a supported name (for example ollama, which needs no API key Secret) and no env block makes every Gateway reconcile panic with a nil pointer dereference. The enabled check comes after the dereference (L305), so enabled: false does not avoid it. The panic happens in reconcileGatewayStatus after the Deployment, Service, routing, HPA and ServiceAccount have already been applied, so the workload comes up but status.url, status.providerSummary, status.mcpServers and status.a2aAgents are never written. controller-runtime recovers the panic and requeues the request with backoff indefinitely.
Steps to Reproduce
In a namespace labeled inference-gateway.com/managed=true, apply a Gateway whose only provider is - name: ollama with enabled: true and no env.
Check the operator logs: kubectl logs -n inference-gateway-system deployment/operator-inference-gateway.
Check the Gateway status: kubectl get gateway <name> -o jsonpath='{.status}'.
Reproduced offline by calling GatewayReconciler.Reconcile against a controller-runtime fake client with that spec; it panics with runtime error: invalid memory address or nil pointer dereference at gateway_controller.go:276 (updateProvidersSummary <- reconcileGatewayStatus <- Reconcile).
Expected Behavior
A provider without env is treated like one with an empty list: it is skipped from status.providerSummary (no Secret to check), and the rest of the status is written normally.
Actual Behavior
Every reconcile of that Gateway fails with a recovered nil pointer panic, the operator logs the panic and retries with backoff forever, and the Gateway status beyond serviceAccountName stays empty.
One guard before the first range *p.Env covers both loops - a provider with no env has no Secret to check, so it is skipped exactly like one with an unresolvable secret, and the rest of the status is written normally.
ifp.Env==nil {
logger.V(1).Info("Skipping provider without env", "provider", p)
continue
}
The other .Env reads in the controllers (gateway_controller.go:711 container env, agent_controller.go:375, orchestrator_controller.go:572) already nil-check, so nothing else needed changing.
Tests added in gateway_controller_test.go: an env-less ollama provider yields an empty summary instead of panicking, and an enabled provider whose Secret holds the API key is still listed.
skipped: treating env: [] and missing env differently, add when a provider needs status without a Secret.
Activity
edenreich commentedon Oct 4, 2026
@claude can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Oct 4, 2026
Claude finished @edenreich's task in 4m 2s —— View job •
fix/issue-272-20261004-1100• [Create PR ➔](https://github.com/inference-gateway/operator/compare/main...fix/issue-272-20261004-1100?quick_pull=1&title=Issue%20%23272%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23272%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Fixed: nil
ProviderSpec.EnvpanicupdateProvidersSummaryand grep every.Envdereferencetask test,task fmt,task vet,task lint(all pass, 0 lint issues)One guard before the first
range *p.Envcovers both loops - a provider with noenvhas no Secret to check, so it is skipped exactly like one with an unresolvable secret, and the rest of the status is written normally.The other
.Envreads in the controllers (gateway_controller.go:711container env,agent_controller.go:375,orchestrator_controller.go:572) already nil-check, so nothing else needed changing.Tests added in
gateway_controller_test.go: an env-lessollamaprovider yields an empty summary instead of panicking, and an enabled provider whose Secret holds the API key is still listed.skipped: treating
env: []and missingenvdifferently, add when a provider needs status without a Secret.PR #278
|
fix/issue-272-20261004-1100inference-gateway-releaser commentedon Oct 4, 2026
🎉 This issue has been resolved in version 0.27.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀