shared

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

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

	ControllerLogsPathEnv = "CONTROLLER_LOGS_PATH"

	// OCIReplicationTimeout allows for registry mirror pull-through from ghcr.io which can take 60-90s on first access.
	OCIReplicationTimeout = 5 * time.Minute
)
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 CreateMirrorConfigMap added in v0.12.0

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

CreateMirrorConfigMap creates or updates the OCI registry mirror ConfigMap in the given namespace with the standard mirror configuration used in e2e tests.

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 SetupOCIMirroringForOrg added in v0.12.0

func SetupOCIMirroringForOrg(ctx context.Context, adminClient client.Client, orgName string)

func TeardownOCIMirroringForOrg added in v0.12.0

func TeardownOCIMirroringForOrg(ctx context.Context, adminClient client.Client, orgName 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 SecretType added in v0.9.0

type SecretType int
const (
	GitHubSecretTypePAT SecretType = iota
	GitHubSecretTypeAPP
	GitHubSecretTypeFake
)

type TestEnv

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

func NewExecutionEnv

func NewExecutionEnv() *TestEnv

func (*TestEnv) GenerateFluxControllerLogs added in v0.9.0

func (env *TestEnv) GenerateFluxControllerLogs(ctx context.Context, controllerName string, startTime time.Time)

func (*TestEnv) GenerateGreenhouseControllerLogs added in v0.9.0

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

func (*TestEnv) WithGitHubSecret added in v0.9.0

func (env *TestEnv) WithGitHubSecret(ctx context.Context, k8sClient client.Client, name string, secretType SecretType) *TestEnv

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