plugin

package
v1.224.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package plugin centralizes Terraform provider plugin-cache policy shared by the normal Terraform command pipeline and internal output lookups.

Index

Constants

View Source
const (
	// CacheDirEnv is Terraform's provider plugin-cache environment variable.
	CacheDirEnv = "TF_PLUGIN_CACHE_DIR"
	// CacheMayBreakLockFileEnv allows Terraform to reuse an Atmos-managed cache
	// before a fully portable dependency lock entry exists.
	CacheMayBreakLockFileEnv = "TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE"
)

Variables

This section is empty.

Functions

func IsValidDirectory

func IsValidDirectory(path, source string) bool

IsValidDirectory reports whether path is a safe, absolute provider-cache directory. Relative paths are rejected because they would resolve against whichever working directory happens to be current, producing a different effective cache location per component instead of one shared cache.

Types

type Cache

type Cache struct {
	Directory   string
	Environment map[string]string
	Automatic   bool
}

Cache describes the effective provider plugin cache for one Terraform subprocess. Environment is populated only when Atmos selected the cache automatically; callers retain complete control over an explicit TF_PLUGIN_CACHE_DIR override.

func Resolve

func Resolve(atmosConfig *schema.AtmosConfiguration, override string, overrideSet bool) Cache

Resolve applies Atmos's provider-cache policy. An explicit cache directory takes precedence over the configured default. Empty and root-directory overrides are rejected to preserve the existing Atmos safety behavior.

func (Cache) InitLockPath

func (c Cache) InitLockPath() string

InitLockPath returns a stable, machine-local lock path for serializing Terraform init calls that share this cache. Relative cache directories are resolved from the current process directory.

func (Cache) InitLockPathForWorkdir

func (c Cache) InitLockPathForWorkdir(workdir string) string

InitLockPathForWorkdir returns a stable, machine-local lock path for a Terraform working directory. It intentionally lives outside the cache and working directories so it never becomes provider-cache data or a repository artifact.

Jump to

Keyboard shortcuts

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