v0.16.0
Cluster API (CAPI) Dynamic Cluster Support
useCluster now accepts CAPI cluster resource references in addition to static kubeconfig/context selectors. This enables testing against dynamically provisioned workload clusters managed by Cluster API.
CAPI Cluster Reference
const workload = await s.useCluster({
apiVersion: "cluster.x-k8s.io/v1beta1",
kind: "Cluster",
name: "workload-1",
namespace: "default",
});
const ns = await workload.newNamespace("test");Kest automatically:
- Polls until the CAPI Cluster resource reports
Ready(v1beta1) orAvailable(v1beta2) - Fetches the kubeconfig from the
<name>-kubeconfigSecret - Writes it to a temp file and cleans up on test teardown
Multi-hop Cluster Access
Cluster.useCluster() is now available, enabling multi-hop scenarios such as management cluster → workload cluster:
const mgmt = await s.useCluster({ context: "kind-mgmt" });
const workload = await mgmt.useCluster({
apiVersion: "cluster.x-k8s.io/v1beta1",
kind: "Cluster",
name: "workload-1",
namespace: "default",
});Retry Options
useCluster accepts an optional second parameter for retry configuration:
const c = await s.useCluster(clusterRef, {
timeout: "5m",
interval: "5s",
});Both cluster.x-k8s.io/v1beta1 and cluster.x-k8s.io/v1beta2 are supported.