find

package
v0.21.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const VirtualClusterSelector = "app=vcluster"

Variables

View Source
var NonAllowedCharactersRegEx = regexp.MustCompile(`[^a-zA-Z0-9\-_]+`)

Functions

func CurrentContext

func CurrentContext() (string, *clientcmdapi.Config, error)

func FormatOptions

func FormatOptions(format string, options [][]string) []string

func GetPlatformVCluster

func GetPlatformVCluster(ctx context.Context, platformClient platform.Client, name, project string, log log.Logger) (*platform.VirtualClusterInstanceProject, error)

func GetPodStatus

func GetPodStatus(pod *corev1.Pod) string

GetPodStatus returns the pod status as a string Taken from https://github.com/kubernetes/kubernetes/pkg/printers/internalversion/printers.go

func SwitchContext

func SwitchContext(kubeConfig *clientcmdapi.Config, otherContext string) error

func VClusterConnectBackgroundProxyName

func VClusterConnectBackgroundProxyName(vClusterName string, vClusterNamespace string, currentContext string) string

func VClusterContextName

func VClusterContextName(vClusterName string, vClusterNamespace string, currentContext string) string

func VClusterFromContext

func VClusterFromContext(originalContext string) (name string, namespace string, context string)

func VClusterPlatformContextName

func VClusterPlatformContextName(vClusterName string, projectName string, currentContext string) string

func VClusterPlatformFromContext

func VClusterPlatformFromContext(originalContext string) (name string, project string, context string)

Types

type Status

type Status string
const (
	StatusRunning Status = "Running"
	StatusPaused  Status = "Paused"
	StatusUnknown Status = "Unknown"
)

type VCluster

type VCluster struct {
	ClientFactory clientcmd.ClientConfig `json:"-"`
	Created       metav1.Time
	Name          string
	Namespace     string
	Annotations   map[string]string
	Labels        map[string]string
	Status        Status
	Context       string
	Version       string
}

func GetVCluster

func GetVCluster(ctx context.Context, context, name, namespace string, log log.Logger) (*VCluster, error)

func ListOSSVClusters

func ListOSSVClusters(ctx context.Context, context, name, namespace string) ([]VCluster, error)

func ListVClusters

func ListVClusters(ctx context.Context, context, name, namespace string, log log.Logger) ([]VCluster, error)

func (*VCluster) GetAnnotations

func (v *VCluster) GetAnnotations() map[string]string

GetAnnotations implements Annotated

func (*VCluster) GetLabels

func (v *VCluster) GetLabels() map[string]string

GetLabels implements Labeled

func (*VCluster) IsSleeping

func (v *VCluster) IsSleeping() bool

type VClusterNotFoundError

type VClusterNotFoundError struct {
	Name string
}

func (*VClusterNotFoundError) Error

func (e *VClusterNotFoundError) Error() string

Jump to

Keyboard shortcuts

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