Skip to content

Add operand installation to certsuite batch operator test script #4

Description

@rocrisp

Summary

Modify the certsuite script script/run-basic-batch-operators-test.sh to install operands from the TestConfigurationBundle repo after each operator's CSV succeeds.

Details

Fork/branch redhat-best-practices-for-k8s/certsuite and modify the batch test script.

Changes required

1. Add input variables (top of script, INPUTS section)

TEST_BUNDLE_SOURCE="${TEST_BUNDLE_SOURCE:-centralized}"  # "centralized" or "packagemanifest" (future)
TEST_BUNDLE_REPO="${TEST_BUNDLE_REPO:-https://github.com/opdev/TestConfigurationBundle.git}"
TEST_BUNDLE_BRANCH="${TEST_BUNDLE_BRANCH:-main}"
TEST_BUNDLE_DIR=""

2. Add clone_test_bundles() function

  • Shallow clone the TestConfigurationBundle repo to a temp directory at script start
  • Only runs when TEST_BUNDLE_SOURCE=centralized
  • If clone fails, set TEST_BUNDLE_DIR="" and continue (operand install will be skipped gracefully)

3. Add get_bundle_dir() function

  • Single switchpoint for bundle source: centralized (operator-map.yaml lookup) vs packagemanifest (future)
  • Returns the bundle directory path for an operator

4. Add install_operands() function

  • Call get_bundle_dir to locate the bundle
  • If no bundle found, log warning and return 0 (skip gracefully)
  • Apply 00-prerequisites.yaml if present
  • Apply 01-operand-crs.yaml (contains default CR uncommented, others commented out)
  • Run 02-validate.sh with timeout from metadata.yaml

5. Add teardown_operands() function

  • Call get_bundle_dir, apply teardown.yaml if present

6. Injection points in main loop

  • Clone: Call clone_test_bundles after catalog setup, before the operator loop
  • Install: Call install_operands after the existing hardcoded multicluster-engine block (block is preserved, generic install runs after it)
  • Teardown: Call teardown_operands before operator uninstall
  • Cleanup: Remove temp dir at end of script after catalog deletion

Why the multicluster-engine block is preserved

The existing hardcoded multicluster-engine block (lines 775-791) stays in place:

  • It works today and is proven in production
  • No test bundle exists for multicluster-engine yet
  • The generic install_operands call runs after it; once a bundle is created and verified, the hardcoded block can be removed in a follow-up

Dependencies

  • yq must be available in the CI environment for parsing operator-map.yaml and metadata.yaml

Implementation

Acceptance Criteria

  • Script clones TestConfigurationBundle repo at start
  • install_operands applies 01-operand-crs.yaml from the bundle after operator install
  • Gracefully skips operators without a bundle (no failure)
  • Hardcoded multicluster-engine block preserved; generic install runs after it
  • get_bundle_dir supports future switch from centralized to packagemanifest source
  • teardown_operands cleans up before operator uninstall
  • Temp directory cleaned up at script end

Parent Epic

Test Configuration Bundle for Certsuite Operand Installation

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions