This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the OpenShift Dedicated managed-scripts repository, containing scripts executed by the Backplane system for cluster operations and troubleshooting.
make build- Build the container image with validation, shellcheck, and pyflakesmake validation- Validate all metadata.yaml files against the JSON schemamake validation SCRIPTS="script1 script2"- Validate specific scripts onlymake shellcheck- Run shellcheck on all .sh filesmake pyflakes- Run pyflakes on all .py files
Scripts are tested using the Backplane CLI:
# Connect to stage environment
ocm backplane config set url https://api.stage.backplane.openshift.com
ocm backplane login <stage-cluster-id>
# Test a script
ocm backplane testjob create [-p var1=val1]
# Check status and logs
ocm backplane testjob get <job-id>
ocm backplane testjob logs <job-id>Scripts are organized by team/category under scripts/:
alerting/- Alerting and monitoring scriptsconfig/- Configuration managementhealth/- Health checking utilitieskafka/- Kafka-specific operationslib/- Shared libraries and utilitiesmaintenance/- Maintenance operationsnetworking/- Network troubleshootingnode/- Node operationsoperators-lifecycle/- Operator managementsecurity/- Security-related scriptsstorage-registry/- Storage and registry operationstroubleshooting/- General troubleshooting
Each script directory must contain:
script.shorscript.py- The executable scriptmetadata.yaml- Script metadata conforming tohack/metadata.schema.json- Optional:
README.md- Additional documentation
The metadata.yaml file defines:
- Script metadata (name, description, author)
- Language (bash or python)
- RBAC permissions required
- Allowed groups (CEE, SREP, etc.)
- Environment variables
- Customer data access declaration
- Cluster version requirements
Scripts run in a UBI8-based container with pre-installed tools:
- OpenShift CLI (
oc) - AWS CLI (
aws) - OCM CLI (
ocm) - OSDCTL (
osdctl) - Hypershift CLI (
hypershift) - YQ (
yq) - Standard utilities (jq, ssh, python3.11)
- Staging: Automatically deploys from
mainbranch - Production: Released every 3 weeks
- For urgent production releases, contact @managed-scripts in #sd-ims-backplane
hack/metadata.schema.json- JSON schema for metadata validationhack/schema_validation.sh- Validation script for metadata filestemplate/- Template for new script creationDockerfile- Container build definition with all required tools