Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOnInstance ¶
type Capability ¶
type Capability string
const ( CapAPIUsage Capability = "api-usage" CapDeprecatedCalls Capability = "deprecated-calls" CapHelm Capability = "helm" CapAddOns Capability = "addons" CapVersions Capability = "versions" )
type CapabilityStatus ¶
type ComponentVersion ¶
type ComponentVersion struct {
Component string `json:"component"` // e.g. "kube-apiserver"
Version string `json:"version"` // raw image tag, e.g. "v1.34.2"; always ParseVersion-able
}
ComponentVersion is one observed control-plane component version, detected from kube-system pod image tags (kube-apiserver, kube-controller-manager, kube-scheduler, kube-proxy). The list is (Component, Version)-deduped and sorted; managed control planes (EKS/GKE) expose no such pods, so the slice is empty there.
type DeprecatedCall ¶
type HelmRelease ¶
type Inventory ¶
type Inventory struct {
SchemaVersion int `json:"schemaVersion"` // 1
ClusterID string `json:"clusterId"` // kube-system ns UID, or "files"
CollectedAt time.Time `json:"collectedAt"`
ServerVersion string `json:"serverVersion,omitempty"` // raw, e.g. "v1.34.2"
Capabilities map[Capability]CapabilityStatus `json:"capabilities"`
APIUsage []APIUsage `json:"apiUsage,omitempty"`
DeprecatedCalls []DeprecatedCall `json:"deprecatedCalls,omitempty"`
HelmReleases []HelmRelease `json:"helmReleases,omitempty"`
AddOns []AddOnInstance `json:"addOns,omitempty"`
Nodes []NodeInfo `json:"nodes,omitempty"`
ControlPlane []ComponentVersion `json:"controlPlane,omitempty"`
Namespaces []NamespaceInfo `json:"namespaces,omitempty"`
UnrecognizedImages []string `json:"unrecognizedImages,omitempty"` // deduped, sorted, cap 200
}
type NamespaceInfo ¶
type Version ¶
type Version struct{ Major, Minor int }
Version is a Kubernetes minor version (e.g. 1.34). Patch is ignored for evaluation.
func ParseVersion ¶
ParseVersion parses a Kubernetes version string. Accepted forms: "1.34", "v1.34", "v1.34.2", "1.34.2". The patch component is validated but discarded — evaluation only cares about minors.
func (Version) MarshalJSON ¶
MarshalJSON emits the canonical wire form, a string like "1.38" — matching String() and the camelCase report contract.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON accepts the canonical string form ("1.38", anything ParseVersion takes) and, for back-compat with datasets written before the string form existed, the legacy object form {"Major":1,"Minor":38} (strict: unknown keys rejected).