Feat/k0s download airgapped bundle - #819
Draft
OliverTrautvetter wants to merge 11 commits into
Draft
OliverTrautvetter wants to merge 11 commits into
OliverTrautvetter wants to merge 11 commits into
Conversation
Signed-off-by: joka134 <27293650+joka134@users.noreply.github.com>
Signed-off-by: joka134 <27293650+joka134@users.noreply.github.com>
…gapped-bundle Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com> # Conflicts: # cli/cmd/k0s/download_k0s.go # cli/cmd/k0s/download_k0s_test.go # internal/installer/k0sctl.go
Signed-off-by: OliverTrautvetter <66372584+OliverTrautvetter@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The critical partial-download cache issue and two moderate installation-flow issues must be resolved before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds airgapped k0s installation support, including bundle downloading, caching, upload configuration, CLI options, documentation, and tests.
Changes:
- Adds airgap bundle discovery, caching, and downloading.
- Uploads bundles to nodes and configures offline image handling.
- Adds CLI flags, validation, documentation, and test coverage.
Required fixes:
- Critical —
internal/installer/airgap.go:60: Failed downloads leave partial files in the cache, which later runs may treat as valid bundles. Remove failed destinations or download atomically via a temporary file. - Moderate —
cli/cmd/k0s/install_k0s.go:244: A supplied local bundle still triggers release-bundle acquisition, breaking offline installs and causing duplicate downloads with--force. LetgetAirgapBundlePathexclusively handle bundle acquisition. - Moderate —
cli/cmd/k0s/install_k0s.go:264: Relative bundle paths are resolved differently during validation and by k0sctl. Convert them to absolute paths before generating the configuration.
| File | Description |
|---|---|
internal/installer/mocks.go |
Updates generated k0s manager mocks. |
internal/installer/k0sctl.go |
Refactors k0sctl cache handling. |
internal/installer/k0sctl_config.go |
Adds airgap bundle upload configuration. |
internal/installer/k0sctl_config_test.go |
Tests airgap k0sctl configuration. |
internal/installer/k0s.go |
Adds airgap-aware downloads. |
internal/installer/k0s_test.go |
Tests bundle resolution and caching. |
internal/installer/k0s_config.go |
Configures airgapped image pull behavior. |
internal/installer/k0s_config_test.go |
Tests airgap pull-policy generation. |
internal/installer/download.go |
Adds shared download and cache helpers. |
internal/installer/airgap.go |
Implements bundle discovery and caching. |
docs/oms_install_k0s.md |
Documents airgapped installation options. |
docs/oms_download_k0s.md |
Documents airgap bundle downloads. |
cli/cmd/k0s/k0s_suite_test.go |
Adds the k0s CLI test suite. |
cli/cmd/k0s/install_k0s.go |
Adds the airgapped installation flow and validation. |
cli/cmd/k0s/install_k0s_test.go |
Tests airgapped installation scenarios. |
cli/cmd/k0s/install_k0s_integration_test.go |
Updates installation integration tests. |
cli/cmd/k0s/download_k0s.go |
Adds the airgapped download flag. |
cli/cmd/k0s/download_k0s_test.go |
Tests airgap download behavior. |
Files not reviewed (1)
- internal/installer/mocks.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


This pull request adds support for airgapped (offline) installations of k0s, including both CLI and internal logic changes to handle airgap image bundles. It introduces new flags and validation logic for airgapped installs, updates download and install flows to handle airgap bundles, and enhances tests to cover these scenarios.
Clickup
Important Context to the PR
Tested with Lima.
Cut the internet for the vm.
Run the install
result