agent

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MPL-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package agent provides a daemon capable of running remote operations on behalf of a user.

Index

Constants

View Source
const (
	DefaultID          = "agent-001"
	DefaultConcurrency = 5
)

Variables

View Source
var (
	PluginCacheDir = filepath.Join(os.TempDir(), "plugin-cache")
	DefaultEnvs    = []string{
		"TF_IN_AUTOMATION=true",
		"CHECKPOINT_DISABLE=true",
	}
)

Functions

func NewAgent

func NewAgent(logger logr.Logger, app client, cfg Config) (*agent, error)

NewAgent is the constructor for an agent

func NewExternalAgent

func NewExternalAgent(ctx context.Context, logger logr.Logger, cfg ExternalConfig) (*agent, error)

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

func NewConfigFromFlags(flags *pflag.FlagSet) *Config

type ExternalConfig

type ExternalConfig struct {
	APIConfig api.Config

	Config
}

ExternalConfig is configuration for an external agent

func NewExternalConfigFromFlags

func NewExternalConfigFromFlags(flags *pflag.FlagSet) *ExternalConfig

Jump to

Keyboard shortcuts

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