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
The testjob create, get, and logs subcommands are deprecated. Use ocm backplane testjob render to generate Kubernetes YAML (ServiceAccount, RBAC, and Pod) locally, then apply it with oc on a non-production cluster where you have cluster-admin access:
# Log in to a non-production cluster with cluster-admin (normal IDP login; no backplane login needed)
# Replace the API URL with your cluster's.
oc login https://api.example.openshift.com:6443
# Render the test job YAML from the script directory (contains metadata.yaml + the script)
# If the script requires parameters, add them with -p (repeatable), e.g. -p var1=value
cd scripts/CEE/new-script
ocm backplane testjob render > test-job.yaml
# Review, then apply
oc apply -f test-job.yaml
# Watch / inspect with standard oc (replace the pod name with the one from the previous step)
oc -n openshift-backplane-managed-scripts get pods
oc -n openshift-backplane-managed-scripts logs example-test-job-pod
# Clean up
oc delete -f test-job.yamlScripts 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