Skip to content

opdev/TestConfigurationBundle

Repository files navigation

TestConfigurationBundle

Standardized test bundles for deploying OpenShift operator operands during certification testing.

Problem

The certsuite batch script installs operators via OLM but has no generic way to install their operands. Without operands running, many certification tests can't exercise real workloads. This repo fills that gap.

How It Works

certsuite script                        this repo
─────────────────                       ─────────
1. Install operator via OLM
2. Wait for CSV to succeed
3. Clone this repo ──────────────────►  operator-map.yaml
4. Look up operator name ────────────►    → bundle path
5. oc apply -f 00-prerequisites.yaml ►  namespaces, RBAC (if present)
6. oc apply -f 01-operand-crs.yaml ──►  deploy operand CRs
7. Run 02-validate.sh ───────────────►  polls until operand is healthy
8. Run certification tests
9. oc delete -f teardown.yaml ───────►  cleanup

Supported Operators

Operator Source Repo
amq-broker-rhel8 activemq-artemis-operator
metallb-operator metallb-operator
nfd cluster-nfd-operator
numaresources-operator numaresources-operator
ocs-operator ocs-operator
openshift-gitops-operator gitops-operator
ptp-operator ptp-operator
redhat-oadp-operator oadp-operator
sriov-fec sriov-fec-operator
vault-secrets-operator vault-secrets-operator

Bundle Structure

Each operator bundle lives under bundles/<operator-name>/:

bundles/metallb-operator/
  00-prerequisites.yaml  # (optional) Namespaces, RBAC, ConfigMaps
  01-operand-crs.yaml    # Operand CRs to apply (default uncommented, others commented out)
  02-validate.sh         # Exits 0 when operand is healthy
  metadata.yaml          # Operator info, health checks
  teardown.yaml          # Minimal CR refs for oc delete

metadata.yaml

Machine-readable metadata for the operator and health checks:

operator:
  name: metallb-operator
  repository: https://github.com/openshift/metallb-operator

install:
  namespace: metallb-system
  channel: stable
  catalog_source: redhat-operators

operand:
  primary_cr: 01-operand-crs.yaml
  kind: MetalLB

health_check:
  timeout_seconds: 300
  conditions:
    - type: Available
      status: "True"

01-operand-crs.yaml

Contains all available CRs for the operator. The default CR is uncommented; additional CRs are commented out and can be enabled by uncommenting them before a run:

# Default operand CR for metallb-operator
# Uncomment additional CRs below to deploy them
# ---
apiVersion: metallb.io/v1beta1
kind: MetalLB
metadata:
  name: metallb
  namespace: metallb-system

# ---
# Source: metallb.io_v1beta1_ipaddresspool.yaml
# apiVersion: metallb.io/v1beta1
# kind: IPAddressPool
# ...

02-validate.sh

Polls until the operand reaches a healthy state. Accepts namespace as $1:

./bundles/metallb-operator/02-validate.sh metallb-system

teardown.yaml

Contains just enough to delete the operand (apiVersion, kind, metadata):

apiVersion: metallb.io/v1beta1
kind: MetalLB
metadata:
  name: metallb
  namespace: metallb-system

Adding a New Operator

  1. Create bundles/<operator-name>/ directory
  2. Create 01-operand-crs.yaml with all sample CRs from the operator's config/samples — leave the default CR uncommented, comment out the rest
  3. Create 02-validate.sh (must be chmod +x) that polls for operand readiness
  4. Create metadata.yaml with operator info and health check config
  5. Create teardown.yaml with the CR(s) to delete
  6. (Optional) Create 00-prerequisites.yaml for namespaces, RBAC, ConfigMaps
  7. Add an entry to operator-map.yaml:
operators:
  my-operator:
    bundle_path: bundles/my-operator
    repository: https://github.com/org/my-operator
    description: "My operator description"

Related

  • Certsuite - certification test suite
  • plan.md - full implementation plan including certsuite script modifications

About

PoC for Operator to provide a single, self-contained artifact that the certification tester can consume

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages