Skip to content

fix(gateway): skip providers without an env block - #278

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-272-20261004-1100
Oct 4, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-272-20261004-1100

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

updateProvidersSummary dereferenced the optional ProviderSpec.Env pointer unconditionally (range *p.Env), so any Gateway with a supported provider and no env block - - name: ollama being the obvious case - panicked on every reconcile. The panic happened in reconcileGatewayStatus after the workload was already applied, so controller-runtime recovered it and requeued forever while status.url, status.providerSummary, status.mcpServers and status.a2aAgents stayed empty.

A provider with no env has no Secret to check, so it is now skipped the same way a provider with an unresolvable secret is, and the rest of the status is written normally. One nil guard before the first dereference covers both range *p.Env loops. The other .Env reads in the controllers (gateway_controller.go container env, agent_controller.go, orchestrator_controller.go) already nil-check, so nothing else needed changing.

Changes

  • internal/controller/gateway_controller.go: skip providers whose env is unset in updateProvidersSummary.
  • internal/controller/gateway_controller_test.go: new Gateway providers summary specs - 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.

task test, task fmt, task vet and task lint all pass (0 lint issues).

no docs ticket: internal-only bug fix, no user-facing API or behavior change beyond no longer panicking.

Closes #272

@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner October 4, 2026 11:04
@edenreich
edenreich merged commit b069167 into main Oct 4, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-272-20261004-1100 branch October 4, 2026 11:11
inference-gateway-releaser Bot added a commit that referenced this pull request Oct 4, 2026
## [0.27.1](v0.27.0...v0.27.1) (2026-10-04)

### ♻️ Improvements

* bump go toolchain to 1.26.8 ([#282](#282)) ([949858a](949858a))

### 🐛 Bug Fixes

* **gateway:** pass server and metrics ports to container ([#279](#279)) ([d3e3915](d3e3915))
* **gateway:** skip providers without an env block ([#278](#278)) ([b069167](b069167))

### 📚 Documentation

* **agents:** add code readability guidelines ([#275](#275)) ([6b6a444](6b6a444))
* correct gateway auth and tracing claims ([#276](#276)) ([9f79f76](9f79f76))
* fix gateway label selector and orchestrator snippets ([#280](#280)) ([bb93ed2](bb93ed2))
* **readme:** document gateway spec.a2a support ([#277](#277)) ([aad725c](aad725c))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.27.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Gateway reconcile panics when a provider has no env block

1 participant