test

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UUT_IMAGES_KEY     = "UUT_IMAGES"
	UUT_CONFIG_KEY     = "crossplane/provider-cloudfoundry"
	UUT_CONTROLLER_KEY = "crossplane/provider-cloudfoundry-controller"
	UUIDRegex          = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`)
)

Functions

func ApplySecretInCrossplaneNamespace

func ApplySecretInCrossplaneNamespace(secretName string, data map[string][]byte) env.Func

ApplySecretInCrossplaneNamespace creates a secret in the crossplane-system namespace This is used to store CloudFoundry credentials that the provider will use

Parameters:

  • secretName: Name of the secret to create
  • data: Map of secret data (key -> value as bytes)

Returns: An env.Func that can be used with testenv.Setup()

func CreateProviderConfig

func CreateProviderConfig(
	ctx context.Context,
	cfg *envconf.Config,
	namespace string,
	cfEndpoint string,
	secretName string,
) error

CreateProviderConfig contains the core logic for creating or updating a ProviderConfig. Returns an error if the operation fails.

func DeleteResourcesFromDirsGracefully

func DeleteResourcesFromDirsGracefully(ctx context.Context, cfg *envconf.Config, resourceDirs []string, timeout wait.Option) error

func GetCFCredentialsOrPanic

func GetCFCredentialsOrPanic() map[string][]byte

GetCFCredentialsOrPanic retrieves CloudFoundry credentials from environment variables and returns them as a map suitable for creating a Kubernetes secret

Required environment variables:

  • CF_EMAIL: Email address for CF authentication
  • CF_USERNAME: Username for CF authentication
  • CF_PASSWORD: Password for CF authentication

Returns: map with "credentials" key containing JSON-encoded credentials

func GetImagesFromJsonOrPanic

func GetImagesFromJsonOrPanic(imagesJson string) (string, string)

func GetObjectsToImport

func GetObjectsToImport(ctx context.Context, cfg *envconf.Config, dirs []string) ([]k8s.Object, error)

func LoadUpgradePackages

func LoadUpgradePackages(fromTag, toTag string, fromPackage, toPackage string) (string, string)

LoadUpgradePackages resolves provider packages for upgrade tests. Returns: fromProviderPackage, toProviderPackage

func SetupLogging

func SetupLogging(verbosity int)

SetupLogging configures klog and controller-runtime logging with the specified verbosity TODO: Consider extracting to shared package - identical in BTP and CF providers

Types

type CFCredentials

type CFCredentials struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
}

CFCredentials represents the CloudFoundry credentials structure

Jump to

Keyboard shortcuts

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