crds

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package crds carries the CRDs this build expects the cluster to have, and checks at startup that it does.

Helm installs a chart's crds/ directory once and never touches it again on upgrade. That is documented Helm behaviour rather than a bug, but it means `helm upgrade hecate` ships a new controller against the old API — and the API server *prunes* fields it does not recognise rather than rejecting them. The object stores without them, kubectl reports success, and the controller reads a zero value. Nothing anywhere says why (#117).

So the controller refuses to run against an API older than itself. A failed rollout naming the one command that fixes it is worth a great deal more than a Beacon that has quietly stopped honouring one of its fields.

The YAML here is a copy of charts/hecate/crds, made by `make generate`, because go:embed cannot reach outside its own package. `make check` fails if the two drift.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, c client.Reader) error

Check reports whether the cluster's CRDs declare everything this build needs.

One-directional on purpose: it asks whether the cluster is *missing* anything, not whether the two are identical. A cluster running CRDs newer than this binary is fine — the extra fields are simply unread — and failing on that would make every rollback an outage. It also means a cosmetic regeneration (a controller-gen bump rewording descriptions) cannot fail the check, which matters when the consequence is a controller that will not boot.

func Expected

func Expected() (map[string]map[string]bool, error)

Expected is the set of property paths each shipped CRD declares.

Types

type MissingError

type MissingError struct{ Names []string }

MissingError is a CRD that is not installed at all.

func (*MissingError) Error

func (e *MissingError) Error() string

type SkewError

type SkewError struct {
	// Missing is what the cluster's CRDs do not declare, as dotted paths.
	Missing map[string][]string
}

SkewError is a cluster whose CRDs are older than this build.

func (*SkewError) Error

func (e *SkewError) Error() string

Jump to

Keyboard shortcuts

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