Documentation
¶
Overview ¶
Package deploy is the Go port of the domain artifact deployment (.lok8s/libs/deploy: deploy::apply / deploy::apply_filtered / deploy::_apply / deploy::wait_crds — bash wins on any divergence; the `lo destroy` half of that file stays with the provision port).
Applies the single clusters/<domain>/artifacts.yaml produced by `lo build`: CRDs first (server-side apply + wait Established), then the rest (server-side apply + scoped wait-ready). ApplyFiltered deploys only the subset carrying one label. Workload-plane ordering is intentionally not a framework primitive: kubectl handles in-manifest order, Tilt handles runtime deps at the resource level, cluster-infra ordering lives in cluster.spec.bootstrap.
Every kubectl runs through the kapply.Applier (the ported kapply::apply / kapply::wait_ready) against the AMBIENT KUBECONFIG — the caller resolves it (build.ResolveKubeconfigForDomain: a deploy domain follows its clusterRef); no --kubeconfig flag is threaded, exactly like the bash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrHandled = ui.ErrHandled // one sentinel for every package; see internal/ui
ErrHandled marks a failure whose [error] line was already printed.
Functions ¶
func HasObjects ¶
HasObjects reports whether a YAML stream contains at least one kubernetes object (bash: deploy::_has_objects). Empty streams (zero docs, comments only, whitespace, or only `---` separators) report false — used to skip `kubectl apply` gracefully, which fails with "error: no objects passed to apply" on an empty stream (a label-filtered subset that excludes everything is a legitimate workflow).
func ParseLabel ¶
ParseLabel splits the -l/--label value into key and value (bash: main::deploy's ${label%%=*} / ${label#*=} guard). Prints the [error] line and returns ErrHandled on a missing '=', an empty key or an empty value.
Types ¶
type Deployer ¶
type Deployer struct {
Paths *config.Paths
Applier *kapply.Applier
// Stderr receives the [error]/[warn]/[debug] lines (default os.Stderr).
Stderr io.Writer
}
Deployer runs the apply phases. Applier carries the runner + writers.
func (*Deployer) Apply ¶
Apply applies the domain's single artifact (bash: deploy::apply). Bash's errexit is ACTIVE on this path: the first failing kubectl apply exits the whole `lo` with kubectl's status — returned here as *ExitError.
func (*Deployer) ApplyFiltered ¶
ApplyFiltered applies only the resources in the domain artifact carrying <labelKey>=<labelValue> (bash: deploy::apply_filtered). The key is used verbatim: a bare key (app) or a namespaced one (lok8s.dev/name). Selective deploy is user opt-in — it requires kustomize `labels:` (or metadata.labels) on the targets to address.
Bash runs the subset apply as `deploy::_apply … || rc=$?`, which SUSPENDS errexit inside it: a failing kubectl apply there is logged and the phase sequence continues, and the function's status is the scoped wait's (always 0). Reproduced as-is — bash wins — see the package README note in the port report.