manifest

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand added in v1.11.0

func Expand(manifests []Item, facts conditions.Facts) (effective []Item, held []Held)

Expand resolves every manifest's conditional_items against facts. A true block's lists join its manifest's plain lists, so callers read only Installs, OptionalInstalls and the rest; a false block, or one whose condition cannot be evaluated, adds nothing; an unknown block is returned in held instead. The effective manifests carry no conditional_items. Every reader of manifest lists, the managed run and the service alike, must read Expand's output, or the list call and the run disagree.

func GetCatalogs

func GetCatalogs(cfg config.Configuration) (map[int]map[string]catalog.Item, error)

GetCatalogs returns a map of `catalog.Item` from the catalogs and any fatal catalog-loading error. It lives on the agent side so pkg/catalog stays a dependency-free schema package.

func GetHarnesses added in v1.11.0

func GetHarnesses(cfg config.Configuration) (harness.Table, error)

GetHarnesses fetches and parses <url>harnesses.yaml, the repository's placement table. A repository without one (404) has an empty table: items that are not zip items do not need it, and zip items then fail because no placement is defined. Any other fetch or parse error fails like a catalog fetch error.

func SaveSelfServe

func SaveSelfServe(path string, entry Item) error

SaveSelfServe persists the self-serve manifest at path. It keeps the three self-serve lists (managed_installs, managed_uninstalls, default_installs) and the selected_by record, and drops includes/catalogs/updates/conditional_items, which the self-serve file never owns.

func SelfServePath

func SelfServePath(appDataPath string) string

SelfServePath returns the path to the self-serve manifest under appDataPath.

func UpdateSelfServe

func UpdateSelfServe(path string, fn func(*Item) bool) error

UpdateSelfServe loads the self-serve manifest at path, lets fn change it, and saves it when fn reports a change, all under one in-process lock. CEILING: the lock is per process. The service owns the file and runs every managed run in-process; a separate `sofcat` CLI run racing the service could still lose a write. Upgrade to a file lock if both ever write concurrently.

Types

type ConditionalItem added in v1.11.0

type ConditionalItem struct {
	Condition        string            `yaml:"condition"`
	Installs         []string          `yaml:"managed_installs"`
	OptionalInstalls []string          `yaml:"optional_installs"`
	DefaultInstalls  []string          `yaml:"default_installs"`
	Uninstalls       []string          `yaml:"managed_uninstalls"`
	Updates          []string          `yaml:"managed_updates"`
	ConditionalItems []ConditionalItem `yaml:"conditional_items"`
}

ConditionalItem is one conditional_items block: lists that apply only when its condition holds on this machine. Blocks nest.

type Held added in v1.11.0

type Held struct {
	Condition string
	Missing   []string
	Items     []string
}

Held is a conditional_items block whose condition is unknown on this machine: Items, every name under it including nested blocks, are neither added nor removed until Missing facts appear.

type Item

type Item struct {
	Name             string   `yaml:"name"`
	Includes         []string `yaml:"included_manifests"`
	Installs         []string `yaml:"managed_installs"`
	OptionalInstalls []string `yaml:"optional_installs"`
	DefaultInstalls  []string `yaml:"default_installs"`
	Uninstalls       []string `yaml:"managed_uninstalls"`
	Updates          []string `yaml:"managed_updates"`
	Catalogs         []string `yaml:"catalogs"`
	// ConditionalItems is resolved by Expand; read the lists of its output.
	ConditionalItems []ConditionalItem `yaml:"conditional_items,omitempty"`
	// SelectedBy is the self-serve file's record of who selected each item:
	// item name to the caller's ID (a SID, or a uid in decimal). Only the
	// self-serve file has it.
	SelectedBy map[string]string `yaml:"selected_by,omitempty"`
}

Item represents a single object from the manifest

func Get

func Get(cfg config.Configuration) (manifests []Item, newCatalogs []string, err error)

Get returns: 1) All manifest objects 2) Aditional catalogs that need to be added to the config 3) Any retrieval or parse error encountered while loading manifests

func LoadSelfServe

func LoadSelfServe(path string) (Item, error)

LoadSelfServe reads the self-serve manifest at path. A missing file returns a named empty manifest rather than an error.

Jump to

Keyboard shortcuts

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