Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAndReexec(atmosConfig *schema.AtmosConfiguration) bool
- func CheckAndReexecWithConfig(atmosConfig *schema.AtmosConfiguration, cfg *ReexecConfig) bool
- func ExplicitVersionOverride(args []string) string
- func ParseUseVersionFromArgs(args []string) string
- func ValidateConstraint(constraintStr string) (bool, error)
- type ExecFuncdeprecated
- type PRCacheChecker
- type PRCacheUpdater
- type PRInstaller
- type ReexecConfig
- type RefResolver
- type SHACacheChecker
- type SHAInstaller
- type VersionFinder
- type VersionInstaller
Constants ¶
const ( // VersionEnvVar is the environment variable for specifying the Atmos version to use. // This is a convenience alias that matches common conventions (e.g., tfenv, goenv). VersionEnvVar = "ATMOS_VERSION" // VersionUseEnvVar is the environment variable for specifying the Atmos version. // This matches the config path `version.use` in atmos.yaml. // The --use-version flag also sets this env var. VersionUseEnvVar = "ATMOS_VERSION_USE" // UseVersionEnvVar is the public env var bound to the --use-version flag. // Documented as the primary way to pin the Atmos version via environment. UseVersionEnvVar = "ATMOS_USE_VERSION" )
Variables ¶
var Version = "test" // Default version; will be overridden during build
Version holds the current version of the Atmos CLI binary. It can be set dynamically during build time using ldflags.
Functions ¶
func CheckAndReexec ¶ added in v1.203.0
func CheckAndReexec(atmosConfig *schema.AtmosConfiguration) bool
CheckAndReexec checks if version.use is configured and re-executes with the specified version. This should be called after config/profiles are loaded but before command execution. Returns true if re-exec was triggered (caller should exit), false otherwise.
func CheckAndReexecWithConfig ¶ added in v1.203.0
func CheckAndReexecWithConfig(atmosConfig *schema.AtmosConfiguration, cfg *ReexecConfig) bool
CheckAndReexecWithConfig checks if version.use is configured and re-executes with the specified version. This variant accepts a ReexecConfig for testability.
func ExplicitVersionOverride ¶ added in v1.222.0
ExplicitVersionOverride returns the explicit version override requested by env vars or --use-version, using the same precedence as version re-exec.
func ParseUseVersionFromArgs ¶ added in v1.222.0
ParseUseVersionFromArgs returns the value supplied to --use-version, if any.
func ValidateConstraint ¶ added in v1.201.0
ValidateConstraint checks if the current Atmos version satisfies the given constraint. Returns (satisfied bool, error). If constraintStr is empty, returns (true, nil).
The constraint string uses hashicorp/go-version syntax (same as Terraform):
- ">=1.2.3" - Minimum version
- "<2.0.0" - Maximum version (exclusive)
- ">=1.2.3, <2.0.0" - Range (AND logic)
- ">=2.5.0, !=2.7.0, <3.0.0" - Complex (multiple AND constraints)
- "~>1.2" - Pessimistic constraint (>=1.2.0, <1.3.0)
- "~>1.2.3" - Pessimistic constraint (>=1.2.3, <1.3.0)
- "1.2.3" - Exact version
Types ¶
type PRCacheChecker ¶ added in v1.208.0
type PRCacheChecker func(prNumber int) (toolchain.PRCacheStatus, string)
PRCacheChecker checks PR cache status.
type PRCacheUpdater ¶ added in v1.208.0
type PRCacheUpdater func(ctx context.Context, prNumber int, showProgress bool) (needsReinstall bool, err error)
PRCacheUpdater checks if a PR needs reinstall and updates the cache timestamp.
type PRInstaller ¶ added in v1.208.0
PRInstaller installs from a PR artifact.
type ReexecConfig ¶ added in v1.203.0
type ReexecConfig struct {
Finder VersionFinder
Installer VersionInstaller
ExecFn ExecFunc
GetEnv func(string) string
SetEnv func(string, string) error
Args []string
Environ func() []string
// PR/SHA version support (injectable for testing).
CheckPRCache PRCacheChecker
CheckPRUpdate PRCacheUpdater
InstallFromPR PRInstaller
CheckSHACache SHACacheChecker
InstallFromSHA SHAInstaller
// Ref (branch/tag) version support (injectable for testing).
ResolveRef RefResolver
}
ReexecConfig holds dependencies for version re-execution.
func DefaultReexecConfig ¶ added in v1.203.0
func DefaultReexecConfig() *ReexecConfig
DefaultReexecConfig returns the default production configuration.
type RefResolver ¶ added in v1.221.0
RefResolver resolves a git ref (branch or tag) to its full commit SHA.
type SHACacheChecker ¶ added in v1.208.0
SHACacheChecker checks SHA cache status.
type SHAInstaller ¶ added in v1.208.0
SHAInstaller installs from a SHA artifact.
type VersionFinder ¶ added in v1.203.0
type VersionFinder interface {
FindBinaryPath(owner, repo, version string, binaryName ...string) (string, error)
}
VersionFinder is an interface for finding and installing atmos versions.
type VersionInstaller ¶ added in v1.203.0
VersionInstaller is an interface for installing atmos versions.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package manager implements the Atmos Version Tracker: externally managed versions declared in atmos.yaml, resolved into a lock file, and consumed at runtime via the !version YAML function and the .version template context.
|
Package manager implements the Atmos Version Tracker: externally managed versions declared in atmos.yaml, resolved into a lock file, and consumed at runtime via the !version YAML function and the .version template context. |
|
Package managers defines the file-manager registry for the Atmos Version Tracker: pluggable scanners/rewriters that keep project files (GitHub Actions workflows, marker-annotated files, rendered templates) in sync with the locked versions.
|
Package managers defines the file-manager registry for the Atmos Version Tracker: pluggable scanners/rewriters that keep project files (GitHub Actions workflows, marker-annotated files, rendered templates) in sync with the locked versions. |
|
githubactions
Package githubactions implements the github-actions file manager: it scans workflow files for `uses:` action references, matches them against managed version entries by owner/repo package, and rewrites the ref from the lock.
|
Package githubactions implements the github-actions file manager: it scans workflow files for `uses:` action references, matches them against managed version entries by owner/repo package, and rewrites the ref from the lock. |
|
marker
Package marker implements the marker file manager: the Renovate regex-manager equivalent for arbitrary text files.
|
Package marker implements the marker file manager: the Renovate regex-manager equivalent for arbitrary text files. |
|
template
Package template implements the template file manager: *.tmpl files are the human-edited source of truth and render to a sibling file with the .tmpl suffix stripped, using the .version context resolved from the lock.
|
Package template implements the template file manager: *.tmpl files are the human-edited source of truth and render to a sibling file with the .tmpl suffix stripped, using the .version context resolved from the lock. |
|
Package resolver defines the datasource resolver registry for the Atmos Version Tracker.
|
Package resolver defines the datasource resolver registry for the Atmos Version Tracker. |
|
github
Package github implements the "github-tags" and "github-releases" datasource resolvers backed by the shared pkg/github client (token chain and rate-limit handling included).
|
Package github implements the "github-tags" and "github-releases" datasource resolvers backed by the shared pkg/github client (token chain and rate-limit handling included). |
|
oci
Package oci implements the "oci-tags" and "docker-tags" datasource resolvers backed by go-containerregistry: tag listing for version discovery and manifest digests for immutable pinning.
|
Package oci implements the "oci-tags" and "docker-tags" datasource resolvers backed by go-containerregistry: tag listing for version discovery and manifest digests for immutable pinning. |
|
toolchain
Package toolchain implements the "toolchain" datasource resolver backed by the Atmos toolchain's Aqua registry.
|
Package toolchain implements the "toolchain" datasource resolver backed by the Atmos toolchain's Aqua registry. |