compose

package
v0.116.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultComposeFilename is the default name of the Updatecli compose file
	DefaultComposeFilename = "updatecli-compose.yaml"
	// DeprecatedDefaultComposeFilename is the old default name of the Updatecli compose file
	// cfr for more https://github.com/updatecli/updatecli/issues/2284
	// To be removed in the future
	DeprecatedDefaultComposeFilename = "update-compose.yaml"
)

Functions

func GetDefaultComposeFilename added in v0.80.0

func GetDefaultComposeFilename() string

GetDefaultComposeFilename is the old default name of the Updatecli compose file cfr for more https://github.com/updatecli/updatecli/issues/2284

Types

type Compose

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

Compose is a struct that contains a compose object

func New

func New(filename string, visitedComposeFiles map[string]bool) ([]Compose, error)

New creates a new Compose object

func (*Compose) GetPolicies

func (c *Compose) GetPolicies(disableTLS bool, onlyPolicyIDs, ignoredPolicyIDs []string) ([]manifest.Manifest, error)

GetPolicies returns a list of policies defined in the compose file

type EnvFiles

type EnvFiles []string

func (EnvFiles) SetEnv

func (e EnvFiles) SetEnv() error

SetEnv sets the environment variables

type Environments

type Environments map[string]string

Environments is a map of environment variables

func (Environments) SetEnv

func (e Environments) SetEnv() error

SetEnv sets the environment variables

type Policy

type Policy struct {
	// Name contains the policy name
	Name string `yaml:",omitempty"`
	// Policy contains the policy OCI name
	Policy string `yaml:",omitempty"`
	// Config contains a list of Updatecli config file path
	Config []string `yaml:",omitempty"`
	// Values contains a list of Updatecli config file path
	Values []string `yaml:",omitempty"`
	// ValuesInline contains a list of inline values for Updatecli config
	// A deep merge will be performed between global inline values and policy inline values if both are defined.
	//
	// Example:
	//   key1: value1
	//   key2: value2
	ValuesInline *map[string]any `yaml:",omitempty"`
	// Secrets contains a list of Updatecli secret file path
	Secrets []string `yaml:",omitempty"`
	// ID contains the policy ID, it can be used to filter policies to execute
	ID string `yaml:",omitempty"`
}

func (Policy) IsZero added in v0.64.1

func (p Policy) IsZero() bool

type Spec

type Spec struct {
	// Name contains the compose name
	Name string `yaml:",omitempty" jsonschema:"required"`
	// Policies contains a list of policies
	Policies []Policy
	// Environment contains a list of environment variables
	//
	// Example:
	//   ENV_VAR1: value1
	//   ENV_VAR2: value2
	Environments Environments `yaml:",omitempty"`
	// Env_files contains a list of environment files
	//
	// Example:
	//   - env_file1.env
	//   - env_file2.env
	Env_files EnvFiles `yaml:"env_files,omitempty"`
	// ValuesInline contains a list of inline values for Updatecli config
	// This is the default inline values that will be applied to all policies if not overridden by the policy inline values.
	// A deep merge will be performed between global inline values and policy inline values if both are defined.
	//
	// Example:
	//   key1: value1
	//   key2: value2
	ValuesInline *map[string]any `yaml:",omitempty"`
	// Values contains a list of Updatecli config file path
	// This is the default values file that will be applied to all policies if not overridden by the policy values file.
	Values []string `yaml:",omitempty"`
	// Include contains a list of compose files to include
	Include []string `yaml:",omitempty"`
	// Secrets contains a list of Updatecli secret file path
	// This is the default secret file that will be applied to all policies if not overridden by the policy secret file.
	Secrets []string `yaml:",omitempty"`
}

func LoadFile

func LoadFile(filename string) (*Spec, error)

LoadFile loads an Updatecli compose file into a compose Spec

Jump to

Keyboard shortcuts

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