util

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespace

func CreateNamespace(cs kubernetes.Interface, namespace string, dryRun bool) error

CreateNamespace creates a namespace using the given k8s interface.

func SetLabel

func SetLabel(resource runtime.Object, label, value string) error

SetLabel is a helper function which sets the specified label and value on the specified object.

func SplitString

func SplitString(yamlText string) []string

SplitString splits the given yaml doc if it's multipart document.

func ToString

func ToString(errors []error, separator string) string

ToString returns a string representation of errors, with elements separated by separator string. Any nil errors in the slice are skipped.

Types

type Errors

type Errors []error

Errors is a slice of error.

func AppendErr

func AppendErr(errors []error, err error) Errors

AppendErr appends err to errors if it is not nil and returns the result. If err is nil, it is not appended.

func AppendErrs

func AppendErrs(errors []error, newErrs []error) Errors

AppendErrs appends newErrs to errors and returns the result. If newErrs is empty, nothing is appended.

func NewErrs

func NewErrs(err error) Errors

NewErrs returns a slice of error with a single element err. If err is nil, returns nil.

func (Errors) Error

func (e Errors) Error() string

Error implements the error#Error method.

func (Errors) String

func (e Errors) String() string

String implements the stringer#String method.

func (Errors) ToError

func (e Errors) ToError() error

ToError returns an error from Errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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