Skip to content

Conversation

@manuelbuil
Copy link
Contributor

@manuelbuil manuelbuil commented Dec 17, 2025

Proposed Changes

Allow setting INSTALL_K3S_ARTIFACT_URL to override URL prefix for release artifacts, to allow downloading K3s from locations other than GitHub.

Breaking Variable Changes! It replaces the env var GITHUB_URL which was doing a similar thing but required the repo to be in Github

Types of Changes

New feature

Verification

Taking the install.sh script:

INSTALL_K3S_VERSION=v1.32.10+k3s1 INSTALL_K3S_ARTIFACT_URL="https://${url}/k3s"

Testing

Linked Issues

#13366

User-Facing Change

Added INSTALL_K3S_ARTIFACT_URL to donwload K3s binary from a different URL

Further Comments

Signed-off-by: Manuel Buil <mbuil@suse.com>
@manuelbuil manuelbuil requested a review from a team as a code owner December 17, 2025 14:13
@manuelbuil manuelbuil requested review from Copilot and removed request for a team December 17, 2025 14:13
Copy link

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

This PR makes the K3s artifact URL prefix configurable by introducing the INSTALL_K3S_ARTIFACT_URL environment variable, replacing the previous GITHUB_URL variable. This allows K3s to be downloaded from locations other than GitHub, such as private mirrors or alternative artifact repositories. The default behavior remains unchanged, pointing to the official GitHub releases.

Key changes:

  • Added INSTALL_K3S_ARTIFACT_URL environment variable with documentation
  • Implemented URL-safe encoding for version strings containing special characters (e.g., "+" becomes "%2B")
  • Updated artifact download URLs to use the new configurable prefix

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


# --- download binary from github url ---
download_binary() {
VERSION_URLSAFE="$(echo ${VERSION_K3S} | sed 's/\+/%2B/g')"
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The VERSION_URLSAFE variable is computed identically in both download_hash() and download_binary() functions. Consider extracting this to a shared location or computing it once in get_release_version() after VERSION_K3S is set. This would improve maintainability and ensure consistency.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants