plugins

package
v0.0.0-...-27b20b4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ansible = "ansible"

	AwxPrefix    = "_awx."
	AwxInventory = AwxPrefix + "inventory"
	AwxHost      = AwxPrefix + "host"
	AwxUsername  = AwxPrefix + "username"
	AwxPassword  = AwxPrefix + "password"
)
View Source
const (
	KubernetesNamespace = "_kubernetes.namespace" // optional (defaults to "tko")
	KubernetesPod       = "_kubernetes.pod"       // required
	KubernetesContainer = "_kubernetes.container" // optional (defaults to _kubernetes.pod)

	DefaultKubernetesNamespace = "tko"
)
View Source
const Command = "command"
View Source
const Kpt = "kpt"
View Source
const PluginTypesDescription = "\"validate\", \"prepare\", or \"schedule\""

Variables

This section is empty.

Functions

func IsValidPluginType

func IsValidPluginType(type_ string, allowEmpty bool) bool

func RunLocal

func RunLocal(context contextpkg.Context, stdin io.Reader, command ...string) ([]byte, error)

Types

type AWX

type AWX struct {
	Host     string
	Username string
	Password string
}

func (*AWX) NewClient

func (self *AWX) NewClient() *util.AwxClient

type AnsibleExecutor

type AnsibleExecutor struct {
	JobTemplate string
	Inventory   string
	ExtraVars   map[string]any

	AWX AWX
}

func NewAnsibleExecutor

func NewAnsibleExecutor(arguments []string, properties map[string]string) (*AnsibleExecutor, error)

func (*AnsibleExecutor) Execute

func (self *AnsibleExecutor) Execute(context contextpkg.Context, input any) error

type CommandExecutor

type CommandExecutor struct {
	*Runner
}

func NewCommandExecutor

func NewCommandExecutor(arguments []string, properties map[string]string) (*CommandExecutor, error)

func (*CommandExecutor) Execute

func (self *CommandExecutor) Execute(context contextpkg.Context, input any, output any) error

func (*CommandExecutor) GetLog

func (self *CommandExecutor) GetLog(fifoPrefix string, ipStack util.IPStack, address string, port int, log commonlog.Logger) (string, string, error)

type KptExecutor

type KptExecutor struct {
	*Runner
}

func NewKptExecutor

func NewKptExecutor(arguments []string, properties map[string]string) (*KptExecutor, error)

func (*KptExecutor) Execute

func (self *KptExecutor) Execute(context contextpkg.Context, targetResourceIdentifer util.ResourceIdentifier, package_ util.Package) (util.Package, error)

type KubernetesREST

type KubernetesREST struct {
	Interface restpkg.Interface
	Config    *restpkg.Config
}

func GetKubernetesREST

func GetKubernetesREST() (*KubernetesREST, error)

func NewKubernetesREST

func NewKubernetesREST() (*KubernetesREST, error)

func (*KubernetesREST) Run

func (self *KubernetesREST) Run(context contextpkg.Context, namespace string, podName string, containerName string, stdin io.Reader, command ...string) ([]byte, error)

type Remote

type Remote struct {
	KubernetesNamespace string
	KubernetesPod       string
	KubernetesContainer string
}

type Runner

type Runner struct {
	Arguments  []string
	Properties map[string]string
	Remote     *Remote
}

func NewRunner

func NewRunner(arguments []string, properties map[string]string) *Runner

func (*Runner) NewRemote

func (self *Runner) NewRemote() *Remote

func (*Runner) Run

func (self *Runner) Run(context contextpkg.Context, stdin io.Reader, command ...string) ([]byte, error)

Jump to

Keyboard shortcuts

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