collect

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package collect builds an inventory.Inventory from a live cluster (or, in files mode, from rendered manifests). Sub-collectors degrade independently: an error marks the capability unavailable with a reason instead of failing the whole collection (spec §9).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(ctx context.Context, c Clients, k kb.KB, opts Options) inventory.Inventory

Collect builds an Inventory from a live cluster. It never returns an error: each sub-collector failure becomes Capabilities[cap] = {Available: false, Reason: err.Error()} and collection continues.

func CollectFiles

func CollectFiles(dir string) (inventory.Inventory, error)

CollectFiles builds an Inventory from rendered manifests on disk (--files mode, CI gating). Walks *.yaml/*.yml/*.json recursively in lexical order. Only api-usage is assessable offline; every other capability degrades with reason "files mode". Malformed YAML is a hard error: in CI, silently skipping a bad manifest would be a false pass.

func CollectManifests

func CollectManifests(r io.Reader) (inventory.Inventory, error)

CollectManifests builds an Inventory from a single concatenated YAML/JSON manifest stream (the server's CI gate endpoint body). Same semantics as CollectFiles, minus the directory walk.

Types

type Clients

type Clients struct {
	Kube       kubernetes.Interface
	Metadata   metadata.Interface
	Discovery  discovery.DiscoveryInterface
	RESTClient rest.Interface
}

Clients bundles the API clients the live-cluster sub-collectors need. Any nil client degrades the capabilities that depend on it.

func NewClients

func NewClients(cfg *rest.Config) (Clients, error)

NewClients builds the concrete client set from a rest.Config. The sole construction point — everything else consumes the interfaces.

type Options

type Options struct {
	TeamLabel string // namespace label used for team attribution; default "team"
}

Options tunes collection behavior.

Jump to

Keyboard shortcuts

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