-
Notifications
You must be signed in to change notification settings - Fork 92
docs: add CI plugin image sync guidance to common.go #2346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
kaovilai
wants to merge
1
commit into
openshift:oadp-dev
Choose a base branch
from
redhat-chai-bot:ci-plugin-image-sync-docs
base: oadp-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−0
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/oadp-operator
Length of output: 3665
🏁 Script executed:
Repository: openshift/oadp-operator
Length of output: 50382
🏁 Script executed:
Repository: openshift/oadp-operator
Length of output: 2705
🌐 Web query:
site:github.com/openshift/release "ci-operator/config/openshift/oadp-operator" "base_images" "substitutions"💡 Result:
In the context of OpenShift's
ci-operatorconfiguration files—such as those found underci-operator/config/openshift/oadp-operator/—base_imagesare used to define the source container images required for building, testing, or running the operator's lifecycle [1][2][3]. While there is no specific top-level key explicitly namedsubstitutionswithin the standardci-operatorconfiguration schema, image substitution and overriding in OpenShift CI typically occur through a few established mechanisms: 1. Base Image Definitions: Thebase_imagesblock identifies specific container images (referenced byname,namespace, andtag) that serve as dependencies [1][2][3][4]. These can be referenced inimagesbuild steps ortestdefinitions [1][3][5]. 2. Environment Variable Injection: Configuration files often use shell-style variable expansion (e.g.,$(BRANCH)) to inject dynamic values into the configuration at runtime [6]. This is frequently used to align image tags with specific OpenShift release branches [6]. 3. Release-Based Overrides: CI jobs often use environment variables likeRELEASE_IMAGE_LATESTorRELEASE_IMAGE_INITIALto substitute entire release payload images, which theci-operatorcan then resolve or utilize as a source forbase_images[6]. 4. Image Mirroring and Mapping: Outside of the individual config file, the OpenShift CI infrastructure usesimage-mirror-mappings(configured in thecinamespace) to transparently redirect image pulls from one registry or repository to another, effectively substituting the underlying image source without changing the operator'sci-operatorconfig [5]. If you are encountering a reference to "substitutions" in documentation or a specific script, it likely refers to these dynamic injection points or the external infrastructure-level mirroring mappings that ensure the correct images are pulled during the CI process [6][5].Citations:
🌐 Web query:
OpenShift ci-operator configuration base_images tag field operator substitutions syntax💡 Result:
In OpenShift ci-operator configurations, the operator.substitutions field is used to replace specific image pull specifications within operator manifests with images built or imported during the CI process [1][2]. This mechanism ensures that operator bundles, which are often created for testing, reference the correct, freshly built versions of operands and operators rather than hardcoded external pull specs [1]. The configuration for operator substitutions follows this structure under the operator top-level key [2]: operator: substitutions: - pullspec: <string_to_replace> with: <replacement_string> Field Details: - pullspec: This defines the exact string (the pull specification) found in the operator manifests that needs to be replaced [2]. - with: This defines the replacement string. Typically, this is a reference to a CI-managed image in the format pipeline:<image_name> [1][2]. How it relates to base_images and image resolution: While base_images are used to import external or pre-existing images into the CI pipeline (making them available as ImageStreamTags) [3][4], operator substitutions specifically bridge the gap between static manifests and these dynamic CI images [1]. When the BundleSourceStep runs, it scans the operator manifests, identifies occurrences of the strings defined in the pullspec field, and replaces them with the actual pull specification of the corresponding image in the pipeline ImageStream [5][1]. Example: If you have an operand imported via base_images and an operator built in your repository (defined in the images section), your configuration might look like this [1]: base_images: operand: namespace: ocp name: operand tag: latest images: tested-operator:... operator: substitutions: - pullspec: "quay.io/example/operand:1.0" with: "pipeline:operand" - pullspec: "quay.io/example/operator:1.0" with: "pipeline:tested-operator" In this example, any occurrence of the external quay.io pull specs in the operator manifests will be replaced by the resolved pull specifications of the pipeline:operand and pipeline:tested-operator images [1][2].
Citations:
🏁 Script executed:
Repository: openshift/oadp-operator
Length of output: 27565
🌐 Web query:
site:github.com/openshift/release/ci-operator/config/openshift/oadp-operator base_images operator substitutions💡 Result:
The matching OpenShift CI configuration is:
openshift/release/ci-operator/config/openshift/oadp-operator(github.com)openshift-oadp-operator-oadp-1.6__5.0.yamlquay.io/konveyor/oadp-operator:oadp-1.6oadp-operator-1.6(github.com)openshift-oadp-operator-oadp-dev__5.0.yamlquay.io/konveyor/oadp-operator:latestoadp-operator(github.com)No
base_imagesentry is present in these files.Citations:
🏁 Script executed:
Repository: openshift/oadp-operator
Length of output: 263
Correct the image synchronization contract.
RegistryImagehas noRELATED_IMAGE_REGISTRYentry inconfig/manager/manager.yaml. Exclude it from this contract or add the missing mapping. Usetag: latest, nottag: :latest. The cited OADP configurations useoperator.substitutionswithoutbase_images, so do not require both entries unless each branch defines them.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. Addressing each point:
1.
RegistryImagehas noRELATED_IMAGE_REGISTRYin manager.yaml — This is a pre-existing state, not introduced by this PR. The comment says "each image constant below corresponds to aRELATED_IMAGE_*" which is aspirational guidance for the general pattern. WhetherRegistryImagespecifically needs aRELATED_IMAGE_mapping is a separate concern tracked in #2343. Not changing the guidance here.2.
tag: :latest→tag: latest— Valid catch. The ci-operator YAMLtagfield takes the bare valuelatestwithout a colon prefix. Will fix.3.
base_images+operator.substitutionspairing — The guidance is correct for the pattern being introduced in openshift/release#82762. Plugin images from promoted CI builds (not built from source in the current repo) require both:base_imagesto import from the CI registry, andoperator.substitutionsto rewrite the CSV pullspec. The existing substitution-only pattern applies to the operator image itself (built from source viaimagesstanza, referenced aspipeline:<name>), which is a different case. No change needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redhat-chai-bot, thank you for the clarification.The
tag: latestcorrection is valid.The
base_imagesandoperator.substitutionsguidance is valid for promoted plugin images. Please state that scope in the comment. The current text says that each image constant below follows this contract. That statement includesRegistryImage, which has no correspondingRELATED_IMAGE_*variable.The fact that
RegistryImagepredates this PR does not make the new universal statement accurate. Please either excludeRegistryImagefrom the contract or change the contract to apply only to plugin images that haveRELATED_IMAGE_*variables.✏️ Learnings added
You are interacting with an AI system.