dev

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT, Apache-2.0 Imports: 78 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PullImageAlways  = "always"
	PullImageMissing = "missing" // Default (matches previous behavior)
	PullImageNever   = "never"
)

Pull constants

Variables

This section is empty.

Functions

func ConvertHost

func ConvertHost(kubeconfigPath string) (newPath string, err error)

func DoDev

func DoDev(ctx context.Context, devOption *Options, conf *util.SshConfig, flags *pflag.FlagSet, f cmdutil.Factory, transferImage bool) error

func GetDNS

func GetDNS(ctx context.Context, f util.Factory, ns, pod string) (*miekgdns.ClientConfig, error)

func GetVolume

func GetVolume(ctx context.Context, f util.Factory, ns, pod string, d *Options) (map[string][]mount.Mount, error)

GetVolume key format: [container name]-[volume mount name]

Types

type ConfigList

type ConfigList []*RunConfig

func ConvertKubeResourceToContainer

func ConvertKubeResourceToContainer(namespace string, temp v1.PodTemplateSpec, envMap map[string][]string, mountVolume map[string][]mount.Mount, dnsConfig *miekgdns.ClientConfig) (runConfigList ConfigList)

func (ConfigList) Remove

func (l ConfigList) Remove(ctx context.Context, cli *client.Client) error

func (ConfigList) Run

func (l ConfigList) Run(ctx context.Context, volume map[string][]mount.Mount, cli *client.Client, dockerCli *command.DockerCli) error

type ConnectMode

type ConnectMode string
const (
	ConnectModeContainer ConnectMode = "container"
	ConnectModeHost      ConnectMode = "host"
)

type ContainerOptions

type ContainerOptions struct {
	Image string
	Args  []string
	// contains filtered or unexported fields
}

ContainerOptions is a data object with all the options for creating a container

func AddFlags

func AddFlags(flags *pflag.FlagSet) *ContainerOptions

AddFlags adds all command line flags that will be used by parse to the FlagSet

type Options

type Options struct {
	Headers       map[string]string
	Namespace     string
	Workload      string
	Factory       cmdutil.Factory
	ContainerName string
	NoProxy       bool
	ExtraCIDR     []string
	ExtraDomain   []string
	ConnectMode   ConnectMode
	Engine        config.Engine

	// docker options
	DockerImage string
	Options     RunOptions
	Copts       *ContainerOptions

	// inner
	Cli       *client.Client
	DockerCli *command.DockerCli
	// contains filtered or unexported fields
}

func (*Options) AddRollbackFunc

func (d *Options) AddRollbackFunc(f func() error)

func (*Options) GetRollbackFuncList

func (d *Options) GetRollbackFuncList() []func() error

func (*Options) Main

func (d *Options) Main(ctx context.Context, tempContainerConfig *containerConfig) error

type RunConfig

type RunConfig struct {
	Options RunOptions
	Copts   *ContainerOptions
	// contains filtered or unexported fields
}

type RunOptions

type RunOptions struct {
	Detach bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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