Repository navigation
feat(operator): advertise GameServer hostname via external-dns Service annotation - #13
Merged
Merged
Conversation
…e annotation spec.networking.hostname was accepted by the CRD and collected by the dashboard (Networking settings + create wizard, with a hint promising "ingress / external-dns annotations"), but no controller code read it — a user could set a hostname and nothing happened. The reconciler now stamps the de-facto-standard external-dns.alpha.kubernetes.io/hostname annotation onto the fronting game Service when hostname is set, so an installed external-dns controller publishes the record. The operator does not create the DNS record itself, matching the field's documented contract. The hint joins the existing managed-service-annotations desired set, so removal/convergence (clearing the hostname prunes the annotation) comes for free from applyManagedServiceAnnotations. Set unconditionally on hostname, not gated on Expose type — external-dns decides what to publish from its own source config. The typed field wins over a same-key entry in serviceAnnotations. Adds unit tests for desiredServiceAnnotations and an envtest covering the set-then-prune lifecycle. Also gofmt-aligns a pre-existing misaligned label map in reconcileStatefulSet (rename leftover) that gofmt flagged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires the previously dead
spec.networking.hostnamefield. The dashboard already collects it (Networking settings + create wizard, with a hint promising "ingress / external-dns annotations") and the CRD stored it, but no controller code read it — setting a hostname did nothing.The reconciler now stamps the de-facto-standard
external-dns.alpha.kubernetes.io/hostnameannotation onto the fronting game Service whenhostnameis set, so an installed external-dns controller publishes the record. The operator does not create the DNS record itself, matching the field's documented contract.How
desiredServiceAnnotations(gs)helper overlays the external-dns hint onto the user'sserviceAnnotations;reconcileServicefeeds it through the existingapplyManagedServiceAnnotations, so clearing the hostname prunes the annotation for free (managed-annotations sentinel).Expose) — external-dns decides what to publish from its own source config.hostnamefield wins over a same-key entry inserviceAnnotations(explicit, validated, UI-backed field is authoritative).Tests
TestDesiredServiceAnnotations(empty/set/override/nil-map cases).TestGameServer_HostnameSetsExternalDNSAnnotationcovers the set-then-prune lifecycle on the real Service.Also gofmt-aligns a pre-existing misaligned label map in
reconcileStatefulSet(Kestrel→Gameplane rename leftover) that gofmt flagged.🤖 Generated with Claude Code