Documentation
¶
Overview ¶
registry/extra.go
registry/load.go
registry/support.go
registry/types.go
registry/validate.go
Index ¶
- Constants
- Variables
- func ClaimConflicts(addons []AddOn) []error
- func IsProviderBuild(repo string) bool
- func MergeConflicts(base, extra []AddOn) []error
- func PathMatches(path, matcher string) bool
- func SplitTagPattern(matcher string) (path, tagPattern string)
- func TagMatches(tag, pattern string) bool
- func Validate(a AddOn) []error
- func ValidateProvider(p ProviderSupport) []error
- type AddOn
- type Compat
- type ComponentImage
- type ComponentLine
- type Cycle
- type CycleEOL
- type Matchers
- type Pricing
- type ProviderSupport
- type Support
- type SupportWindow
Constants ¶
const AnyPrefix = "*/"
AnyPrefix marks an image matcher that opts into matching its final segment under any registry host or prefix: "*/etcd" is etcd, bare or behind a kubeadm imageRepository, a Harbor proxy cache or any other mirror. It is for a distinctive name only; validateImageMatcher refuses generic ones.
const ProviderSchemaVersion = 1
ProviderSchemaVersion is the only managed-provider schema version this build understands.
const SchemaVersion = 2
SchemaVersion is the only registry schema version this build understands. Version 2 added per-release-line cycles, runtime matchers, host-less image path matchers and single-bound compat rows.
Variables ¶
var ProviderBuildPrefixes = []string{
"gke.gcr.io/",
"gcr.io/gke-release/",
"mcr.microsoft.com/",
}
ProviderBuildPrefixes are where managed Kubernetes providers publish their own builds of open-source add-ons: GKE (network policy, Dataplane V2) and AKS (Calico, Azure CNI powered by Cilium, the Istio, KEDA and application routing add-ons). Those builds follow the provider's support policy, not upstream's, so judging them by an upstream entry raises false EOL blockers (#18). Host-less matchers therefore never claim them; an entry for a provider build names its location in a host-qualified matcher ("mcr.microsoft.com/oss/kubernetes/ingress/nginx-ingress-controller").
var ProviderIDs = []string{"eks", "gke", "aks"}
ProviderIDs are the managed Kubernetes providers the dataset covers, as inventory.Provider names them.
Functions ¶
func ClaimConflicts ¶ added in v0.2.0
ClaimConflicts returns one error for each image repository or chart that two entries both claim. The embedded registry has none (tested); this guards operator-supplied entries (--registry-dir), which would otherwise make one image judged by two entries, with a false blocker when the operator's entry is the wrong one. An extra entry takes over an embedded entry's matchers by replacing it under the same id. MergeConflicts is the check for operator entries: the same errors, each with the fix that suits it.
func IsProviderBuild ¶ added in v0.2.0
IsProviderBuild reports whether a normalised "host/path" repository, or a matcher, lies under a provider prefix, directly or through a mirror that keeps the provider location in its path ("harbor.example/mcr.microsoft.com/oss/calico/node").
func MergeConflicts ¶ added in v0.2.0
MergeConflicts returns the claim conflicts of Merge(base, extra), each with the fix that suits it. An extra entry of a new id that claims an embedded entry's image should replace that entry instead, by its id. An extra entry that replaces an embedded one, yet claims an image or chart the embedded registry gives to another entry, is nearly always a copy of the embedded file from an earlier release, taken before that claim moved: a copy of rke2-ingress-nginx.yaml from before #265 claims every rancher/nginx-ingress-controller build, RKE1's included, which ingress-nginx claims now. Its fix is a fresh copy of the current file with the edits re-applied, not a replacement of the other entry too.
func PathMatches ¶ added in v0.2.0
PathMatches reports whether a normalised repository path is claimed by an image matcher. A matcher of two or more segments is a suffix on whole segments, so "ingress-nginx/controller" matches the canonical path and every mirror or pull-through-cache path that keeps it ("registry-k8s-io/ingress-nginx/controller"). A one-segment matcher is the repository itself, exactly: a bare "controller" or "operator" never claims another product's repository of that name. A matcher written "*/name" (AnyPrefix) is the explicit opt-in to the suffix match on that one segment.
func SplitTagPattern ¶ added in v0.2.0
SplitTagPattern splits an image matcher into its repository path and its tag pattern, "" when it has none: "rancher/nginx-ingress-controller:*-hardened*" is the path rancher/nginx-ingress-controller and the pattern "*-hardened*". A tag pattern tells apart builds of different products that one repository publishes and only their tags name (RKE2's "-hardenedN" and RKE1's "-rancherN" builds of ingress-nginx, #265).
func TagMatches ¶ added in v0.2.0
TagMatches reports whether an image tag matches a tag pattern, in which "*" stands for any run of characters: "*-hardened*" matches "v1.12.6-hardened1" and "nginx-1.9.4-hardened1". An image without a tag matches no pattern.
func Validate ¶
Validate checks one AddOn against the schema_version 2 rules and returns every violation (empty slice means valid).
func ValidateProvider ¶ added in v0.2.0
func ValidateProvider(p ProviderSupport) []error
ValidateProvider checks one ProviderSupport against the schema_version 1 rules and returns every violation (empty means valid).
Types ¶
type AddOn ¶
type AddOn struct {
SchemaVersion int `json:"schema_version" yaml:"schema_version"` // 2
ID string `json:"id" yaml:"id"`
DisplayName string `json:"display_name" yaml:"display_name"`
Matchers Matchers `json:"matchers" yaml:"matchers"`
// Support is the product-level verdict. status "eol" is reserved for a
// whole product that upstream retired (ingress-nginx); per-version end of
// life lives in Cycles.
Support Support `json:"support" yaml:"support"`
// Cycles are the add-on's release lines, keyed on the APP version (never
// a Helm chart version), newest first. Entries with endoflife_product
// have them generated by tools/eol-sync.
Cycles []Cycle `json:"cycles,omitempty" yaml:"cycles,omitempty"`
Compat []Compat `json:"compat,omitempty" yaml:"compat,omitempty"`
Recommendation string `json:"recommendation,omitempty" yaml:"recommendation,omitempty"`
// EndoflifeProduct, when set, is the endoflife.date product slug for
// this add-on (https://endoflife.date/api/<slug>.json). Entries that
// carry it have Cycles kept in sync by tools/eol-sync; hand-curated
// entries leave it empty.
EndoflifeProduct string `json:"endoflife_product,omitempty" yaml:"endoflife_product,omitempty"`
}
AddOn is one entry in the add-on EOL/compatibility registry (schema_version 2).
func Load ¶
Load parses and validates every embedded registry entry. Entries are returned sorted by ID; any parse/validation error or duplicate ID fails the whole load.
func LoadExtra ¶ added in v0.2.0
LoadExtra parses and validates operator-supplied registry entries: one <id>.yaml file, or every *.yaml file of a directory, each under the same rules as an embedded entry (schema, citations, id = file name). An error names the file it is about. A path that yields no entry is an error, not "nothing extra": an unmounted ConfigMap would otherwise leave the operator's add-ons silently unjudged.
type Compat ¶
type Compat struct {
Range string `json:"range" yaml:"range"` // semver constraint, e.g. ">=4.0.0"
K8sMin string `json:"k8s_min,omitempty" yaml:"k8s_min,omitempty"` // "1.21"
K8sMax string `json:"k8s_max,omitempty" yaml:"k8s_max,omitempty"` // "1.36" (inclusive)
Citations []string `json:"citations" yaml:"citations"`
}
Compat maps an app version range to a supported K8s range. At least one bound is required; a missing bound is open.
type ComponentImage ¶ added in v0.2.0
type ComponentImage struct {
Image string `json:"image" yaml:"image"` // a path-only image matcher
Lines []ComponentLine `json:"lines" yaml:"lines"`
Citations []string `json:"citations" yaml:"citations"` // where the mapping is published
}
ComponentImage is an image of one part of a product that is versioned on its own: Flux's source-controller v1.5 ships in Flux 2.5, its helm-controller v1.2 too. The image's release line (major.minor of the tag) is mapped to the product's through Lines; a line Lines does not list gives no version, never a guess.
func (ComponentImage) ProductLine ¶ added in v0.2.0
func (c ComponentImage) ProductLine(version string) string
ProductLine returns the product release line that ships version, a version read from the component image's tag ("1.2.0" → "2.5"), or "" when Lines does not list its line.
type ComponentLine ¶ added in v0.2.0
type ComponentLine struct {
Component string `json:"component" yaml:"component"` // MAJOR.MINOR of the image tag
Product string `json:"product" yaml:"product"` // the product's release line
}
ComponentLine maps one release line of a component image to the product release line that ships it.
func (*ComponentLine) UnmarshalJSON ¶ added in v0.2.0
func (l *ComponentLine) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes a line strictly, for the reason Cycle does: an unquoted 1.10 would otherwise be read as "1.1", another release line.
type Cycle ¶ added in v0.2.0
type Cycle struct {
Cycle string `json:"cycle" yaml:"cycle"` // leading components of the app version: "1.31"
EOL *CycleEOL `json:"eol" yaml:"eol"` // required
K8sMin string `json:"k8s_min,omitempty" yaml:"k8s_min,omitempty"`
K8sMax string `json:"k8s_max,omitempty" yaml:"k8s_max,omitempty"` // inclusive
Citations []string `json:"citations" yaml:"citations"`
}
Cycle is one release line of an add-on, e.g. Istio "1.31".
func (*Cycle) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON decodes a cycle strictly. Being a json.Unmarshaler also stops sigs.k8s.io/yaml from coercing unquoted numbers into the string fields, which reads `cycle: 1.10` as "1.1" (another release line) and `k8s_max: 1.30` as "1.3"; an unquoted version now fails the load.
type CycleEOL ¶ added in v0.2.0
type CycleEOL struct {
Date string // set when a date is published
Ended bool // meaningful only when Date is empty
}
CycleEOL is a cycle's end of life as endoflife.date publishes it: a "YYYY-MM-DD" date, or a boolean — true means ended on an unpublished date, false means no end announced.
func (CycleEOL) MarshalJSON ¶ added in v0.2.0
func (*CycleEOL) UnmarshalJSON ¶ added in v0.2.0
type Matchers ¶
type Matchers struct {
// Images are repository paths without the registry host, matched as a
// suffix on whole path segments: "ingress-nginx/controller" matches
// registry.k8s.io/ingress-nginx/controller, k8s.gcr.io/ingress-nginx/controller
// and mirror/ingress-nginx/controller. The version is read from the tag.
// They never match a provider build (ProviderBuildPrefixes); an entry
// for one names it with its host instead. A matcher may end in a tag
// pattern ("rancher/nginx-ingress-controller:*-hardened*", see
// SplitTagPattern): it then claims only the tags the pattern matches,
// ahead of another entry's path-only matcher of that repository.
Images []string `json:"images,omitempty" yaml:"images,omitempty"`
Charts []string `json:"charts,omitempty" yaml:"charts,omitempty"` // exact chart name; version = the release's appVersion
// Runtimes are node container runtime names, the scheme of
// node.status.nodeInfo.containerRuntimeVersion ("containerd" in
// "containerd://1.7.27").
Runtimes []string `json:"runtimes,omitempty" yaml:"runtimes,omitempty"`
// Components are images of the product's parts that carry their own
// version, not the product's (Flux's controllers): each maps its
// release lines to the product release line that ships them.
Components []ComponentImage `json:"components,omitempty" yaml:"components,omitempty"`
}
type Pricing ¶ added in v0.2.0
type Pricing struct {
Currency string `json:"currency" yaml:"currency"` // "USD"
StandardPerClusterHour float64 `json:"standard_per_cluster_hour" yaml:"standard_per_cluster_hour"`
// ExtendedPerClusterHour is the whole price while in extended support,
// the standard fee included (EKS: 0.60 = 0.10 + 0.50).
ExtendedPerClusterHour float64 `json:"extended_per_cluster_hour" yaml:"extended_per_cluster_hour"`
AsOf string `json:"as_of" yaml:"as_of"` // YYYY-MM-DD the page was read
// Note is a caveat on whom the price applies to, shown with the cost.
Note string `json:"note,omitempty" yaml:"note,omitempty"`
Citations []string `json:"citations" yaml:"citations"`
}
Pricing is a provider's published control-plane price in USD per cluster hour. It is a list price: it varies by contract, and a provider may change it, so every use states AsOf.
type ProviderSupport ¶ added in v0.2.0
type ProviderSupport struct {
SchemaVersion int `json:"schema_version" yaml:"schema_version"` // 1
ID string `json:"id" yaml:"id"` // one of ProviderIDs, = file name
DisplayName string `json:"display_name" yaml:"display_name"`
// EndoflifeProduct, when set, is the endoflife.date slug the Versions
// are generated from by tools/eol-sync. Hand-curated entries (GKE,
// whose extended-support end endoflife.date does not publish) leave it
// empty.
EndoflifeProduct string `json:"endoflife_product,omitempty" yaml:"endoflife_product,omitempty"`
// ExtendedSupportNote says in a sentence what extended support means
// at this provider, for the finding that names it (GKE bills it only
// for clusters on its Extended release channel; AKS has no automatic
// extended support, only an opt-in Long Term Support plan).
ExtendedSupportNote string `json:"extended_support_note,omitempty" yaml:"extended_support_note,omitempty"`
// ExtendedSupportCondition is set where extended support is not
// automatic: the configuration a cluster must have for the extended
// window to apply to it, as a clause that completes "only if ..." (GKE:
// "the cluster is on the Extended release channel"; AKS: "Long Term
// Support is enabled"). The collector cannot see it, so findings for
// the provider state the window conditionally instead of asserting
// that this cluster is in it. Empty for EKS, where extended support is
// the default.
ExtendedSupportCondition string `json:"extended_support_condition,omitempty" yaml:"extended_support_condition,omitempty"`
// Citations are the pages the Versions dates come from.
Citations []string `json:"citations" yaml:"citations"`
// Versions are the provider's Kubernetes minors, newest first. When
// endoflife_product is set tools/eol-sync owns this block.
Versions []SupportWindow `json:"versions" yaml:"versions"`
// Pricing is hand-entered from the provider's own pricing page; a
// provider without a price stated unambiguously leaves it out, and no
// cost is then reported for it.
Pricing *Pricing `json:"pricing,omitempty" yaml:"pricing,omitempty"`
}
ProviderSupport is one managed Kubernetes provider's support calendar: when each Kubernetes minor leaves standard support and when extended support ends, and what extended support costs where the provider publishes a price. It is a dataset of its own beside the add-on entries: those describe software a cluster runs, this describes the service the control plane is bought from.
func LoadProviders ¶ added in v0.2.0
func LoadProviders() ([]ProviderSupport, error)
LoadProviders parses and validates every embedded provider entry, sorted by ID. Any parse or validation error fails the whole load.
type Support ¶
type Support struct {
Status string `json:"status" yaml:"status"` // "supported" | "eol" | "unknown"
EOLDate string `json:"eol_date,omitempty" yaml:"eol_date,omitempty"` // RFC3339 date "2026-03-24"
// ExtendedEOLDate and ExtendedSupportCondition describe split support:
// support ends for everyone on EOLDate and continues until
// ExtendedEOLDate only if ExtendedSupportCondition holds (a bare clause
// completing "only if ...", such as a vendor subscription), which the
// collector cannot see. Both or neither; they need EOLDate and status
// supported.
ExtendedEOLDate string `json:"extended_eol_date,omitempty" yaml:"extended_eol_date,omitempty"`
ExtendedSupportCondition string `json:"extended_support_condition,omitempty" yaml:"extended_support_condition,omitempty"`
Citations []string `json:"citations" yaml:"citations"` // ≥1 required when status != unknown
}
type SupportWindow ¶ added in v0.2.0
type SupportWindow struct {
Minor string `json:"minor" yaml:"minor"` // "1.34"
StandardEnd string `json:"standard_end" yaml:"standard_end"`
ExtendedEnd string `json:"extended_end,omitempty" yaml:"extended_end,omitempty"`
}
SupportWindow is one Kubernetes minor's support calendar at a provider. Both dates are the day the phase ends: the minor is in standard support before StandardEnd, in extended support from StandardEnd until ExtendedEnd (the day the provider upgrades the cluster or stops supporting it), and out of support from ExtendedEnd. An empty ExtendedEnd means the provider offered no extended support for the minor.
func (*SupportWindow) UnmarshalJSON ¶ added in v0.2.0
func (w *SupportWindow) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes a window strictly, and refuses an unquoted minor (YAML reads 1.30 as the number 1.3, another minor).