util

package
v0.0.0-...-2c539bb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OAMLabel = map[string]string{"app.kubernetes.io/part-of": "kubevela"}

OAMLabel defines the label of namespace automatically created by kubevela

Functions

func DoesCRDExist

func DoesCRDExist(cxt context.Context, c client.Client, crdName string) (bool, error)

DoesCRDExist check CRD exist

func DoesNamespaceExist

func DoesNamespaceExist(c client.Client, namespace string) (bool, error)

DoesNamespaceExist check namespace exist

func GenerateLeaderElectionID

func GenerateLeaderElectionID(name string, versionedDeploy bool) string

GenerateLeaderElectionID returns the Leader Election ID.

func GetRuntimeNamespace

func GetRuntimeNamespace() string

GetRuntimeNamespace get namespace of the current running pod, fall back to default vela system

func NewNamespace

func NewNamespace(c client.Client, namespace string) error

NewNamespace create namespace

func NewRestConfigGetter

func NewRestConfigGetter(namespace string) genericclioptions.RESTClientGetter

NewRestConfigGetter create config for helm client. The helm client never thought it could be used inside a cluster so it took a dependency on the kube cli, we have to create a cli client getter from the rest.Config

func NewRestConfigGetterByConfig

func NewRestConfigGetterByConfig(config *rest.Config, namespace string) genericclioptions.RESTClientGetter

NewRestConfigGetterByConfig new rest config getter

Types

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing. Inconsistent and different names make it hard to read and review code

func (*IOStreams) Error

func (i *IOStreams) Error(a ...interface{})

Error print error info

func (*IOStreams) Errorf

func (i *IOStreams) Errorf(format string, a ...interface{})

Errorf print error info in a specified format

func (*IOStreams) Info

func (i *IOStreams) Info(a ...interface{})

Info print info with new line

func (*IOStreams) Infof

func (i *IOStreams) Infof(format string, a ...interface{})

Infof print info in a specified format

func (*IOStreams) Infonln

func (i *IOStreams) Infonln(a ...interface{})

Infonln compared to Info(), won't print new line

Jump to

Keyboard shortcuts

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