Skip to content

Conversation

@TylerGillson
Copy link
Collaborator

@TylerGillson TylerGillson commented Jul 7, 2025

Summary

  • Update install.sh to support installing clusteradm for a specific target architecture.
  • Resolve all shellcheck lints in the install script and add usage
  • Make addition of v prefix for target version more robust

Related Issues

The linux/arm64 build for the fleetconfig-controller Dockerfile leverages this script and is currently installing the incorrect (linux/amd64) binary unless make images is invoked from a linux/arm64 github runner.

Summary by CodeRabbit

  • Documentation

    • Added usage instructions and examples at the top of the installation script.
  • Bug Fixes

    • Improved handling of environment variables and input parsing for greater robustness.
    • Fixed issues with command safety, including proper quoting of file paths and corrected conditional checks.
  • New Features

    • Introduced an optional environment variable to override the target architecture during installation.

@coderabbitai
Copy link

coderabbitai bot commented Jul 7, 2025

Walkthrough

The install script was updated to use improved variable initialization, introduce an optional ARCH environment variable for architecture override, and refine system info detection. Function variable names and conditionals were clarified, argument parsing for version was normalized, and quoting was made consistent for safety. Additional documentation and formatting adjustments were applied.

Changes

File(s) Change Summary
install.sh Enhanced variable initialization with ${VAR:=default} syntax, added optional ARCH override, refined system info detection, renamed function variables, fixed conditional syntax, normalized version argument parsing, improved quoting for safety, added usage documentation, and formatting improvements.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 709382a and 78224ee.

📒 Files selected for processing (1)
  • install.sh (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • install.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: e2e-test
  • GitHub Check: integration-test
  • GitHub Check: unit-test
  • GitHub Check: verify
✨ Finishing Touches
  • 📝 Generate Docstrings

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 ycyaoxdu and zhujian7 July 7, 2025 15:25
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: 2

🧹 Nitpick comments (1)
install.sh (1)

34-41: Quote $ARCH and guard for unknown architectures

Using an un-quoted $ARCH in the case pattern can break when the variable contains spaces (unlikely but easy to avoid).
Consider also adding a default branch so user-provided/unknown values fail fast instead of propagating to verifySupported, where they will silently be rejected.

-    case $ARCH in
+    case "$ARCH" in
         armv7*) ARCH="arm";;
         aarch64) ARCH="arm64";;
         x86_64) ARCH="amd64";;
+        *)
+            echo "Unsupported architecture: $ARCH"
+            exit 1
         ;;
     esac
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e1db3e and bae2f6c.

📒 Files selected for processing (1)
  • install.sh (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: e2e-test
  • GitHub Check: integration-test
  • GitHub Check: verify
  • GitHub Check: unit-test
🔇 Additional comments (1)
install.sh (1)

89-92: Nice fix on the sudo check

Switching to "$EUID" -ne 0 and quoted comparisons removes the brittle -a test and silences ShellCheck warnings. 👍

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

Signed-off-by: Tyler Gillson <[email protected]>
@TylerGillson TylerGillson force-pushed the fix/multiarchitecture-install branch from 709382a to 78224ee Compare July 7, 2025 15:30
Copy link
Member

@mikeshng mikeshng left a comment

Choose a reason for hiding this comment

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

/lgtm

Also tested locally with a Linux OS.

@mikeshng
Copy link
Member

mikeshng commented Jul 8, 2025

/assign @qiujian16 @zhujian7

@qiujian16
Copy link
Member

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikeshng, qiujian16, TylerGillson

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

The pull request process is described 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

@openshift-merge-bot openshift-merge-bot bot merged commit 5f93d42 into open-cluster-management-io:main Jul 16, 2025
26 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants