vcluster

package
v0.0.0-...-09ffeaa Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name  string
	Steps []VClusterStep // using UnmarshalYAML so that we don't need a custom type per action
}

func (Action) GetSteps

func (a Action) GetSteps() []builder.ExecutableStep

func (Action) MakeSteps

func (a Action) MakeSteps() interface{}

MakeSteps builds a slice of VClusterStep for data to be unmarshaled into.

func (Action) MarshalYAML

func (a Action) MarshalYAML() (interface{}, error)

MarshalYAML converts the action back to a YAML representation install:

vcluster:
  ...

func (*Action) UnmarshalYAML

func (a *Action) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML takes any yaml in this form ACTION: - vcluster: ... and puts the steps into the Action.Steps field

type Actions

type Actions []Action

Actions is a set of actions, and the steps, passed from Porter.

func (*Actions) UnmarshalYAML

func (a *Actions) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML takes chunks of a porter.yaml file associated with this mixin and populates it on the current action set. install:

vcluster:
  ...
vcluster:
  ...

upgrade:

vcluster:
  ...

type BuildInput

type BuildInput struct {
	Config MixinConfig
}

BuildInput represents stdin passed to the mixin for the build command.

type ConnectCommand

type ConnectCommand struct {
	Name        string        `yaml:"name"`
	Namespace   string        `yaml:"namespace"`
	KubeConfig  string        `yaml:"kubeConfig"`
	KubeContext string        `yaml:"kubeContext"`
	Address     string        `yaml:"address"`
	LocalPort   int           `yaml:"localPort"`
	Pod         string        `yaml:"pod"`
	Server      string        `yaml:"server"`
	Arguments   []string      `yaml:"arguments,omitempty"`
	Flags       builder.Flags `yaml:"flags,omitempty"`
	Outputs     []Output      `yaml:"outputs,omitempty"`
}

func (ConnectCommand) GetArguments

func (c ConnectCommand) GetArguments() []string

func (ConnectCommand) GetCommand

func (c ConnectCommand) GetCommand() string

func (ConnectCommand) GetFlags

func (c ConnectCommand) GetFlags() builder.Flags

func (ConnectCommand) GetSuffixArguments

func (c ConnectCommand) GetSuffixArguments() []string

func (ConnectCommand) SuppressesOutput

func (c ConnectCommand) SuppressesOutput() bool

type CreateCommand

type CreateCommand struct {
	Name               string        `yaml:"name"`
	Namespace          string        `yaml:"namespace"`
	KubeContext        string        `yaml:"kubeContext"`
	CreateClusterRole  bool          `yaml:"createClusterRole"`
	CreateNamespace    bool          `yaml:"createNamespace"`
	DisableIngressSync bool          `yaml:"disableIngressSync"`
	Upgrade            bool          `yaml:"upgrade"`
	K3SImage           string        `yaml:"k3sImage"`
	Connect            bool          `yaml:"connect"`
	Expose             bool          `yaml:"expose"`
	ExtraConfig        string        `yaml:"extraConfig"`
	Arguments          []string      `yaml:"arguments,omitempty"`
	Flags              builder.Flags `yaml:"flags,omitempty"`
	Outputs            []Output      `yaml:"outputs,omitempty"`
}

func (CreateCommand) GetArguments

func (c CreateCommand) GetArguments() []string

func (CreateCommand) GetCommand

func (c CreateCommand) GetCommand() string

func (CreateCommand) GetFlags

func (c CreateCommand) GetFlags() builder.Flags

func (CreateCommand) GetSuffixArguments

func (c CreateCommand) GetSuffixArguments() []string

func (CreateCommand) SuppressesOutput

func (c CreateCommand) SuppressesOutput() bool

type DeleteCommand

type DeleteCommand struct {
	Name            string        `yaml:"name"`
	Namespace       string        `yaml:"namespace"`
	KubeContext     string        `yaml:"kubeContext"`
	DeleteNamespace bool          `yaml:"deleteNamespace"`
	KeepPVC         bool          `yaml:"keepPVC"`
	Arguments       []string      `yaml:"arguments,omitempty"`
	Flags           builder.Flags `yaml:"flags,omitempty"`
	Outputs         []Output      `yaml:"outputs,omitempty"`
}

