Skip to content

fix: add curl fallback in deploy-k8s-metrics-server.sh for macOS comp…#7274

Open
Krishiv-Mahajan wants to merge 3 commits intokarmada-io:masterfrom
Krishiv-Mahajan:curl_fix
Open

fix: add curl fallback in deploy-k8s-metrics-server.sh for macOS comp…#7274
Krishiv-Mahajan wants to merge 3 commits intokarmada-io:masterfrom
Krishiv-Mahajan:curl_fix

Conversation

@Krishiv-Mahajan
Copy link
Copy Markdown
Contributor

@Krishiv-Mahajan Krishiv-Mahajan commented Mar 11, 2026

What type of PR is this?
/kind bug

What this PR does / why we need it:
hack/deploy-k8s-metrics-server.sh used wget to download the metrics-server manifest, but wget is not available on macOS by default. This caused the Quick Start script to fail immediately on macOS with zsh: command not found: wget. This PR adds curl as a fallback since curl is available on macOS, Linux, and Windows by default. hack/install-cli.sh already follows this pattern of preferring curl.

Which issue(s) this PR fixes:
Fixes #7273
Part of #7269

Special notes for your reviewer:
curl and wget fetch the exact same file from the same URL. The only change is the tool used and the flag syntax (-O for wget → -o for curl). Behavior is identical on Linux where wget is typically pre-installed.

Does this PR introduce a user-facing change?:
releasehack/deploy-k8s-metrics-server.sh: Fixed Quick Start failure on macOS caused by missing wget by adding curl as a fallback.

…atibility

Signed-off-by: Krishiv-Mahajan <mahajankrishiv10@gmail.com>
@karmada-bot karmada-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. labels Mar 11, 2026
@karmada-bot
Copy link
Copy Markdown
Contributor

[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 liangyuanpeng for approval. For more information see the Code Review Process.

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

Details 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

@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 11, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness of the metrics-server deployment script by addressing a compatibility issue on macOS. By introducing curl as a preferred download mechanism with wget as a fallback, the script can now reliably fetch necessary components across various environments, preventing immediate failures for macOS users attempting to follow the Quick Start guide. This change significantly improves the initial setup experience for a wider range of users.

Highlights

  • macOS Compatibility Fix: Resolved an issue where the hack/deploy-k8s-metrics-server.sh script failed on macOS due to the absence of wget.
  • Download Tool Fallback: Implemented curl as the primary tool for downloading the metrics-server manifest, with wget serving as a fallback option, ensuring broader compatibility across operating systems.
  • Improved Error Handling: Added an explicit error message and exit condition if neither curl nor wget is available on the system, providing clearer guidance to users.
Changelog
  • hack/deploy-k8s-metrics-server.sh
    • Replaced the direct wget command with a conditional block to prioritize curl for downloading the metrics-server manifest.
    • Added a fallback to wget if curl is not found.
    • Included an error message and exit if neither curl nor wget is available on the system.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses an issue where the hack/deploy-k8s-metrics-server.sh script would fail on macOS due to wget not being available by default. The addition of curl as a fallback is a good solution that improves the script's portability. I have one suggestion to further enhance maintainability by extracting the repeated URL into a variable.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 11, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.02%. Comparing base (7369fee) to head (8d31c46).
⚠️ Report is 23 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7274      +/-   ##
==========================================
+ Coverage   42.00%   42.02%   +0.01%     
==========================================
  Files         874      874              
  Lines       53539    53551      +12     
==========================================
+ Hits        22490    22504      +14     
+ Misses      29364    29355       -9     
- Partials     1685     1692       +7     
Flag Coverage Δ
unittests 42.02% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Signed-off-by: Krishiv-Mahajan <mahajankrishiv10@gmail.com>
@Krishiv-Mahajan Krishiv-Mahajan marked this pull request as ready for review March 12, 2026 06:50
Copilot AI review requested due to automatic review settings March 12, 2026 06:50
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 12, 2026
@karmada-bot karmada-bot requested a review from chaosi-zju March 12, 2026 06:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes macOS Quick Start failure by avoiding a hard dependency on wget in hack/deploy-k8s-metrics-server.sh when downloading the metrics-server manifest.

Changes:

  • Introduces a METRICS_SERVER_URL variable for the metrics-server manifest.
  • Uses curl when available, otherwise falls back to wget, and errors if neither is present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Signed-off-by: Krishiv-Mahajan <mahajankrishiv10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hack/deploy-k8s-metrics-server.sh: wget not available on macOS by default, causing Quick Start failure

4 participants