kube

package
v0.0.0-...-ff2d8de Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateVC

func AnnotateVC(cli client.Client, vc *tenancyv1alpha1.Virtualcluster, key, val string, log logr.Logger) error

AnnotateVC add the annotation('key'='val') to the Virtualcluster 'vc'

func CreateRootNS

func CreateRootNS(cli client.Client, vc *tenancyv1alpha1.Virtualcluster) (string, error)

CreateRootNS creates the root namespace for the vc

func GetPodNsFromInside

func GetPodNsFromInside() (string, error)

GetPodNsFromInside gets the namespace of the pod from inside the pod

func GetSvcClusterIP

func GetSvcClusterIP(cli client.Client, namespace, name string) (string, error)

GetSvcClusterIP gets the ClusterIP of the service 'namespace/name'

func IsObjExist

func IsObjExist(cli client.Client, key client.ObjectKey, obj runtime.Object, log logr.Logger) bool

IsObjExist check if object with 'key' exist

func NewInClusterClient

func NewInClusterClient() (client.Client, error)

NewInClusterClient creates a client that has virtualcluster and clusterversion schemes registered

func RetryPatchVCOnConflict

func RetryPatchVCOnConflict(ctx context.Context, cli client.Client, vc *tenancyv1alpha1.Virtualcluster, patch client.Patch, log logr.Logger, opts ...client.PatchOption) error

RetryPatchVCOnConflict tries to patch the Virtualcluster 'vc'. It will retry to patch the 'vc' if there are conflicts caused by other code

func RetryUpdateVCStatusOnConflict

func RetryUpdateVCStatusOnConflict(ctx context.Context, cli client.Client, vc *tenancyv1alpha1.Virtualcluster, log logr.Logger) error

RetryUpdateVCStatusOnConflict tries to update the Virtualcluster 'vc' status. It will retry to update the 'vc' if there are conflicts caused by other code

func SetVCStatus

func SetVCStatus(vc *tenancyv1alpha1.Virtualcluster, phase tenancyv1alpha1.ClusterPhase, message, reason string)

SetVCStatus set the virtualcluster 'vc' status, and append the new status to conditions list

func WaitStatefulSetReady

func WaitStatefulSetReady(cli client.Client, namespace, name string, timeOutSec, periodSec int64) error

WaitStatefulSetReady checks if the statefulset 'namespace/name' can be ready within the 'timeout'

Types

This section is empty.

Jump to

Keyboard shortcuts

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