utils

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsEqualFoldItemString added in v0.5.5

func ContainsEqualFoldItemString(s []string, e string) (string, bool)

func ContainsItemString

func ContainsItemString(s []string, e string) bool

func CopyFile

func CopyFile(src, dst string) error

func ExecKubectlCommand

func ExecKubectlCommand(ctx context.Context, mode ExecMode, kubeConfigPath string, kubeContext string, args ...string) (string, error)

func ExecTemplate

func ExecTemplate(obj interface{}, tmpl, filename string) error

func GenerateKustomizationYaml

func GenerateKustomizationYaml(dirPath string) error

GenerateKustomizationYaml is the equivalent of running 'kustomize create --autodetect' in the specified dir

func KubeClient

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

func KubeConfig added in v0.5.7

func KubeConfig(kubeConfigPath string, kubeContext string) (*rest.Config, error)

func ParseObjectKindName

func ParseObjectKindName(input string) (string, string)

func PrintTable

func PrintTable(writer io.Writer, header []string, rows [][]string)

func SplitKubeConfigPath

func SplitKubeConfigPath(path string) []string

SplitKubeConfigPath splits the given KUBECONFIG path based on the runtime OS target.

Ref: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable

func ValidateComponents added in v0.5.8

func ValidateComponents(components []string) error

func WriteFile

func WriteFile(content, filename string) error

Types

type ExecMode

type ExecMode string
const (
	ModeOS       ExecMode = "os.stderr|stdout"
	ModeStderrOS ExecMode = "os.stderr"
	ModeCapture  ExecMode = "capture.stderr|stdout"
)

type Utils

type Utils struct {
}

Jump to

Keyboard shortcuts

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