Documentation ¶
Index ¶
- Constants
- func AddDockerFlags(options *Options, p *pflag.FlagSet)
- func ForwardAllSignals(ctx context.Context, apiClient client.ContainerAPIClient, cid string, ...)
- func MergeDockerOptions(list ConfigList, options *Options, config *Config, hostConfig *HostConfig)
- func MonitorTtySize(ctx context.Context, cli command.Cli, id string, isExec bool) error
- func Parse(flags *pflag.FlagSet, copts *ContainerOptions) (*Config, *HostConfig, error)
- type Config
- type ConfigList
- type ConnectMode
- type ContainerOptions
- type HostConfig
- type Options
- func (option *Options) AddRollbackFunc(f func() error)
- func (option *Options) Connect(ctx context.Context, sshConfig *pkgssh.SshConfig, transferImage bool, ...) error
- func (option *Options) CreateConnectContainer(portBindings nat.PortMap) (*RunConfig, error)
- func (option *Options) Dev(ctx context.Context, cConfig *Config, hostConfig *HostConfig) error
- func (option *Options) GetExposePort(portBinds nat.PortMap) (nat.PortMap, nat.PortSet, error)
- func (option *Options) GetPodTemplateSpec() (*v1.PodTemplateSpec, error)
- func (option *Options) GetRollbackFuncList() []func() error
- func (option *Options) InitClient(f cmdutil.Factory) (err error)
- func (option *Options) Main(ctx context.Context, sshConfig *pkgssh.SshConfig, flags *pflag.FlagSet, ...) error
- type RunConfig
- type RunOptions
Constants ¶
View Source
const ( PullImageAlways = "always" PullImageMissing = "missing" // Default (matches previous behavior) PullImageNever = "never" )
Pull constants
Variables ¶
This section is empty.
Functions ¶
func AddDockerFlags ¶ added in v2.2.5
func ForwardAllSignals ¶ added in v2.2.5
func ForwardAllSignals(ctx context.Context, apiClient client.ContainerAPIClient, cid string, sigc <-chan os.Signal)
ForwardAllSignals forwards signals to the container
The channel you pass in must already be setup to receive any signals you want to forward.
func MergeDockerOptions ¶ added in v2.2.16
func MergeDockerOptions(list ConfigList, options *Options, config *Config, hostConfig *HostConfig)
func MonitorTtySize ¶ added in v2.2.5
MonitorTtySize updates the container tty size when the terminal tty changes size
func Parse ¶ added in v2.2.16
func Parse(flags *pflag.FlagSet, copts *ContainerOptions) (*Config, *HostConfig, error)
Parse parses the args for the specified command and generates a Config, a HostConfig and returns them with the specified command. If the specified args are not valid, it will return an error.
Types ¶
type Config ¶ added in v2.2.16
type Config struct { AttachStdin bool // Attach the standard input, makes possible user interaction AttachStdout bool // Attach the standard output AttachStderr bool // Attach the standard error ExposedPorts nat.PortSet `json:",omitempty"` // List of exposed ports Tty bool // Attach standard streams to a tty, including stdin if it is not closed. OpenStdin bool // Open stdin StdinOnce bool // If true, close stdin after the 1 attached client disconnects. Cmd strslice.StrSlice // Command to run when starting the container Volumes map[string]struct{} // List of volumes (mounts) used for the container Entrypoint strslice.StrSlice // Entrypoint to run when starting the container }
type ConfigList ¶
type ConfigList []*RunConfig
func ConvertPodToContainer ¶ added in v2.2.16
func ConvertPodToContainer(ns string, temp v12.PodTemplateSpec, envMap map[string][]string, mountVolume map[string][]mount.Mount, dnsConfig *dns.ClientConfig) (list ConfigList)
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
type HostConfig ¶ added in v2.2.16
type HostConfig struct { Binds []string // List of volume bindings for this container PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host AutoRemove bool // Automatically remove container when it exits Privileged bool // Is the container in privileged mode PublishAllPorts bool // Should docker publish all exposed port for the container Mounts []mounttypes.Mount `json:",omitempty"` }
type Options ¶
type Options struct { Headers map[string]string Namespace string Workload string ContainerName string NoProxy bool ExtraRouteInfo handler.ExtraRouteInfo ConnectMode ConnectMode Engine config.Engine // docker options DevImage string RunOptions RunOptions ContainerOptions *ContainerOptions // contains filtered or unexported fields }
func (*Options) AddRollbackFunc ¶
func (*Options) Connect ¶ added in v2.2.16
func (option *Options) Connect(ctx context.Context, sshConfig *pkgssh.SshConfig, transferImage bool, portBindings nat.PortMap) error
Connect to cluster network on docker container or host
func (*Options) CreateConnectContainer ¶ added in v2.2.16
func (*Options) GetExposePort ¶ added in v2.2.5
func (*Options) GetPodTemplateSpec ¶ added in v2.2.16
func (option *Options) GetPodTemplateSpec() (*v1.PodTemplateSpec, error)
func (*Options) GetRollbackFuncList ¶
func (*Options) InitClient ¶ added in v2.2.16
type RunConfig ¶
type RunConfig struct { Options RunOptions Copts ContainerOptions // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.