Documentation
¶
Overview ¶
register.go wires the controller manager's runtime at startup.
It owns: registering every external and internal API type with the client-go scheme (RegisterSchemes), ensuring the manager's ServiceAccount exists (EnsureServiceAccount), applying raw manifests via the dynamic client (Apply), and registering the observer and CQRS reconcilers (RegisterObservers, RegisterControllers, RegisterBuild).
It owns no reconciliation logic itself — that lives in internal/domains, internal/mediators, and internal/controller/*, plus the build domain's backend providers in the external blanketops-environments-core library. cmd/main.go is this file's only caller.
Index ¶
- func Apply(ctx context.Context, cfg *rest.Config, manifest []byte) error
- func EnsureServiceAccount(ctx context.Context, cfg *rest.Config) error
- func RegisterBuild(mgr ctrl.Manager, rt *runtimeinfra.Runtime, logger logr.Logger, ...) error
- func RegisterControllers(mgr ctrl.Manager, rt *runtimeinfra.Runtime) error
- func RegisterDomain(mgr ctrl.Manager, rt *runtimeinfra.Runtime, acmeConfig domainapi.ACMEConfig) error
- func RegisterObservers(mgr ctrl.Manager) error
- func RegisterSchemes(scheme *runtime.Scheme)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply server-side applies a multi-document YAML or JSON manifest using the dynamic client. Empty documents are skipped and AlreadyExists errors are treated as success, so callers can safely re-apply the same manifest.
func EnsureServiceAccount ¶
EnsureServiceAccount creates the manager's ServiceAccount if it does not already exist. Safe to call on every startup.
func RegisterBuild ¶
func RegisterBuild( mgr ctrl.Manager, rt *runtimeinfra.Runtime, logger logr.Logger, recorder events.EventRecorder, ) error
RegisterBuild wires up the build domain's backend providers — Buildah, Kaniko, and Buildpacks, from blanketops-environments-core — behind a single BackendSelector and BuildService, then registers the resulting BuildReconciler. It's separate from RegisterControllers because it needs a Shipwright client, logger, and event recorder the manager doesn't otherwise construct.
func RegisterControllers ¶
func RegisterControllers(mgr ctrl.Manager, rt *runtimeinfra.Runtime) error
RegisterControllers wires up the primary CQRS reconcilers: GitRepository, GitHubEvent, Deployment, ServiceUnit, Package, Environment, Route. Domain is registered separately by RegisterDomain — it needs an ACME config the manager doesn't otherwise construct.
func RegisterDomain ¶
func RegisterDomain(mgr ctrl.Manager, rt *runtimeinfra.Runtime, acmeConfig domainapi.ACMEConfig) error
RegisterDomain wires up and registers the DomainReconciler. It's separate from RegisterControllers because Domain needs an ACME config (server, account email, private key secret name) that the manager doesn't otherwise construct — cmd/main.go sources it from flags/env and has no safe hardcoded default for the account email.
func RegisterObservers ¶
RegisterObservers wires up the observer reconcilers for Build, BuildRun, Deployment, Environment, GitHubEvent, GitRepository, and Package resources.
func RegisterSchemes ¶
RegisterSchemes adds every API group the controller and its dependent providers need to the runtime scheme: this repo's own environments, events, sources, and networks types from environments-api, plus the external CRDs — Argo Events, Flux (source and kustomize controllers), Kapp Controller, Shipwright, Tekton Pipelines, cert-manager, and Knative serving/networking — that the domains and mediators reconcile against.
The Knative and cert-manager registrations were missing entirely until the Domain CR follow-up added them: Route's KnativeProvider (DomainMapping, serving.knative.dev) and Domain's KnativeProvider (ClusterDomainClaim, networking.internal.knative.dev; Issuer/Certificate, cert-manager.io) would otherwise fail the first time either tried to create a resource through this manager's client, with "no kind is registered for the type ... in scheme" — the same class of bug the missing networksv1alpha1 registration was before it.
Types ¶
This section is empty.