crds

package
v0.0.0-...-c5f7cd3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package crds embeds the upstream Gateway API and Envoy Gateway CRD bundles and applies them via server-side apply, replacing the `kubectl apply -f https://...` step that the dev driver used to run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(ctx context.Context, cfg *rest.Config, opts InstallOptions) error

Install applies the embedded Gateway API and Envoy Gateway CRD bundles against the cluster reachable via cfg. Idempotent. Must be called before any controller-runtime informer that watches these types starts its cache, otherwise the informer fails on missing REST mapping.

func Manifests

func Manifests() ([][]byte, error)

Manifests returns the embedded Gateway API + Envoy Gateway CRD documents as individual YAML byte slices, in apply order (Gateway API first), with the comment-only/empty leading documents skipped. It is the read-only counterpart to Install: `clrk install --dry-run -o yaml` emits these alongside the control-plane objects so the rendered set is the full manifest the apply path would lay down. Each returned doc is the upstream YAML (trimmed of surrounding whitespace), asserted to be a CustomResourceDefinition; the caller may further normalize it (the renderer strips serializer-noise lines for stream consistency).

Types

type InstallOptions

type InstallOptions struct {
	// Mode selects the apply policy. Defaults to ModeAlways.
	Mode Mode
	// FieldManager identifies clrk's field-ownership in managed-fields.
	// Defaults to "clrk-controller-manager".
	FieldManager string
}

InstallOptions controls Install.

type Mode

type Mode int

Mode controls how Install handles CRDs already present in the cluster.

const (
	// ModeAlways force-applies every embedded CRD, taking field
	// ownership from any prior applier. Default for `clrk dev` where
	// the cluster is ours.
	ModeAlways Mode = iota
	// ModeIfMissing applies only CRDs that don't yet exist. Lets a
	// coexisting tenant own their copy of the same CRD.
	ModeIfMissing
	// ModeSkip is a no-op. Escape hatch for clusters where someone
	// else owns CRD lifecycle.
	ModeSkip
)

Jump to

Keyboard shortcuts

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