Skip to content

fix(gateway): default spec.server and name the service port in status.url - #306

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-304
Oct 31, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-304

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #304

Summary

A Gateway without spec.server serves on 8080 but nothing said so: the PORT column was empty and status.url omitted the port, so clients dials port 80 and were refused. The fix defaults spec.server to {} on the CRD so the nested host/port defaults land, and names the Service port in status.url whenever it is not the scheme's implicit default (80 for http, 443 for https).

Changes

  • api/v1alpha1/gateway_types.go: add +kubebuilder:default={} on spec.server so newly created Gateways get spec.server.host: 0.0.0.0 and spec.server.port: 8080 (the Port printcolumn reads .spec.server.port). Explicit values, like the port the CLI sets as its workaround in feat(teleport): deploy a gateway per kubernetes workspace that holds the provider keys cli#1667, keep winning; the workaround stays harmless and can be dropped at leisure.
  • internal/controller/gateway_controller.go: build the status URL through a gatewayURL closure that appends the Service main port (same precedence as desiredService, via the existing gatewayServicePort helper) when it is not the scheme default, through a new schemeDefaultPort helper. URLs taken from an HTTPRoute hostname keep their implicit 80/443 and stay portless; the service-FQDN fallback (including when routing is enabled but the HTTPRoute is missing) now names its port, e.g. http://<name>.<ns>.svc.cluster.local:8080.
  • Regenerated CRD bases and manifests/crds.yaml + manifests/install.yaml.
  • Acceptance test: a Gateway created without spec.server gets spec.server.port == 8080 from the apiserver default and status.url == http://<name>.<ns>.svc.cluster.local:8080.

Notes

  • The CRD default applies to Gateways created after the CRD update; a pre-existing Gateway picks it up on its next spec write. Gateways created after this release are fully covered.
  • Docs ticket (operator docs) will follow for the changed user-facing status URL behavior.

no docs behavior in the operator repo changed beyond the status URL formatting; the docs ticket covers it.

….url

A Gateway without spec.server serves on 8080, but the PORT column was empty and status.url omitted the port. Default spec.server to {} so the nested host/port defaults land, and append the service port whenever it is not the scheme's implicit 80/443; HTTPRoute hostname URLs keep their implicit default.
@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review October 31, 2026 20:03
@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner October 31, 2026 20:03
@edenreich
edenreich merged commit d7b1792 into main Oct 31, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-304 branch October 31, 2026 20:18
inference-gateway-releaser Bot added a commit that referenced this pull request Oct 31, 2026
## [0.29.0](v0.28.1...v0.29.0) (2026-10-31)

### ✨ Features

* **orchestrator:** link a Gateway and park it while suspended ([#307](#307)) ([b03c9bd](b03c9bd))

### 🐛 Bug Fixes

* **gateway:** default spec.server and name the service port in status.url ([#306](#306)) ([d7b1792](d7b1792))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.29.0 🎉

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 31, 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 without spec.server shows no port and its status.url omits 8080

1 participant