lock

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSpecFileUndefined is returned if a file wasn't specified
	ErrSpecFileUndefined = errors.New("terraform/lock file undefined")
	// ErrSpecProviderUndefined is returned if a provider wasn't specified
	ErrSpecProviderUndefined = errors.New("terraform/lock provider undefined")
	// ErrSpecPlatformsUndefined is returned if a platforms wasn't specified
	ErrSpecPlatformsUndefined = errors.New("terraform/lock platforms undefined")
	// ErrSpecFileAndFilesDefined when we both spec File and Files have been specified
	ErrSpecFileAndFilesDefined = errors.New("parameter \"file\" and \"files\" are mutually exclusive")
	// ErrWrongSpec is returned when the Spec has wrong content
	ErrWrongSpec error = errors.New("wrong spec content")
)

Functions

This section is empty.

Types

type Spec

type Spec struct {
	/*
		"file" defines the terraform lock file path to interact with.

		compatible:
			* condition
			* target

		remark:
			* "file" and "files" are mutually exclusive
			* protocols "https://", "http://", and "file://" are supported in path for condition
	*/
	File string `yaml:",omitempty"`
	/*
		"files" defines the list of terraform lock files path to interact with.

		compatible:
			* condition
			* target

		remark:
			* file and files are mutually exclusive
			* when using as a condition only one file is supported
			* protocols "https://", "http://", and "file://" are supported in file path for condition
	*/
	Files []string `yaml:",omitempty"`
	/*
		"value" is the value associated with a terraform provider.

		compatible:
			* condition
			* target

		default:
			When used from a condition or a target, the default value is set to linked source output.
	*/
	Value string `yaml:",omitempty"`

	/*
		"provider" is the terraform provider you wish to update, supports with or without registry url.

		compatible:
			* condition
			* target
	*/
	Provider string `yaml:",omitempty"`

	/*
		"platforms" is the target platforms to request package checksums for.

		compatible:
			* condition
			* target
	*/
	Platforms []string `yaml:",omitempty"`

	/*
		"skipconstraints" will control whether the constraint in lock file is updated

		compatible:
			* condition
			* target

		NOTE: That turning this off can break the lockfile if version value source does not follow the constraints
	*/
	SkipConstraints bool `yaml:",omitempty"`
}

"terraform/lock" defines the specification for manipulating .terraform-lock.hcl files. It can be used as a "condition", or a "target".

func (*Spec) Validate

func (s *Spec) Validate() error

type TerraformLock

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

func New

func New(spec interface{}) (*TerraformLock, error)

func (*TerraformLock) Apply

func (t *TerraformLock) Apply(filePath string, versionToWrite string, hashesToWrite []string) error

func (*TerraformLock) Changelog

func (t *TerraformLock) Changelog() string

Changelog returns the changelog for this resource, or an empty string if not supported

func (*TerraformLock) Condition

func (t *TerraformLock) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

func (*TerraformLock) Query

func (t *TerraformLock) Query(resourceFile file) (string, []string, error)

func (*TerraformLock) Read

func (t *TerraformLock) Read() error

Read puts the content of the file(s) as value of the y.files map if the file(s) exist(s) or log the non existence of the file

func (*TerraformLock) Source

func (t *TerraformLock) Source(workingDir string, resultSource *result.Source) error

func (*TerraformLock) Target

func (t *TerraformLock) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

func (*TerraformLock) UpdateAbsoluteFilePath

func (t *TerraformLock) UpdateAbsoluteFilePath(workDir string)

Jump to

Keyboard shortcuts

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