func (DeleteCommand) GetArguments

func (c DeleteCommand) GetArguments() []string

func (DeleteCommand) GetCommand

func (c DeleteCommand) GetCommand() string

func (DeleteCommand) GetFlags

func (c DeleteCommand) GetFlags() builder.Flags

func (DeleteCommand) GetSuffixArguments

func (c DeleteCommand) GetSuffixArguments() []string

func (DeleteCommand) SuppressesOutput

func (c DeleteCommand) SuppressesOutput() bool

type Mixin

type Mixin struct {
	*context.Context
	ClientVersion        string `yaml:"clientVersion,omitempty"`
	HelmClientVersion    string `yaml:"helmClientVersion,omitempty"`
	KubectlClientVersion string `yaml:"kubectlClientVersion,omitempty"`
	ClientPlatform       string `yaml:"clientPlatform,omitempty"`
	ClientArchitecture   string `yaml:"clientArchitecture,omitempty"`
}

func New

func New() (*Mixin, error)

New azure mixin client, initialized with useful defaults.

func (*Mixin) Build

func (m *Mixin) Build() error

Build will generate the necessary Dockerfile lines for an invocation image using this mixin

func (*Mixin) Execute

func (m *Mixin) Execute() error

func (*Mixin) GetSchema

func (m *Mixin) GetSchema() (string, error)

func (*Mixin) PrintSchema

func (m *Mixin) PrintSchema() error

func (*Mixin) PrintVersion

func (m *Mixin) PrintVersion(opts version.Options) error

type MixinConfig

type MixinConfig struct {
	ClientVersion        string `yaml:"clientVersion,omitempty"`
	HelmClientVersion    string `yaml:"helmClientVersion,omitempty"`
	ClientPlatform       string `yaml:"clientPlatform,omitempty"`
	ClientArchitecture   string `yaml:"clientArchitecture,omitempty"`
	KubectlClientVersion string `yaml:"kubectlClientVersion,omitempty"`
}

type Output

type Output struct {
	Name string `yaml:"name"`

	// See https://porter.sh/mixins/exec/#outputs
	// TODO: If your mixin doesn't support these output types, you can remove these and the interface assertions above, and from #/definitions/outputs in schema.json
	JsonPath string `yaml:"jsonPath,omitempty"`
	FilePath string `yaml:"path,omitempty"`
	Regex    string `yaml:"regex,omitempty"`
}

func (Output) GetFilePath

func (o Output) GetFilePath() string

func (Output) GetJsonPath

func (o Output) GetJsonPath() string

func (Output) GetName

func (o Output) GetName() string

func (Output) GetRegex

func (o Output) GetRegex() string

type Step

type Step struct {
	Name            string        `yaml:"name"`
	Description     string        `yaml:"description"`
	KubeContext     string        `yaml:"kubeContext"`
	Arguments       []string      `yaml:"arguments,omitempty"`
	SuffixArguments []string      `yaml:"suffix-arguments,omitempty"`
	Flags           builder.Flags `yaml:"flags,omitempty"`
	Outputs         []Output      `yaml:"outputs,omitempty"`
	SuppressOutput  bool          `yaml:"suppress-output,omitempty"`
}

func (Step) GetArguments

func (s Step) GetArguments() []string

func (Step) GetCommand

func (s Step) GetCommand() string

func (Step) GetFlags

func (s Step) GetFlags() builder.Flags

func (Step) GetOutputs

func (s Step) GetOutputs() []builder.Output

func (Step) GetSuffixArguments

func (s Step) GetSuffixArguments() []string

func (Step) SuppressesOutput

func (s Step) SuppressesOutput() bool

type TestMixin

type TestMixin struct {
	*Mixin
	TestContext *context.TestContext
}

func NewTestMixin

func NewTestMixin(t *testing.T) *TestMixin

NewTestMixin initializes a mixin test client, with the output buffered, and an in-memory file system.

type VClusterStep

type VClusterStep struct {
	Description string
	VClusterCommand
}

func (*VClusterStep) UnmarshalYAML

func (s *VClusterStep) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML takes any yaml in this form docker:

description: something
COMMAND: # pull/build/run/... -> make the PullCommand/BuildCommand/RunCommand for us

Jump to

Keyboard shortcuts

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