Documentation ¶
Overview ¶
Package cli has shared utilities and application logic for the forklift CLI
Index ¶
- func AddDepl(indent int, pallet *forklift.FSPallet, pkgLoader forklift.FSPkgLoader, ...) error
- func AddDeplFeat(indent int, pallet *forklift.FSPallet, pkgLoader forklift.FSPkgLoader, ...) error
- func AddRepoRequirements(indent int, pallet *forklift.FSPallet, cachePath string, repoQueries []string) error
- func ApplyNextOrCurrentBundle(indent int, store *forklift.FSStageStore, bundle *forklift.FSBundle, ...) error
- func BulletedPrint(indent int, a ...any)
- func BulletedPrintYaml(indent int, a any) error
- func BulletedPrintf(indent int, format string, a ...any)
- func BulletedPrintln(indent int, a ...any)
- func CacheAllRequirements(pallet *forklift.FSPallet, repoCachePath string, ...) error
- func CacheStagingRequirements(pallet *forklift.FSPallet, repoCachePath string, ...) error
- func Check(indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader) ([]*forklift.ResolvedDepl, []forklift.SatisfiedDeplDeps, error)
- func CheckArtifactCompatibility(artifactVersion, toolVersion, minArtifactVersion, artifactPath string, ...) error
- func CheckBundleShallowCompatibility(bundle *forklift.FSBundle, toolVersion, bundleMinVersion string, ...) error
- func CheckCompatibility(pallet *forklift.FSPallet, repoLoader forklift.FSRepoLoader, ...) error
- func CheckShallowCompatibility(pallet *forklift.FSPallet, repoLoader forklift.FSRepoLoader, ...) error
- func CloneQueriedGitRepoUsingLocalMirror(indent int, cachePath string, query string, destination string) error
- func DownloadExportFiles(indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader, ...) error
- func DownloadImages(indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader, ...) error
- func DownloadImagesForStoreApply(store *forklift.FSStageStore, toolVersion, bundleMinVersion string, ...) error
- func DownloadLockedGitRepoUsingLocalMirror(indent int, cachePath string, gitRepoPath string, lock forklift.VersionLock) (downloaded bool, err error)
- func DownloadQueriedGitReposUsingLocalMirrors(indent int, cachePath string, queries []string) (resolved map[string]forklift.GitRepoReq, changed map[forklift.GitRepoReq]bool, ...)
- func DownloadRequiredPallets(indent int, pallet *forklift.FSPallet, cachePath string) (changed bool, err error)
- func DownloadRequiredRepos(indent int, pallet *forklift.FSPallet, cachePath string) (changed bool, err error)
- func GetDlCache(wpath string, ensureCache bool) (*forklift.FSDownloadCache, error)
- func GetPalletCache(wpath string, pallet *forklift.FSPallet, ensureCache bool) (*forklift.FSPalletCache, error)
- func GetRepoCache(wpath string, pallet *forklift.FSPallet, ensureCache bool) (*forklift.LayeredRepoCache, *forklift.RepoOverrideCache, error)
- func GetStageStore(workspace *forklift.FSWorkspace, stageStorePath, newStageStoreVersion string) (*forklift.FSStageStore, error)
- func IndentedPrint(indent int, a ...any)
- func IndentedPrintYaml(indent int, a any) error
- func IndentedPrintf(indent int, format string, a ...any)
- func IndentedPrintln(indent int, a ...any)
- func PrintCachedPallet(indent int, cache core.Pather, pallet *forklift.FSPallet) error
- func PrintCachedRepo(indent int, cache core.Pather, repo *core.FSRepo) error
- func PrintDeplInfo(indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, ...) error
- func PrintDeplPkgPath(indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, ...) error
- func PrintDeplSpec(indent int, spec core.PkgDeplSpec)
- func PrintFeatureSpec(indent int, name string, spec core.PkgFeatureSpec)
- func PrintFeatureSpecs(indent int, features map[string]core.PkgFeatureSpec)
- func PrintPalletDepls(indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader) error
- func PrintPalletInfo(indent int, pallet *forklift.FSPallet) error
- func PrintPalletPkgs(indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader) error
- func PrintPalletRepos(indent int, pallet *forklift.FSPallet) error
- func PrintPkg(indent int, cache forklift.PathedRepoCache, pkg *core.FSPkg)
- func PrintPkgInfo(indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, ...) error
- func PrintPkgSpec(indent int, spec core.PkgSpec)
- func PrintReadme(indent int, readme []byte, widthLimit int)
- func PrintRepoInfo(indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, ...) error
- func PrintResolvedDepl(indent int, cache forklift.PathedRepoCache, resolved *forklift.ResolvedDepl) error
- func PrintStagedBundle(indent int, store *forklift.FSStageStore, bundle *forklift.FSBundle, index int, ...)
- func RemoveDeplFeat(indent int, pallet *forklift.FSPallet, deplName string, features []string) error
- func RemoveDepls(indent int, pallet *forklift.FSPallet, deplNames []string) error
- func RemoveRepoRequirements(indent int, pallet *forklift.FSPallet, repoPaths []string, force bool) error
- func SetDeplDisabled(indent int, pallet *forklift.FSPallet, deplName string, disabled bool) error
- func SetDeplPkg(indent int, pallet *forklift.FSPallet, pkgLoader forklift.FSPkgLoader, ...) error
- func SetNextStagedBundle(store *forklift.FSStageStore, index int, ...) error
- func StagePallet(pallet *forklift.FSPallet, stageStore *forklift.FSStageStore, ...) (index int, err error)
- type ReconciliationChange
- type ResolvedDeplsLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDeplFeat ¶ added in v0.7.2
func AddRepoRequirements ¶ added in v0.7.0
func ApplyNextOrCurrentBundle ¶ added in v0.7.0
func BulletedPrint ¶
func BulletedPrintYaml ¶
func BulletedPrintf ¶
func BulletedPrintln ¶
func CacheAllRequirements ¶ added in v0.6.0
func CacheAllRequirements( pallet *forklift.FSPallet, repoCachePath string, pkgLoader forklift.FSPkgLoader, dlCache *forklift.FSDownloadCache, includeDisabled, parallel bool, ) error
func CacheStagingRequirements ¶ added in v0.7.0
func CacheStagingRequirements( pallet *forklift.FSPallet, repoCachePath string, pkgLoader forklift.FSPkgLoader, dlCache *forklift.FSDownloadCache, includeDisabled, parallel bool, ) error
func Check ¶ added in v0.7.0
func Check( indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader, ) ([]*forklift.ResolvedDepl, []forklift.SatisfiedDeplDeps, error)
Check checks the validity of the pallet or bundle.
func CheckArtifactCompatibility ¶ added in v0.7.0
func CheckArtifactCompatibility( artifactVersion, toolVersion, minArtifactVersion, artifactPath string, ignoreTool bool, ) error
CheckArtifactCompatibility determines whether the version of Forklift required by an artifact (a repo or pallet), as declared by that artifact's Forklift version, is compatible with the actual version of the Forklift tool, and whether the artifact's Forklift version is compatible with the tool's minimum supported Forklift version for artifacts. compatErr is non-nil when the versions fail the compatibility check, while checkErr is non-nil when any specified version is invalid.
func CheckBundleShallowCompatibility ¶ added in v0.7.0
func CheckCompatibility ¶ added in v0.4.0
func CheckCompatibility( pallet *forklift.FSPallet, repoLoader forklift.FSRepoLoader, toolVersion, repoMinVersion, palletMinVersion string, ignoreTool bool, ) error
CheckCompatibility returns an error upon any version compatibility errors between a pallet, its required pallets & repos (as loaded by repoLoader), and - unless the ignoreTool flag is set - the Forklift tool (whose version is specified as toolVersion, and whose minimum compatible Forklift versions are specified as repoMinVersion and palletMinVersion). Note that minimum versions are still enforced even if the ignoreTool flag is set.
func CheckShallowCompatibility ¶ added in v0.4.0
func CheckShallowCompatibility( pallet *forklift.FSPallet, repoLoader forklift.FSRepoLoader, toolVersion, repoMinVersion, palletMinVersion string, ignoreTool bool, ) error
CheckShallowCompatibility returns an error upon any version compatibility errors between a pallet and - unless the ignoreTool flag is set - the Forklift tool (whose version is specified as toolVersion, and whose minimum compatible Forklift versions are specified as repoMinVersion and palletMinVersion). Note that minimum versions are still enforced even if the ignoreTool flag is set.
func CloneQueriedGitRepoUsingLocalMirror ¶ added in v0.6.0
func DownloadExportFiles ¶ added in v0.7.2
func DownloadExportFiles( indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader, dlCache *forklift.FSDownloadCache, includeDisabled, parallel bool, ) error
func DownloadImages ¶
func DownloadImages( indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader, includeDisabled, parallel bool, ) error
func DownloadImagesForStoreApply ¶ added in v0.7.0
func DownloadImagesForStoreApply( store *forklift.FSStageStore, toolVersion, bundleMinVersion string, parallel, ignoreToolVersion bool, ) error
func DownloadLockedGitRepoUsingLocalMirror ¶ added in v0.6.0
func DownloadQueriedGitReposUsingLocalMirrors ¶ added in v0.6.0
func DownloadQueriedGitReposUsingLocalMirrors( indent int, cachePath string, queries []string, ) (resolved map[string]forklift.GitRepoReq, changed map[forklift.GitRepoReq]bool, err error)
func DownloadRequiredPallets ¶ added in v0.6.0
func DownloadRequiredRepos ¶ added in v0.6.0
func GetDlCache ¶ added in v0.7.2
func GetDlCache(wpath string, ensureCache bool) (*forklift.FSDownloadCache, error)
func GetPalletCache ¶ added in v0.6.0
func GetRepoCache ¶ added in v0.6.0
func GetRepoCache( wpath string, pallet *forklift.FSPallet, ensureCache bool, ) (*forklift.LayeredRepoCache, *forklift.RepoOverrideCache, error)
func GetStageStore ¶ added in v0.7.0
func GetStageStore( workspace *forklift.FSWorkspace, stageStorePath, newStageStoreVersion string, ) (*forklift.FSStageStore, error)
func IndentedPrint ¶
func IndentedPrintYaml ¶
func IndentedPrintf ¶
func IndentedPrintln ¶
func PrintCachedPallet ¶ added in v0.6.0
func PrintCachedRepo ¶ added in v0.6.0
func PrintDeplInfo ¶
func PrintDeplPkgPath ¶ added in v0.5.0
func PrintDeplSpec ¶
func PrintDeplSpec(indent int, spec core.PkgDeplSpec)
func PrintFeatureSpec ¶ added in v0.4.0
func PrintFeatureSpec(indent int, name string, spec core.PkgFeatureSpec)
func PrintFeatureSpecs ¶
func PrintFeatureSpecs(indent int, features map[string]core.PkgFeatureSpec)
func PrintPalletDepls ¶ added in v0.3.0
func PrintPalletInfo ¶ added in v0.2.0
func PrintPalletPkgs ¶ added in v0.3.0
func PrintPalletRepos ¶ added in v0.3.0
func PrintPkgInfo ¶
func PrintPkgSpec ¶
func PrintReadme ¶ added in v0.2.0
func PrintRepoInfo ¶
func PrintResolvedDepl ¶ added in v0.7.0
func PrintResolvedDepl( indent int, cache forklift.PathedRepoCache, resolved *forklift.ResolvedDepl, ) error
func PrintStagedBundle ¶ added in v0.7.0
func RemoveDeplFeat ¶ added in v0.7.2
func RemoveDepls ¶ added in v0.7.2
func RemoveRepoRequirements ¶ added in v0.7.2
func SetDeplDisabled ¶ added in v0.7.2
func SetDeplPkg ¶ added in v0.7.2
func SetNextStagedBundle ¶ added in v0.7.0
func StagePallet ¶ added in v0.7.0
func StagePallet( pallet *forklift.FSPallet, stageStore *forklift.FSStageStore, repoCache forklift.PathedRepoCache, dlCache *forklift.FSDownloadCache, exportPath, toolVersion, bundleMinVersion, newBundleForkliftVersion string, skipImageCaching, parallel, ignoreToolVersion bool, ) (index int, err error)
Types ¶
type ReconciliationChange ¶ added in v0.5.0
type ReconciliationChange struct { Name string Type string Depl *forklift.ResolvedDepl // this is nil for an app to be removed App api.Stack // this is empty for an app which does not yet exist }
func Plan ¶ added in v0.7.0
func Plan( indent int, deplsLoader ResolvedDeplsLoader, pkgLoader forklift.FSPkgLoader, parallel bool, ) ( changeDeps structures.Digraph[*ReconciliationChange], serialization []*ReconciliationChange, err error, )
Plan builds a plan for changes to make to the Docker host in order to reconcile it with the desired state as expressed by the pallet or bundle. The plan is expressed as a dependency graph which can be used to build a partial ordering of the changes (where each change is a node in the graph) for concurrent execution, and - if serial execution is required either because the parallel arg is set to true or because a dependency cycle was detected - a total ordering of the changes for serial (rather than concurrent) execution.
func (*ReconciliationChange) PlanString ¶ added in v0.5.0
func (c *ReconciliationChange) PlanString() string
func (*ReconciliationChange) String ¶ added in v0.5.0
func (c *ReconciliationChange) String() string