shared

package
v0.6.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminKubeConfigPathEnv  = "GREENHOUSE_ADMIN_KUBECONFIG"
	RemoteKubeConfigPathEnv = "GREENHOUSE_REMOTE_KUBECONFIG"

	ControllerLogsPathEnv = "CONTROLLER_LOGS_PATH"
)
View Source
const ManagedResourceName = "greenhouse"

Variables

This section is empty.

Functions

func ClusterIsReady

func ClusterIsReady(ctx context.Context, adminClient client.Client, clusterName, namespace string)

func FromYamlToK8sObject

func FromYamlToK8sObject(doc string, resources ...any) error

FromYamlToK8sObject - Converts a YAML document to a Kubernetes object if yaml contains multiple documents, then corresponding kubernetes objects should be provided

func IsResourceOwnedByOwner

func IsResourceOwnedByOwner(owner, owned metav1.Object) bool

func Log

func Log(args ...any)

func LogErr

func LogErr(format string, args ...any)

func Logf

func Logf(format string, args ...any)

func OffBoardRemoteCluster

func OffBoardRemoteCluster(ctx context.Context, adminClient, remoteClient client.Client, testStartTime time.Time, name, namespace string)

func OnboardRemoteCluster

func OnboardRemoteCluster(ctx context.Context, k8sClient client.Client, kubeConfigBytes []byte, name, namespace, supportGroupTeamName string)

func OnboardRemoteOIDCCluster

func OnboardRemoteOIDCCluster(ctx context.Context, k8sClient client.Client, caCert []byte, apiServerURL, name, namespace, supportGroupTeamName string)

func WaitUntilNamespaceCreated

func WaitUntilNamespaceCreated(ctx context.Context, k8sClient client.Client, name string) error

WaitUntilNamespaceCreated waits until the namespace is created and active TODO: Remove this once organization controller is standardized

func WaitUntilResourceReadyOrNotReady

func WaitUntilResourceReadyOrNotReady(ctx context.Context, apiClient client.Client, resource lifecycle.RuntimeObject, name, namespace string, applyFunc WaitApplyFunc, readyStatus bool) error

Types

type TestEnv

type TestEnv struct {
	AdminRestClientGetter  *clientutil.RestClientGetter
	RemoteRestClientGetter *clientutil.RestClientGetter
	TestNamespace          string
	IsRealCluster          bool
	RemoteKubeConfigBytes  []byte
}

func NewExecutionEnv

func NewExecutionEnv() *TestEnv

func (*TestEnv) GenerateControllerLogs

func (env *TestEnv) GenerateControllerLogs(ctx context.Context, startTime time.Time)

func (*TestEnv) WithOrganization

func (env *TestEnv) WithOrganization(ctx context.Context, k8sClient client.Client, samplePath string) *TestEnv

type WaitApplyFunc

type WaitApplyFunc func(resource lifecycle.RuntimeObject) error

Jump to

Keyboard shortcuts

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