Core spec fields

2 min read

The four required inputs that tell ork e2e what to test and where to run.


spec.katalog

Path to the kind: Katalog file under test. Relative to the E2E file’s location.

spec:
  katalog: ./katalog.yaml

Optional when spec.custom.target is set — see 05-custom-target.


spec.crd

Path to the CRD YAML to apply before the test run. If the CRD is already installed in the target cluster, this is a no-op.

spec:
  crd: ./crd.yaml

spec.cr

Path to the Custom Resource YAML to apply at the start of the cr-applied phase.

spec:
  cr: ./cr.yaml

spec.cluster

Controls where the test runs.

spec:
  cluster:
    provider: kind        # kind | existing
    name: ork-e2e
    reuse: false
FieldDefaultDescription
providerkindkind creates a local kind cluster. existing uses the current kubeconfig context.
nameork-e2eCluster name. For kind, the kind cluster name. For existing, used in output only.
reusefalseWhen true, keeps the cluster after the test — useful for debugging failed runs.


spec.custom

Declares the target runtime when Orkestra is not the operator under test. Bundle generation and Orkestra helm install/uninstall are skipped. Everything else runs unchanged.

spec:
  custom:
    target: kubernetes
  crd: ./crd.yaml
  cr: ./cr.yaml
  setup:
    helm:
      - repo: https://charts.example.com
        chart: my-operator

target must be kubernetes. container is reserved and not yet supported.

See 05-custom-target for full documentation and use cases.


spec.onFailure

Declares kubectl operations and shell commands to run and print to the terminal when any expectation fails. Uses the same kubectl: DSL as expect entries — assertion fields are present on the structs but never evaluated. Output is always printed. Teardown still runs after onFailure completes.

spec:
  onFailure:
    kubectl:
      logs:
        - labelSelector: app=my-operator
          namespace: default
          since: 2m
      describe:
        - kind: Deployment
          name: my-operator
          namespace: default
      events:
        - kind: Pod
          name: my-operator-pod
          namespace: default
    commands:
      - kubectl get pods -A -o wide
FieldDescription
kubectlAccepts the full kubectl: DSL (get, logs, describe, events, exec). Assertion fields are ignored — output is printed.
commandsList of shell strings run via sh -c. Output is printed to the terminal.

onFailure is spec-level — it runs once when the test has at least one failing expectation, not per-expectation. It is skipped entirely when all expectations pass.

To run diagnostics immediately when a specific checkpoint fails, add onFailure: directly on that expect entry — see Per-expectation onFailure.


imports

A top-level list of other E2E files to run after this test completes. Used to compose test suites without a cluster-per-test overhead. See 04-imports for the full field reference.

imports:
  - ./auth-e2e.yaml
  - ./rbac-e2e.yaml
  - path: ./infra-e2e.yaml
    freshCluster: true     # this one gets its own cluster