utils

package
v0.12.8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Yaml = "yaml"
	Json = "json"
)

Variables

This section is empty.

Functions

func AddManagementKubeconfigFlags

func AddManagementKubeconfigFlags(kubeconfig, kubecontext *string, flags *pflag.FlagSet)

Set kubeconfig path and context flags for the management cluster.

func AddOutputFlag added in v0.12.7

func AddOutputFlag(cmd *cobra.Command, format *string)

augment the input cobra command with a flag specifying the output format, also add pre-run validation that the format string is valid

func BuildClient

func BuildClient(kubeConfigPath, kubeContext string) (client.Client, error)

func MarshalProtoWithFormat added in v0.12.7

func MarshalProtoWithFormat(msg proto.Message, format string) (string, error)

marshal a proto message with the given format

func PortForwardFromDeployment added in v0.12.7

func PortForwardFromDeployment(
	ctx context.Context,
	kubeConfig string,
	kubeContext string,
	deployName string,
	deployNamespace string,
	localPort string,
	remotePort string,
	logger *logrus.Logger,
) (chan struct{}, string, error)

Open a port-forward against the specified deployment. Returns the stop channel and the local port. If localPort is unspecified, a free port will be chosen at random. Close the port forward by closing the returned channel.

func PortForwardFromPod added in v0.12.7

func PortForwardFromPod(
	kubeConfig string,
	kubeContext string,
	podName string,
	podNamespace string,
	localPort string,
	remotePort string,
	logger *logrus.Logger,
) (chan struct{}, string, error)

Open a port forward against the specified pod. Returns the stop channel and the local port. If localPort is unspecified, a free port will be chosen at random. Close the port forward by closing the returned channel.

Types

type GlobalFlags added in v0.10.6

type GlobalFlags struct {
	Verbose bool
}

func (*GlobalFlags) AddToFlags added in v0.10.6

func (g *GlobalFlags) AddToFlags(flags *pflag.FlagSet)

Jump to

Keyboard shortcuts

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