Documentation
¶
Index ¶
- func AvailableTCPPort() (port int, err error)
- func CheckClusterPrerequisites(ctx context.Context) error
- func CheckDockerRunning(t *testing.T, reason string)
- func CleanupEnabled(envVar string) (bool, error)
- func CopyDir(src, dst string) error
- func CreateBundleArtifact(t *testing.T, udsPath, bundleDir string) string
- func CreateBundleFromTestData(t *testing.T, testDataRelPath, arch string) string
- func CreateBundleFromTestDataCLI(t *testing.T, testDataRelPath, arch string) string
- func CreateBundleFromTestDataCLIWithBinary(t *testing.T, udsPath, testDataRelPath, arch string) string
- func CreateBundleFromTestDataCobra(t *testing.T, testDataRelPath, arch string) string
- func CreateBundleFromTestDataExpectError(t *testing.T, testDataRelPath, arch string) string
- func CreateBundleFromTestDataWithDiagnostics(t *testing.T, testDataRelPath, arch string) (string, string)
- func DeleteK3dCluster(t *testing.T, clusterName string)
- func DeleteK3dClusterContext(ctx context.Context, clusterName string) error
- func GenerateCosignKeyPair(t *testing.T) (string, string)
- func K3dClusterStatus(ctx context.Context, clusterName string) (exists, running bool, err error)
- func PrepareBundleDir(t *testing.T, testDataRelPath string) string
- func PreparePodinfoBundle(t *testing.T, podinfoPackagePath, packageLabel, namespace string) string
- func PrepareTwoPodinfoBundle(t *testing.T, podinfoPackagePath, firstNamespace, secondNamespace string) string
- func RegisterBundleCleanup(t *testing.T, udsPath, bundlePath string, cleanupTimeout time.Duration) func()
- func RemoveBundle(t *testing.T, udsPath, bundlePath string, args ...string) bundle.RemoveResult
- func RequireUDSCommand(t *testing.T, udsPath string, args ...string) []byte
- func ResolveUDSCLIPath() (string, error)
- func RunBundleDeploy(t *testing.T, udsPath, artifactPath string)
- func RunCommand(ctx context.Context, env []string, name string, args ...string) error
- func StartLocalRegistry(t *testing.T) string
- func TestDataPath(relPath string) string
- func UDSCLIPath(t *testing.T, runHint string) string
- func WriteBootstrapConfig(path, clusterName string, apiPort int) error
- func WriteK3dKubeconfig(ctx context.Context, clusterName, path string) error
- func ZarfPackageStateSecretName(packageName, namespace string) string
- type K8sClient
- func (c *K8sClient) AssertDeploymentContainerRequests(namespace, deploymentName, containerName, expectedCPU, expectedMemory string)
- func (c *K8sClient) AssertDeploymentExists(namespace, name string)
- func (c *K8sClient) AssertDeploymentNotExists(namespace, name string)
- func (c *K8sClient) AssertDeploymentPodAnnotation(namespace, name, key, value string)
- func (c *K8sClient) AssertDeploymentPodToleration(namespace, name, key string, operator corev1.TolerationOperator, ...)
- func (c *K8sClient) AssertDeploymentReplicas(namespace, name string, expected int32)
- func (c *K8sClient) AssertNamespaceExists(namespace string)
- func (c *K8sClient) AssertNamespaceNotExists(namespace string)
- func (c *K8sClient) AssertSecretExists(namespace, name string)
- func (c *K8sClient) AssertSecretNotExists(namespace, name string)
- func (c *K8sClient) AssertServiceNotExists(namespace, name string)
- func (c *K8sClient) AssertStatefulSetReplicas(namespace, name string, expected int32)
- func (c *K8sClient) CreateNamespace(name string, labels map[string]string)
- func (c *K8sClient) DeleteNamespaceAndWait(name string, timeout time.Duration)
- func (c *K8sClient) GetNamespace(name string) *corev1.Namespace
- func (c *K8sClient) GetSecret(namespace, name string) *corev1.Secret
- func (c *K8sClient) WaitForDeploymentReady(namespace, name string, timeout time.Duration)
- func (c *K8sClient) WaitForNamespace(namespace string, timeout time.Duration)
- func (c *K8sClient) WaitForReadyPodBySelector(namespace, labelSelector string, timeout time.Duration)
- func (c *K8sClient) WaitForStatefulSetReady(namespace, name string, timeout time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableTCPPort ¶
AvailableTCPPort returns an available loopback TCP port.
func CheckClusterPrerequisites ¶
CheckClusterPrerequisites verifies that Docker and k3d are available.
func CheckDockerRunning ¶
CheckDockerRunning skips the test when Docker is unavailable.
func CleanupEnabled ¶
CleanupEnabled parses the boolean environment variable controlling test cleanup.
func CreateBundleArtifact ¶
CreateBundleArtifact creates and locates an unsigned bundle artifact in bundleDir.
func CreateBundleFromTestData ¶
CreateBundleFromTestData creates a bundle from repository test data.
func CreateBundleFromTestDataCLI ¶
CreateBundleFromTestDataCLI creates a bundle through the configured CLI binary.
func CreateBundleFromTestDataCLIWithBinary ¶
func CreateBundleFromTestDataCLIWithBinary(t *testing.T, udsPath, testDataRelPath, arch string) string
CreateBundleFromTestDataCLIWithBinary creates a bundle through udsPath.
func CreateBundleFromTestDataCobra ¶
CreateBundleFromTestDataCobra creates a bundle through Cobra command wiring.
func CreateBundleFromTestDataExpectError ¶
CreateBundleFromTestDataExpectError asserts that creating a test bundle fails.
func CreateBundleFromTestDataWithDiagnostics ¶
func CreateBundleFromTestDataWithDiagnostics(t *testing.T, testDataRelPath, arch string) (string, string)
CreateBundleFromTestDataWithDiagnostics creates a bundle and returns captured diagnostics.
func DeleteK3dCluster ¶
DeleteK3dCluster deletes a test cluster if it exists.
func DeleteK3dClusterContext ¶
DeleteK3dClusterContext deletes a cluster and ignores an already-missing cluster.
func GenerateCosignKeyPair ¶
GenerateCosignKeyPair writes a passwordless Cosign key pair for a test.
func K3dClusterStatus ¶
K3dClusterStatus reports whether the named cluster exists and is fully running.
func PrepareBundleDir ¶
PrepareBundleDir copies bundle test data into a temporary directory.
func PreparePodinfoBundle ¶
PreparePodinfoBundle creates a podinfo bundle directory for a cluster test.
func PrepareTwoPodinfoBundle ¶
func PrepareTwoPodinfoBundle(t *testing.T, podinfoPackagePath, firstNamespace, secondNamespace string) string
PrepareTwoPodinfoBundle creates a bundle containing two namespaced podinfo packages.
func RegisterBundleCleanup ¶
func RegisterBundleCleanup(t *testing.T, udsPath, bundlePath string, cleanupTimeout time.Duration) func()
RegisterBundleCleanup registers fallback removal of a deployed bundle.
func RemoveBundle ¶
RemoveBundle removes a bundle with the CLI and returns its structured result.
func RequireUDSCommand ¶
RequireUDSCommand runs the CLI and fails the test when the command fails.
func ResolveUDSCLIPath ¶
ResolveUDSCLIPath resolves the CLI binary configured for integration tests.
func RunBundleDeploy ¶
RunBundleDeploy runs bundle deploy through the supplied CLI binary.
func RunCommand ¶
RunCommand runs a command with output streamed to the test process.
func StartLocalRegistry ¶ added in v0.37.0
StartLocalRegistry starts an in-memory HTTP OCI registry and returns its host.
func TestDataPath ¶
TestDataPath returns an absolute path beneath tests/test_data.
func UDSCLIPath ¶
UDSCLIPath returns the configured CLI binary path or skips the test.
func WriteBootstrapConfig ¶
WriteBootstrapConfig writes the cluster bootstrap variables used by integration tests.
func WriteK3dKubeconfig ¶
WriteK3dKubeconfig writes the named cluster's kubeconfig and selects it for the process.
func ZarfPackageStateSecretName ¶
ZarfPackageStateSecretName returns the state secret name for a package override.
Types ¶
type K8sClient ¶
type K8sClient struct {
*kubernetes.Clientset
// contains filtered or unexported fields
}
func AllocateTestNamespace ¶
func AllocateTestNamespace(t *testing.T, clusterName string, cleanupTimeout time.Duration) (string, *K8sClient)
AllocateTestNamespace creates a unique namespace and registers its cleanup.
func NewK8sClientOrFail ¶
func NewK8sClientOrSkip ¶
func (*K8sClient) AssertDeploymentContainerRequests ¶
func (*K8sClient) AssertDeploymentExists ¶
func (*K8sClient) AssertDeploymentNotExists ¶
func (*K8sClient) AssertDeploymentPodAnnotation ¶
func (*K8sClient) AssertDeploymentPodToleration ¶
func (c *K8sClient) AssertDeploymentPodToleration(namespace, name, key string, operator corev1.TolerationOperator, effect corev1.TaintEffect)
func (*K8sClient) AssertDeploymentReplicas ¶
func (*K8sClient) AssertNamespaceExists ¶
func (*K8sClient) AssertNamespaceNotExists ¶
func (*K8sClient) AssertSecretExists ¶
func (*K8sClient) AssertSecretNotExists ¶
func (*K8sClient) AssertServiceNotExists ¶
func (*K8sClient) AssertStatefulSetReplicas ¶
func (*K8sClient) CreateNamespace ¶
CreateNamespace creates a namespace with the provided labels.
func (*K8sClient) DeleteNamespaceAndWait ¶
DeleteNamespaceAndWait deletes a namespace and waits until it no longer exists.