resolve

package
v0.8.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package resolve implements resolution for the Domain CR.

The Domain CR stores its spec as a raw JSON contract (spec.contract). ResolveDomain decodes this into a fully typed ResolvedDomain — the authoritative runtime representation consumed by all downstream domain and application logic.

Domain owns the cert/mapping chain for a host within a BlanketOps Environment. It is owned by a Route CR via ownerReference (cascade delete). Route owns the workload binding (runtime, path, enabled); Domain owns TLS and mTLS identity.

Required contract fields:

  • host — the FQDN this domain covers
  • routeRef — the Route CR in this namespace that owns this Domain
  • tlsStrategy — the cert provisioning path (platform | custom)

Optional contract fields:

  • mtls.enforced — whether mTLS is enforced via blanketops-proxy + blanketK
  • renewBefore — cert renewal window; only applies to tlsStrategy: custom

TLS strategy semantics:

platform: Platform wildcard cert (*.dev.host) already covers this host via a
          DNS01 ClusterIssuer. Controller emits DomainClaim + DomainMapping
          only. renewBefore is ignored.

custom:   Client-owned zone (e.g. client-a.co.za). Controller emits
          Issuer + DomainClaim + DomainMapping + Certificate. HTTP01 ACME
          challenge via the nginx solver in the tenant namespace.

All failures surface as errors. Resolution never panics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResolvedDomain

type ResolvedDomain struct {
	Domain *networksv1alpha1.Domain
	Spec   *ResolvedDomainSpec
}

ResolvedDomain pairs the original Kubernetes Domain object with its fully decoded and validated spec.

func ResolveDomain

func ResolveDomain(domain *networksv1alpha1.Domain) (*ResolvedDomain, error)

ResolveDomain decodes and validates the raw JSON contract from the Domain CR spec into a ResolvedDomain. Returns an error if the CR is nil, the contract is absent, or any required field is missing or malformed.

type ResolvedDomainMTLS

type ResolvedDomainMTLS struct {
	// Enforced is true when blanketops-proxy + blanketK mTLS is active.
	Enforced bool
}

ResolvedDomainMTLS carries the resolved mTLS configuration.

type ResolvedDomainRouteRef

type ResolvedDomainRouteRef struct {
	// Name is the Route CR name in the same namespace as this Domain.
	Name string
}

ResolvedDomainRouteRef is the resolved Route reference.

type ResolvedDomainSpec

type ResolvedDomainSpec struct {
	// Host is the FQDN this domain assignment covers.
	Host string

	// RouteRef identifies the Route CR in the same namespace that owns this Domain.
	RouteRef ResolvedDomainRouteRef

	// TLSStrategy is the cert provisioning path (platform | custom).
	// Mandatory — the downstream cert and DomainMapping logic branches on this.
	TLSStrategy *TLSStrategy

	// MTLS carries inter-service mTLS configuration for this domain.
	// Absent or not enforced means plain TLS only.
	MTLS ResolvedDomainMTLS

	// RenewBefore is the cert renewal window (e.g. "720h").
	// Applies to custom strategy only — empty means cert-manager default.
	RenewBefore string
}

ResolvedDomainSpec is the decoded and validated Domain spec. Fields mirror the proto DomainSpec — consumers must not re-read from the raw CR.

type TLSStrategy

type TLSStrategy string

TLSStrategy identifies the cert provisioning path for a Domain. Corresponds to blanketops.common.v1.DomainTLSStrategy in the proto contract.

const (
	// TLSStrategyPlatform uses the platform wildcard cert.
	// DNS01 ClusterIssuer already issued — DomainClaim + DomainMapping only.
	TLSStrategyPlatform TLSStrategy = "platform"

	// TLSStrategyCustom targets a client-owned zone.
	// Controller emits Issuer + DomainClaim + DomainMapping + Certificate.
	TLSStrategyCustom TLSStrategy = "custom"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL