utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 30 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 EnsureNamespace added in v1.0.0

func EnsureNamespace(ctx context.Context, kubeClient client.Client, namespace string) error

func GetGlooMeshVersion added in v1.0.0

func GetGlooMeshVersion(ctx context.Context, kubeConfigPath, kubeContext, namespace string) (string, 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,
) (string, error)

Open a port-forward against the specified deployment. Returns the local port. If localPort is unspecified, a free port will be chosen at random. Canceling the context will stop the port-forward.

func PortForwardFromPod added in v0.12.7

func PortForwardFromPod(
	ctx context.Context,
	kubeConfig string,
	kubeContext string,
	podName string,
	podNamespace string,
	localPort string,
	remotePort string,
) (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