crdcheck

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package crdcheck lets the agent and the operator refuse to start against CRDs that are older than they are. helm does not update the crds/ directory, so a release upgraded without `kubectl apply` leaves the API server pruning the new fields; for the enrollment epoch that means a token burnt for nothing. The check reads the published OpenAPI schema of the laboratory group (no extra permission: discovery is open to every authenticated client) and looks for the fields the binary needs.

Index

Constants

This section is empty.

Variables

View Source
var Required = []struct{ Field, On string }{
	{"certificateEpoch", "Tenant.status"},
}

Required are the schema fields that came with this version (a JSON property name each, and the object it belongs to for the message).

Functions

func Verify

func Verify(ctx context.Context, fetch Fetch) error

Verify returns an error that names every missing field and says what to do.

func Wait

func Wait(ctx context.Context, fetch Fetch, timeout time.Duration, log func(error)) error

Wait retries Verify for up to timeout (the schema of a CRD applied a moment ago takes a few seconds to be published).

Types

type Fetch

type Fetch func(context.Context) ([]byte, error)

Fetch returns the OpenAPI v3 document of the laboratory group.

func FromDiscovery

func FromDiscovery(d discovery.DiscoveryInterface) Fetch

FromDiscovery reads the document through the discovery client.

Jump to

Keyboard shortcuts

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