Add operator payload builder scripts - #102
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jaypoulz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds an Operator Payload Builder with configuration templates, operator image build and push automation, custom OpenShift payload creation, validation, registry checks, deployment guidance, and troubleshooting documentation. ChangesOperator payload workflow
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Operator
participant build_operators as build-operators.sh
participant Registry
participant ocp_create_payload as ocp-create-payload
participant OpenShift
Operator->>build_operators: provide operator profiles and options
build_operators->>Registry: validate access
build_operators->>Registry: push operator images
build_operators-->>Operator: report build results
Operator->>ocp_create_payload: provide payload profiles and options
ocp_create_payload->>Registry: verify authentication
ocp_create_payload->>OpenShift: run oc adm release new with overrides
OpenShift-->>Operator: return custom payload result
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors, 2 warnings)
✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@helpers/operator-payload/build-operators.sh`:
- Around line 1-3: Replace the shebang in
helpers/operator-payload/build-operators.sh at lines 1-3 with #!/usr/bin/bash,
and make the same shebang change in helpers/operator-payload/ocp-create-payload
at lines 1-11.
- Around line 79-107: Rename the local variables in get_operator_config and
get_config within helpers/operator-payload/build-operators.sh (lines 79-107) to
meaningful uppercase names, updating every reference consistently. Apply the
same uppercase naming convention to config_file, current_section, profile, and
key in helpers/operator-payload/ocp-create-payload (lines 69-97), preserving
behavior.
- Around line 147-191: Update helpers/operator-payload/build-operators.sh lines
147-191 and its shebang to use /usr/bin/bash; honor default_branch when
branch_override is absent, and use an isolated worktree or restore the original
ref so every success and failure path leaves the repository checkout unchanged.
Keep the existing override behavior and cleanup handling intact.
helpers/operator-payload/operators.conf.template lines 5-27 requires no direct
change; it documents the default_branch configuration consumed by the build
script.
- Around line 253-275: Validate that each value-taking option has a following
argument and that the argument is not another option before reading or assigning
it. Update the option-parsing logic in
helpers/operator-payload/build-operators.sh for -n/--namespace and -t/--tag, and
in helpers/operator-payload/ocp-create-payload for -n, -t, -b, and -o; reject
missing or option-like values with the script’s existing usage/error behavior
while preserving valid parsing.
- Around line 222-238: Update both podman push invocations in the push block to
include --authfile="${auth_file}", preserving their existing verbose and tail
behavior. Also change the script shebang to #!/usr/bin/bash.
In `@helpers/operator-payload/ocp-create-payload`:
- Around line 24-29: Update the initialization flow in the payload script so
profile.env is sourced before deriving NAMESPACE, TAG, and DEFAULT_AUTH_FILE
from QUAY_NAMESPACE, IMAGE_TAG, and REGISTRY_AUTH_FILE. Preserve explicit
CLI-provided values by applying profile-derived defaults only when those options
were not already set, and keep TARGET_IMAGE behavior consistent with the
existing runtime defaults.
In `@helpers/operator-payload/profile.env.template`:
- Around line 1-2: Make the OCP_VERSION setting in profile.env.template
effective by updating ocp-create-payload to read and use it before automatic
release detection, allowing it to override the -b or SNO-derived release;
alternatively, remove the OCP_VERSION template entry so the configuration no
longer advertises an unsupported override.
- Around line 5-11: Quote the angle-bracket namespace placeholders in
helpers/operator-payload/profile.env.template lines 5-11 and the copyable Bash
block in helpers/operator-payload/README.md lines 63-74, including the
QUAY_NAMESPACE and TARGET_IMAGE assignments, so Bash treats them as literal
values rather than redirection syntax.
In `@helpers/operator-payload/README.md`:
- Around line 1-3: Add a Prerequisites section near the beginning of the README,
listing the required bash, git, podman, and oc tools, plus registry access and
write permission for the target namespace.
- Around line 98-102: Update the build-operators.sh workflow description in the
README to state that it always pushes each built image to the registry, unless
the script already supports a documented --no-push option; do not describe
pushing as optional without documenting that flag and its behavior.
- Around line 167-173: Update the podman login instructions in the README to
avoid passing the CI token through the -p argument; pipe the output of oc whoami
-t into podman login and use --password-stdin while preserving the existing
registry and authfile options.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: dcb4171d-46f8-4153-9dd1-3b980a133a74
📒 Files selected for processing (7)
helpers/README.mdhelpers/operator-payload/.gitignorehelpers/operator-payload/README.mdhelpers/operator-payload/build-operators.shhelpers/operator-payload/ocp-create-payloadhelpers/operator-payload/operators.conf.templatehelpers/operator-payload/profile.env.template
| # Base OCP release image (auto-detected from config_sno.sh or specify here) | ||
| # OCP_VERSION=registry.ci.openshift.org/ocp/release-5:5.0.0-0.nightly-2026-07-01-125918 |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Make OCP_VERSION effective or remove it.
The template states that OCP_VERSION can override the base release. ocp-create-payload only uses -b or the SNO configuration. It ignores OCP_VERSION.
Read OCP_VERSION before automatic release detection, or remove this setting from the template.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@helpers/operator-payload/profile.env.template` around lines 1 - 2, Make the
OCP_VERSION setting in profile.env.template effective by updating
ocp-create-payload to read and use it before automatic release detection,
allowing it to override the -b or SNO-derived release; alternatively, remove the
OCP_VERSION template entry so the configuration no longer advertises an
unsupported override.
57e8b4d to
8fab06c
Compare
Build scripts for creating custom OCP payloads with operator image overrides. Allows testing custom operator code before merging upstream. Features: - build-operators.sh: Build and push operator images to registry - ocp-create-payload: Create custom payload with operator overrides - Configurable operator profiles via operators.conf - Template files for user configuration Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Jeremy Poulin <jpoulin@redhat.com>
8fab06c to
3c1ff21
Compare
Build scripts for creating custom OCP payloads with operator image overrides. Allows testing custom operator code before merging upstream.
Features:
Summary by CodeRabbit
New Features
Documentation