plugin

package
v0.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDebugCmd

func NewDebugCmd(streams genericclioptions.IOStreams) *cobra.Command

NewDebugCmd returns a cobra command wrapping DebugOptions

Types

type Config

type Config struct {
	AgentPort               int      `yaml:"agentPort,omitempty"`
	Image                   string   `yaml:"image,omitempty"`
	RegistrySecretName      string   `yaml:"registrySecretName,omitempty"`
	RegistrySecretNamespace string   `yaml:"registrySecretNamespace,omitempty"`
	RegistrySkipTLSVerify   bool     `yaml:"registrySkipTLSVerify,omitempty"`
	ForkPodRetainLabels     []string `yaml:"forkPodRetainLabels,omitempty"`
	DebugAgentDaemonSet     string   `yaml:"debugAgentDaemonset,omitempty"`
	DebugAgentNamespace     string   `yaml:"debugAgentNamespace,omitempty"`
	Command                 []string `yaml:"command,omitempty"`
	PortForward             bool     `yaml:"portForward,omitempty"`
	Agentless               bool     `yaml:"agentless,omitempty"`
	AgentPodNamePrefix      string   `yaml:"agentPodNamePrefix,omitempty"`
	AgentPodNamespace       string   `yaml:"agentPodNamespace,omitempty"`
	AgentImage              string   `yaml:"agentImage,omitempty"`
	AgentPodCpuRequests     string   `yaml:"agentCpuRequests,omitempty"`
	AgentPodMemoryRequests  string   `yaml:"agentMemoryRequests,omitempty"`
	AgentPodCpuLimits       string   `yaml:"agentCpuLimits,omitempty"`
	AgentPodMemoryLimits    string   `yaml:"agentMemoryLimits,omitempty"`
	IsLxcfsEnabled          bool     `yaml:"isLxcfsEnabled,omitempty"`
	Verbosity               int      `yaml:"verbosity,omitempty"`
	// deprecated
	AgentPortOld int `yaml:"agent_port,omitempty"`
}

func Load

func Load(s string) (*Config, error)

func LoadFile

func LoadFile(filename string) (*Config, error)

type DebugOptions

type DebugOptions struct {

	// Pod select options
	Namespace string
	PodName   string

	// Debug options
	Image                   string
	RegistrySecretName      string
	RegistrySecretNamespace string
	RegistrySkipTLSVerify   bool

	ContainerName       string
	Command             []string
	AgentPort           int
	AppName             string
	ConfigLocation      string
	Fork                bool
	ForkPodRetainLabels []string
	//used for agentless mode
	AgentLess  bool
	AgentImage string
	// agentPodName = agentPodNamePrefix + nodeName
	AgentPodName      string
	AgentPodNamespace string
	AgentPodNode      string
	AgentPodResource  agentPodResources
	// enable lxcfs
	IsLxcfsEnabled bool

	Flags      *genericclioptions.ConfigFlags
	CoreClient coreclient.CoreV1Interface
	KubeCli    *kubernetes.Clientset
	Args       []string
	Config     *restclient.Config

	// use for port-forward
	RESTClient    *restclient.RESTClient
	PortForwarder portForwarder
	Ports         []string
	StopChannel   chan struct{}
	ReadyChannel  chan struct{}

	PortForward         bool
	DebugAgentDaemonSet string
	DebugAgentNamespace string

	genericclioptions.IOStreams

	Verbosity int
	Logger    *log.Logger
	// contains filtered or unexported fields
}

DebugOptions specify how to run debug container in a running pod

func NewDebugOptions

func NewDebugOptions(streams genericclioptions.IOStreams) *DebugOptions

NewDebugOptions new debug options

func (*DebugOptions) Complete

func (o *DebugOptions) Complete(cmd *cobra.Command, args []string, argsLenAtDash int) error

Complete populate default values from KUBECONFIG file

func (*DebugOptions) Run

func (o *DebugOptions) Run() error

TODO: refactor Run() spaghetti code Run run

func (*DebugOptions) Validate

func (o *DebugOptions) Validate() error

Validate validate

type RegistryAuthConfig

type RegistryAuthConfig struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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