utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GADGET_OPERATION = "gadget.kinvolk.io/operation"
)

Variables

View Source
var (
	KubernetesConfigFlags = genericclioptions.NewConfigFlags(false)
)

Functions

func AddCommonFlags

func AddCommonFlags(command *cobra.Command, params *CommonFlags)

func ExecPod

func ExecPod(client *kubernetes.Clientset, node string, podCmd string, cmdStdout io.Writer, cmdStderr io.Writer) error

func ExecPodCapture

func ExecPodCapture(client *kubernetes.Clientset, node string, podCmd string) (string, string, error)

func ExecPodSimple

func ExecPodSimple(client *kubernetes.Clientset, node string, podCmd string) string

func FlagInit

func FlagInit(rootCmd *cobra.Command)

func GenericTraceCommand

func GenericTraceCommand(
	subCommand string,
	params *CommonFlags,
	args []string,
	outputMode string,
	customResultsDisplay func(contextLogger *log.Entry, nodes *corev1.NodeList, results *gadgetv1alpha1.TraceList),
	transformLine func(string) string,
)

func GetNamespace

func GetNamespace() string

GetNamespace returns the namespace specified by '-n' or the default namespace configured in the kubeconfig file.

Types

type CommonFlags

type CommonFlags struct {
	// Label allows to filter containers with a label selector in the
	// following format: key1=value1,key2=value2
	Label string

	// Node allows to filter containers by node name
	Node string

	// AllNamespaces disables the container filtering by namespace
	AllNamespaces bool

	// Podname allows to filter containers by the pod name
	Podname string

	// Containername allows to filter containers by name
	Containername string

	// JsonOutput returns the results in json
	JsonOutput bool

	// Verbose prints additional information
	Verbose bool
}

CommonFlags contains CLI flags common to several gadgets

type PostProcess

type PostProcess struct {
	OutStreams []*postProcessSingle
	ErrStreams []*postProcessSingle
	// contains filtered or unexported fields
}

func NewPostProcess

func NewPostProcess(n int, outStream io.Writer, errStream io.Writer, params *CommonFlags, transform func(string) string) *PostProcess

Jump to

Keyboard shortcuts

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