Documentation
¶
Overview ¶
Package gitops is the on-disk desired-state tree: lib/ profiles, blueprint manifests, and the committed baseline. Config identity = the config `name` (which is the .mobileconfig filename, matching how the console names uploads).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlueprintSpec ¶
type BlueprintSpec struct {
Name string `yaml:"name"`
ID string `yaml:"id,omitempty"`
Description string `yaml:"description,omitempty"`
Configurations []string `yaml:"configurations"`
}
BlueprintSpec is the git desired-state for one blueprint: its identity and the set of configuration names attached to it. Device/user/group membership is NOT tracked here — identity is API-read-only (console/federation-managed), so a blueprint's members live in the console, not in git.
type Tree ¶
type Tree struct {
Root string
LibDir string
StateFile string
BlueprintsDir string
ArchiveDir string
}
Tree is the on-disk desired-state layout rooted at <envDir>/gitops.
func (*Tree) LoadBlueprints ¶
func (t *Tree) LoadBlueprints() (map[string]BlueprintSpec, error)
LoadBlueprints reads blueprints/*.yml → blueprint name → spec. A malformed file is a hard error (so a typo can't silently drop a blueprint from the plan).
func (*Tree) LoadDesired ¶
LoadDesired reads lib/*.mobileconfig → name → content.
func (*Tree) RemoveConfig ¶
RemoveConfig deletes a profile from lib/ (used when a config was removed from ABM → the git file is pruned). A missing file is not an error (idempotent).
func (*Tree) WriteBlueprintSpec ¶
func (t *Tree) WriteBlueprintSpec(s BlueprintSpec) error
WriteBlueprintSpec marshals a spec to blueprints/<slug>.yml. The filename slug is derived from the name (falling back to the id when the name has no slug-safe characters), and collisions are disambiguated with a numeric suffix so two distinct blueprints whose names sanitize to the same slug never overwrite each other. Re-writing the same blueprint (matched by name) reuses its file.