Documentation ¶
Overview ¶
Package agent provides a daemon capable of running remote operations on behalf of a user.
Index ¶
- Constants
- Variables
- func NewAgent(logger logr.Logger, app client.Client, cfg Config) (*agent, error)
- func NewDownloader(pathFinder *TerraformPathFinder) *terraformDownloader
- func NewExternalAgent(ctx context.Context, logger logr.Logger, cfg ExternalConfig) (*agent, error)
- type Config
- type Downloader
- type ExternalConfig
- type TerraformPathFinder
Constants ¶
View Source
const ( DefaultID = "agent-001" DefaultConcurrency = 5 )
View Source
const HashicorpReleasesHost = "releases.hashicorp.com"
Variables ¶
Functions ¶
func NewDownloader ¶ added in v0.1.2
func NewDownloader(pathFinder *TerraformPathFinder) *terraformDownloader
NewDownloader constructs a terraform downloader. Pass a path finder to customise the location to which the bins are persisted, or pass nil to use the default.
func NewExternalAgent ¶
NewExternalAgent constructs an external agent, which communicates with otfd via http
Types ¶
type Config ¶
type Config struct { Organization *string // only process runs belonging to org External bool // dedicated agent (true) or integrated into otfd (false) Concurrency int // number of workers Sandbox bool // isolate privileged ops within sandbox Debug bool // toggle debug mode PluginCache bool // toggle use of terraform's shared plugin cache TerraformBinDir string // destination directory for terraform binaries }
Config is configuration for an agent.
func NewConfigFromFlags ¶
type Downloader ¶
type Downloader interface {
Download(ctx context.Context, version string, w io.Writer) (string, error)
}
Downloader downloads a specific version of a binary and returns its path
type ExternalConfig ¶
ExternalConfig is configuration for an external agent
func NewExternalConfigFromFlags ¶
func NewExternalConfigFromFlags(flags *pflag.FlagSet) *ExternalConfig
type TerraformPathFinder ¶ added in v0.1.2
type TerraformPathFinder struct {
// contains filtered or unexported fields
}
func (*TerraformPathFinder) TerraformPath ¶ added in v0.1.2
func (t *TerraformPathFinder) TerraformPath(version string) string
Click to show internal directories.
Click to hide internal directories.