tfdeps

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package tfdeps manages shared OpenTofu and Terraform provider and module caches.

Index

Constants

View Source
const (
	CLIConfigFileName = "podplane.tfrc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache manages the OpenTofu/Terraform dependency domain under the Podplane cache.

func New

func New(depsCacheDir string) *Cache

New returns an OpenTofu/Terraform dependency cache rooted below depsCacheDir.

func (*Cache) Download

func (c *Cache) Download(ctx context.Context, engine Engine, platforms []string) error

Download resolves and caches all cluster Terraform dependencies.

func (*Cache) Ensure

func (c *Cache) Ensure(ctx context.Context, engine Engine, clusterDir string) (Configuration, error)

Ensure prepares a cluster stack to use the shared cache, restoring exact dependencies recorded by existing generated files when they are missing.

func (*Cache) Upgrade

func (c *Cache) Upgrade(ctx context.Context, engine Engine, clusterDir string) (Configuration, error)

Upgrade downloads the latest supported dependencies and moves an existing cluster stack to those versions.

type Configuration

type Configuration struct {
	NstanceModuleDir string
	CLIConfigPath    string
}

Configuration describes the shared cache paths used by one cluster stack.

type Engine

type Engine interface {
	Platform(context.Context) (string, error)
	InitBackendDisabled(context.Context, string) error
	ProvidersMirror(context.Context, string, string, string) error
	ProvidersLock(context.Context, string, string, []string) error
}

Engine performs the OpenTofu/Terraform operations needed to populate a cache.

Jump to

Keyboard shortcuts

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