Skip to content

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented May 29, 2025

Description

Currently, when iterating on changes in order to re-deploy the
operator manager, a restart is required because make deploy
uses image tags, with this change, there is no need to rollout
restart the deployment and it will immediatelly be effective
while being no-op when the image SHA is equal.

How Has This Been Tested?

USE_LOCAL=true make image-build image-push deploy

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Summary by CodeRabbit

  • New Features

    • Enhanced image handling to automatically resolve image references to digest-based references during customization.
  • Chores

    • Added support for the skopeo tool to streamline image reference management.
  • Documentation

    • Corrected a formatting issue in the README example command for improved clarity.

Currently, when iterating on changes in order to re-deploy the
operator manager, a restart is required because `make deploy`
uses image tags, with this change, there is no need to rollout
restart the deployment and it will immediatelly be effective
while being no-op when the image SHA is equal.

Signed-off-by: Pierangelo Di Pilato <[email protected]>
Copy link

coderabbitai bot commented May 29, 2025

Walkthrough

The Makefile was updated to add support for the skopeo tool, introducing new variables, a phony target for skopeo installation, and modifying the image reference resolution in the manager-kustomization target to use skopeo inspect. The README.md received a minor correction to a command example.

Changes

File(s) Change Summary
Makefile Added skopeo support: new variables, phony target, updated manager-kustomization to use skopeo for image digest resolution, extended go-install-tool macro for extra flags.
README.md Fixed an extraneous quote in a command example.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Makefile
    participant Skopeo
    participant Kustomize

    User->>Makefile: make manager-kustomization
    Makefile->>Skopeo: skopeo inspect <image>
    Skopeo-->>Makefile: Return image digest
    Makefile->>Kustomize: kustomize edit set image <image>@<digest>
Loading

Poem

In the warren where Makefiles grow,
A skopeo tool now joins the show.
With digests resolved, so neat and bright,
Kustomize sets images right.
A README typo hops away—
Code and carrots, a perfect day! 🥕


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot requested review from valdar and zdtsw May 29, 2025 14:06
Copy link

openshift-ci bot commented May 29, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign resolutecoder for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c725472 and f40d2d1.

📒 Files selected for processing (2)
  • Makefile (5 hunks)
  • README.md (1 hunks)
🔇 Additional comments (4)
Makefile (3)

61-63: Introduce SKOPEO binary path.

Adding SKOPEO ?= $(LOCALBIN)/skopeo centralizes the binary location alongside other tools. This prepares the Makefile for the skopeo-based digest resolution.


72-74: Pin SKOPEO version.

Defining SKOPEO_VERSION ?= v1.17.0 ensures consistent installs and reproducible builds.


459-467: Extend go-install-tool to accept extra flags.

The go-install-tool macro now supports an optional $4 parameter for additional go install flags (e.g., -tags="..."), which is needed for installing skopeo with specific build tags. Verify that existing tool installs remain unaffected and that multi-flag quoting is preserved correctly.

README.md (1)

186-187: Fix extraneous quote in example command.

Removing the stray double-quote ensures the usage example (make image-build USE_LOCAL=true) is syntactically correct and aligns with the updated Makefile.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~186-~186: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...set USE_LOCAL make variable to true e.g make image-build USE_LOCAL=true ####...

(E_G)

Comment on lines 249 to 255
# phony target for the case of changing IMG variable
.PHONY: manager-kustomization
manager-kustomization: config/manager/kustomization.yaml.in
manager-kustomization: skopeo config/manager/kustomization.yaml.in
cd config/manager \
&& cp -f kustomization.yaml.in kustomization.yaml \
&& $(KUSTOMIZE) edit set image controller=$(IMG)
&& $(KUSTOMIZE) edit set image controller=$$(skopeo inspect --retry-times=10 --no-tags docker://$(IMG) | jq -r '"\(.Name)@\(.Digest)"')

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Pin image by digest using skopeo inspect.

Using skopeo inspect piped to jq correctly resolves the image to its SHA digest, enabling deploys without manual restarts. However, this step depends on jq being installed. Consider adding jq to the tool binaries (with its own install target) or documenting its requirement to prevent failures in environments lacking jq.

🤖 Prompt for AI Agents
In the Makefile around lines 249 to 255, the use of `jq` in the
`manager-kustomization` target requires `jq` to be installed, which may cause
failures if it's missing. To fix this, either add `jq` to the list of tool
binaries with an appropriate install target in the Makefile or update the
documentation to clearly state that `jq` is a prerequisite for running this
target, ensuring users are aware of this dependency.

@pierDipi
Copy link
Member Author

/test opendatahub-operator-e2e

Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.77%. Comparing base (6391f55) to head (f40d2d1).
⚠️ Report is 102 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1995   +/-   ##
=======================================
  Coverage   35.77%   35.77%           
=======================================
  Files          80       80           
  Lines        7681     7681           
=======================================
  Hits         2748     2748           
  Misses       4681     4681           
  Partials      252      252           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant