plugin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: Apache-2.0 Imports: 34 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"`
	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"`

	// 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
	ContainerName  string
	Command        []string
	AgentPort      int
	AppName        string
	ConfigLocation string
	Fork           bool

	//used for agentless mode
	AgentLess  bool
	AgentImage string
	// agentPodName = agentPodNamePrefix + nodeName
	AgentPodName      string
	AgentPodNamespace string
	AgentPodNode      string

	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
	// 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