plugin

package
v0.0.0-...-31fc253 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 41 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

func Version

func Version() string

Types

type Config

type Config struct {
	DebuggerPort                int      `yaml:"debuggerPort,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"`
	DebuggerDaemonSet           string   `yaml:"debuggerDaemonset,omitempty"`
	DebuggerNamespace           string   `yaml:"debuggerNamespace,omitempty"`
	Command                     []string `yaml:"command,omitempty"`
	PortForward                 bool     `yaml:"portForward,omitempty"`
	Debuggerless                bool     `yaml:"debuggerless,omitempty"`
	DebuggerPodNamePrefix       string   `yaml:"debuggerPodNamePrefix,omitempty"`
	DebuggerPodNamespace        string   `yaml:"debuggerPodNamespace,omitempty"`
	DebuggerImage               string   `yaml:"debuggerImage,omitempty"`
	DebuggerImagePullPolicy     string   `yaml:"debuggerImagePullPolicy,omitempty"`
	DebuggerImagePullSecretName string   `yaml:"debuggerImagePullSecretName,omitempty"`
	DebuggerPodCpuRequests      string   `yaml:"debuggerCpuRequests,omitempty"`
	DebuggerPodMemoryRequests   string   `yaml:"debuggerMemoryRequests,omitempty"`
	DebuggerPodCpuLimits        string   `yaml:"debuggerCpuLimits,omitempty"`
	DebuggerPodMemoryLimits     string   `yaml:"debuggerMemoryLimits,omitempty"`
	IsLxcfsEnabled              bool     `yaml:"isLxcfsEnabled,omitempty"`
	Verbosity                   int      `yaml:"verbosity,omitempty"`
	// deprecated
	DebuggerPortOld int `yaml:"debugger_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
	DebuggerPort        int
	AppName             string
	ConfigLocation      string
	Fork                bool
	ForkPodRetainLabels []string
	//used for debuggerless mode
	DebuggerLess                bool
	DebuggerImage               string
	DebuggerImagePullPolicy     string
	DebuggerImagePullSecretName string
	// debuggerPodName = debuggerPodNamePrefix + nodeName
	DebuggerPodName      string
	DebuggerPodNamespace string
	DebuggerPodNode      string
	DebuggerPodResource  debuggerPodResources
	// 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
	DebuggerDaemonSet string
	DebuggerNamespace string

	genericclioptions.IOStreams

	Verbosity int
	Logger    *log.Logger
	UserName  string
	// 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

Jump to

Keyboard shortcuts

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