feat(windows): add using cache first in DownloadFileWithOras#8289
Open
feat(windows): add using cache first in DownloadFileWithOras#8289
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a cache-first path to Windows CSE ORAS-based downloads by deriving a cached artifact filename from the original HTTP URL and attempting to copy it from the node/VHD cache before falling back to oras pull.
Changes:
- Introduces
Get-FileNameFromUrlhelper to strip query strings and extract the artifact filename. - Extends
DownloadFileWithOraswith an optional-CachedFileparameter to copy from$global:CacheDirwhen available. - Updates kubelet and containerd download flows to pass the derived cached filename, plus adds Pester tests for the new helper and cache-hit behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| staging/cse/windows/networkisolatedclusterfunc.ps1 | Adds URL→filename helper and cache-first logic to DownloadFileWithOras. |
| staging/cse/windows/networkisolatedclusterfunc.tests.ps1 | Adds Pester coverage for Get-FileNameFromUrl and DownloadFileWithOras cache-hit. |
| staging/cse/windows/kubeletfunc.ps1 | Passes derived cached filename into ORAS download retry for kubelet zip. |
| staging/cse/windows/containerdfunc.ps1 | Passes derived cached filename into ORAS download retry for containerd tarball. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
What this PR does / why we need it:
feat: DownloadFileWithOras supports to check cache first
Which issue(s) this PR fixes:
Fixes #