Documentation
¶
Index ¶
- Variables
- func CleanUp(cachePath string)
- func ExpandUninstallsWithUpdaters(uninstalls []string, index map[string][]string) []string
- func InstalledReferentUpdaters(catalogsMap map[int]map[string]catalog.Item, index map[string][]string, ...) []string
- func Installs(installs []string, catalogsMap map[int]map[string]catalog.Item, ...)
- func Manifests(manifests []manifest.Item, catalogsMap map[int]map[string]catalog.Item) (installs, uninstalls, updates []string)
- func PruneSelfServeUninstalls(selfServe *manifest.Item, catalogsMap map[int]map[string]catalog.Item, ...) (changed bool)
- func ReconcileSelfServe(selfServe *manifest.Item, manifests []manifest.Item) (installs, uninstalls []string, changed bool)
- func ResolveItem(itemName string, catalogsMap map[int]map[string]catalog.Item) (catalog.Item, error)
- func ResolveRemoval(itemName string, catalogsMap map[int]map[string]catalog.Item) (catalog.Item, error)
- func Uninstalls(uninstalls []string, catalogsMap map[int]map[string]catalog.Item, ...)
- func UpdaterIndex(catalogsMap map[int]map[string]catalog.Item) map[string][]string
- func Updates(updates []string, catalogsMap map[int]map[string]catalog.Item, ...)
- func WarnZipOnly(itemName, reason string)
- func ZipOnlyReason(item catalog.Item) string
Constants ¶
This section is empty.
Variables ¶
var ErrNotInstallable = errors.New("not installable on this machine")
ErrNotInstallable means every valid occurrence of an item has an installable_condition this machine fails.
var ErrZipOnly = errors.New("rejected by this zip-only build")
ErrZipOnly means every occurrence of an item was rejected by a zip-only build (ZipOnlyReason).
Functions ¶
func CleanUp ¶
func CleanUp(cachePath string)
CleanUp checks the age of items in the cache and removes if older than 10 days
func ExpandUninstallsWithUpdaters ¶
ExpandUninstallsWithUpdaters transitively appends the updaters of every removed item so updaters are removed with their referent (R7). Original order is preserved with expansions appended; a visited set makes it cycle-safe.
func InstalledReferentUpdaters ¶
func InstalledReferentUpdaters(catalogsMap map[int]map[string]catalog.Item, index map[string][]string, installsSet map[string]bool, checker *status.Checker, cachePath string) []string
InstalledReferentUpdaters returns the updaters of referents that are merely installed on disk (not being installed this run), so they ride along as installs (R7). installsSet is the set of names already being installed this run; those referents are handled by the in-walk expansion in installWithDeps. Referents that do not resolve are skipped; a status-check error warns and skips. Script-check referents do run their check script here — the run context is where scripts are expected to execute.
func Installs ¶
func Installs(installs []string, catalogsMap map[int]map[string]catalog.Item, r *installer.Runner, index map[string][]string)
Installs prepares and then installs an array of items with their dependencies resolved recursively (K4, spec R6). index maps referent names to their update_for updaters so updaters ride along after their referent (R7).
func Manifests ¶
func Manifests(manifests []manifest.Item, catalogsMap map[int]map[string]catalog.Item) (installs, uninstalls, updates []string)
Manifests iterates though the first manifest and any included manifests. It drops names with no valid catalog item. Whether this machine may install an item is decided where the run acts on it, so the inventory can say why one was skipped.
func PruneSelfServeUninstalls ¶
func PruneSelfServeUninstalls(selfServe *manifest.Item, catalogsMap map[int]map[string]catalog.Item, checker *status.Checker, cachePath string) (changed bool)
PruneSelfServeUninstalls drops managed_uninstalls entries whose software is confirmed gone so the user can reinstall later (R5). An entry that no longer resolves to a catalog item is kept (the catalog may return); a still-installed item is kept and retried next run. A dropped entry's removal is complete, so its selected_by entry goes too: the next user to select it becomes its selector (R32a). Returns whether the file needs saving.
func ReconcileSelfServe ¶
func ReconcileSelfServe(selfServe *manifest.Item, manifests []manifest.Item) (installs, uninstalls []string, changed bool)
ReconcileSelfServe reconciles the self-serve manifest against the admin manifests and returns the authorized installs and the pass-through uninstalls to feed into the run. It mutates selfServe in place for the once-only default state machine and reports whether the file needs saving.
Authorization set is the union of every manifest's optional_installs only. As in Munki, a default_installs name only asserts intent into the self-serve file (analyze.py:747-748); it must also be offered in optional_installs to actually install, since installation flows exclusively through the self-serve managed_installs filtered against available optional installs (core.py:264-278). A default-only name is recorded but filtered out of the returned installs.
func ResolveItem ¶
func ResolveItem(itemName string, catalogsMap map[int]map[string]catalog.Item) (catalog.Item, error)
ResolveItem returns the catalog item the run installs for itemName (the first valid occurrence this machine may install, as firstItem picks it) without logging. Callers that only report on items use it so they agree with the run. The error wraps ErrNotInstallable when only an installable_condition stands in the way.
func ResolveRemoval ¶ added in v1.11.0
func ResolveRemoval(itemName string, catalogsMap map[int]map[string]catalog.Item) (catalog.Item, error)
ResolveRemoval is ResolveItem for an item the run removes, as removalItem picks it.
func Uninstalls ¶
func Uninstalls(uninstalls []string, catalogsMap map[int]map[string]catalog.Item, r *installer.Runner)
Uninstalls prepares and then installs an array of items
func UpdaterIndex ¶
UpdaterIndex maps a referent item name to the names of items that declare update_for it (its updaters). Catalogs are iterated in index order (sorted keys, like firstItem) and updater names are deduped first-catalog-wins.
ponytail: plain-name matching only — Munki's version-specific updater names (e.g. "Firefox-60.0") are not supported. Upgrade path: when a real catalog needs them, parse the version suffix here and gate updaters on the resolved referent version.
func WarnZipOnly ¶ added in v1.11.0
func WarnZipOnly(itemName, reason string)
WarnZipOnly logs, once per item and reason for the life of the process, that a zip-only build rejected the item.
func ZipOnlyReason ¶ added in v1.11.0
ZipOnlyReason says why a zip-only build must not offer, install or remove item, or returns "" when it may (always, in a stock build). Such a build has no command installer and runs no catalog script, so it rejects any item that needs one: a non-zip installer.type, a set uninstaller.type other than zip, or any install, uninstall or check script. Admin fact scripts (pkg/facts) are not catalog scripts and still run.
Types ¶
This section is empty.