kubevirt

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "tnosse.kubevirt"

Variables

This section is empty.

Functions

func GenerateUniqueName

func GenerateUniqueName(prefix string) string

Types

type Artifact

type Artifact struct {
	// StateData should store data such as GeneratedData
	// to be shared with post-processors
	StateData map[string]interface{}
}

packersdk.Artifact implementation

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (a *Artifact) Files() []string

func (*Artifact) Id

func (*Artifact) Id() string

func (*Artifact) State

func (a *Artifact) State(name string) interface{}

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func (*Builder) ConfigSpec

func (b *Builder) ConfigSpec() hcldec.ObjectSpec

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) (generatedVars []string, warnings []string, err error)

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)

type CloudInitConfig

type CloudInitConfig struct {
	Hostname          string
	FQDN              string
	Commands          []string
	SSHAuthorizedKeys []string
}

func (*CloudInitConfig) String

func (cfg *CloudInitConfig) String() string

type CommandRunner

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

func (*CommandRunner) Start

func (p *CommandRunner) Start(name string, arg ...string) error

func (*CommandRunner) Stop

func (p *CommandRunner) Stop() error

func (*CommandRunner) Wait

func (p *CommandRunner) Wait() error

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`
	Comm                communicator.Config
	K8sConfig           K8sConfig      `mapstructure:",squash"`
	ImageConfig         ImageConfig    `mapstructure:",squash"`
	RunConfig           RunConfig      `mapstructure:",squash"`
	ResourceConfig      ResourceConfig `mapstructure:",squash"`
	// contains filtered or unexported fields
}

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type FlatConfig

type FlatConfig struct {
	PackerBuildName     *string                  `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType   *string                  `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerCoreVersion   *string                  `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
	PackerDebug         *bool                    `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce         *bool                    `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError       *string                  `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars      map[string]string        `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars []string                 `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
	Comm                *communicator.FlatConfig `cty:"comm" hcl:"comm"`
	Namespace           *string                  `mapstructure:"namespace" cty:"namespace" hcl:"namespace"`
	SkipExtractImage    *bool                    `mapstructure:"skip_extract_image" cty:"skip_extract_image" hcl:"skip_extract_image"`
	OutputImageFile     *string                  `mapstructure:"output_image_file" cty:"output_image_file" hcl:"output_image_file"`
	SSHUsername         *string                  `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"`
	SourceImage         *string                  `mapstructure:"source_image" cty:"source_image" hcl:"source_image"`
	Storage             *string                  `mapstructure:"storage" cty:"storage" hcl:"storage"`
	Memory              *string                  `mapstructure:"memory" cty:"memory" hcl:"memory"`
	Cpu                 *string                  `mapstructure:"cpu" cty:"cpu" hcl:"cpu"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type ImageConfig

type ImageConfig struct {
	SkipExtractImage bool   `mapstructure:"skip_extract_image"`
	OutputImageFile  string `mapstructure:"output_image_file"`
}

func (*ImageConfig) Prepare

func (c *ImageConfig) Prepare(ctx *interpolate.Context) []error

type K8sConfig

type K8sConfig struct {
	Namespace string `mapstructure:"namespace"`
}

func (*K8sConfig) Prepare

func (c *K8sConfig) Prepare(ctx *interpolate.Context) []error

type ResourceConfig added in v0.0.4

type ResourceConfig struct {
	Storage string `mapstructure:"storage"`
	Memory  string `mapstructure:"memory"`
	Cpu     string `mapstructure:"cpu"`
}

func (*ResourceConfig) Prepare added in v0.0.4

type RunConfig

type RunConfig struct {
	SSHUsername string `mapstructure:"ssh_username"`
	SourceImage string `mapstructure:"source_image"`
}

func (*RunConfig) Prepare

func (c *RunConfig) Prepare(ctx *interpolate.Context, comm *communicator.Config) []error

type StepCopyImage

type StepCopyImage struct {
	Client client.Client
}

func (*StepCopyImage) Cleanup

func (s *StepCopyImage) Cleanup(state multistep.StateBag)

func (*StepCopyImage) Run

type StepKeyPair

type StepKeyPair struct {
	Debug        bool
	Comm         *communicator.Config
	DebugKeyPath string
}

func (*StepKeyPair) Cleanup

func (s *StepKeyPair) Cleanup(state multistep.StateBag)

func (*StepKeyPair) Run

type StepPortForward

type StepPortForward struct {
}

func (*StepPortForward) Cleanup

func (s *StepPortForward) Cleanup(state multistep.StateBag)

func (*StepPortForward) Run

type StepRunSourceServer

type StepRunSourceServer struct {
	Client client.Client
}

func (*StepRunSourceServer) Cleanup

func (s *StepRunSourceServer) Cleanup(state multistep.StateBag)

func (*StepRunSourceServer) Run

type StepSayConfig

type StepSayConfig struct {
	MockConfig string
}

This is a definition of a builder step and should implement multistep.Step

func (*StepSayConfig) Cleanup

func (s *StepSayConfig) Cleanup(_ multistep.StateBag)

Cleanup can be used to clean up any artifact created by the step. A step's clean up always run at the end of a build, regardless of whether provisioning succeeds or fails.

func (*StepSayConfig) Run

Run should execute the purpose of this step

Jump to

Keyboard shortcuts

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