feat: wire Domain CR through the CQRS engine - #124
Merged
Merged
Conversation
Builds out the Domain CR follow-up to Route: internal/domains/domain
was an empty stub, internal/controller/networks/domain.go's Reconciler
was a genuine no-op (fetch, return -- no finalizer, no engine dispatch,
no Runtime field), and internal/cache/domain didn't exist. All three
are now wired the same way Route is: finalizer-gated reconciler,
Engine.Execute dispatch, DomainDomain handling create/update/delete via
DomainService.
Domain's KnativeProvider needs an ACMEConfig (server, account email,
private key secret name) that nothing in this controller previously
supplied -- there was no existing flag or config surface for it. Added
three flags to cmd/main.go and split Domain registration out of
RegisterControllers into its own RegisterDomain(mgr, rt, acmeConfig),
mirroring how RegisterBuild is already split out for its own
dependency (a Shipwright client).
Also fixes a more severe, pre-existing gap this surfaced: neither
Knative (serving.knative.dev, networking.internal.knative.dev) nor
cert-manager.io schemes were ever registered anywhere in this
controller -- Route's own KnativeProvider (DomainMapping) would have
hit "no kind is registered for the type ... in scheme" the first time
it tried to create one, the same class of bug the missing
networksv1alpha1 registration was before it. Added all three to both
RegisterSchemes (production) and testsupport.NewScheme (tests).
Left DomainCache.PublishStatus unwired -- DomainService.Reconcile
doesn't return the values it needs (domainReady, certRef, mappingRef),
and fabricating them would be worse than leaving the gap for whichever
follow-up builds the Route mediator's Domain integration.
Draft: blocked on an environments release containing #316
(DomainService.Teardown) -- go.mod stays pinned at v0.8.0, which
doesn't have it yet. Confirmed the exact failure:
internal/domains/domain/domain.go:165:29: d.domainService.Teardown
undefined (type *application.DomainService has no field or method
Teardown)
everything else in this change compiles and tests cleanly against the
released v0.8.0.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Unblocks DomainService.Teardown, which the Domain domain wiring in this PR depends on. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ntlaletsi70
marked this pull request as ready for review
August 22, 2026 12:06
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.
Summary
internal/domains/domainwas an empty stub,internal/controller/networks/domain.go's reconciler was a genuine no-op (fetch, return — no finalizer, no engine dispatch, noRuntimefield), andinternal/cache/domaindidn't exist. All three are now wired the same way Route is: finalizer-gated reconciler,Engine.Executedispatch,DomainDomainhandling create/update/delete viaDomainService.KnativeProviderneeds anACMEConfig(server, account email, private key secret name) that nothing in this controller previously supplied. Added three flags tocmd/main.go(--acme-serverdefaults to Let's Encrypt production,--acme-emailhas no default,--acme-private-key-secret-namedefaults toacme-account-key) and split Domain registration out ofRegisterControllersinto its ownRegisterDomain(mgr, rt, acmeConfig), mirroring howRegisterBuildis already split out for its own dependency (a Shipwright client).serving.knative.dev,networking.internal.knative.dev) norcert-manager.ioschemes were ever registered anywhere in this controller — Route's ownKnativeProvider(DomainMapping) would have hitno kind is registered for the type ... in schemethe first time it tried to create one, the same class of bug the missingnetworksv1alpha1registration was before it. Added all three to bothRegisterSchemes(production) andtestsupport.NewScheme(tests).DomainCache.PublishStatusunwired —DomainService.Reconciledoesn't return the values it needs (domainReady, certRef, mappingRef), and fabricating them would be worse than leaving the gap for whichever follow-up builds the Route mediator's Domain integration.Blocked — draft
Needs an
environmentsrelease containing blanketops/environments#316 (DomainService.Teardown).go.modstays pinned at the current release (v0.8.0), which doesn't have it yet. Confirmed the exact, isolated failure — everything else in this change compiles and tests cleanly against v0.8.0:Test plan
go build ./...,go vet ./...,go test ./...all clean against a localreplacepointing at the unreleasedenvironmentsbranch containing #316golangci-lint run ./...— 0 issuesinternal/domains/domain/domain_test.go— GVK, CanCreate/CanUpdate/CanDelete, Handle invalid-object/resolution-failure/create-succeeds (asserts exactly oneClusterDomainClaimapplied)/delete-removes-what-create-appliedenvironmentscuts a release including #316, bumpgo.mod, confirm real build/test