Skip to content

feat(windows): add using cache first in DownloadFileWithOras#8289

Open
fseldow wants to merge 6 commits intomainfrom
xinhl/cachewin
Open

feat(windows): add using cache first in DownloadFileWithOras#8289
fseldow wants to merge 6 commits intomainfrom
xinhl/cachewin

Conversation

@fseldow
Copy link
Copy Markdown
Contributor

@fseldow fseldow commented Apr 13, 2026

What this PR does / why we need it:
feat: DownloadFileWithOras supports to check cache first

Which issue(s) this PR fixes:

Fixes #

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

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-FileNameFromUrl helper to strip query strings and extract the artifact filename.
  • Extends DownloadFileWithOras with an optional -CachedFile parameter to copy from $global:CacheDir when 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.

Comment thread staging/cse/windows/networkisolatedclusterfunc.ps1 Outdated
Comment thread staging/cse/windows/networkisolatedclusterfunc.tests.ps1
@fseldow fseldow changed the title feat: DownloadFileWithOras supports to check cache first feat: add using cache first in DownloadFileWithOras - windows Apr 13, 2026
@fseldow fseldow changed the title feat: add using cache first in DownloadFileWithOras - windows feat(windows): add using cache first in DownloadFileWithOras Apr 13, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 13, 2026 11:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread staging/cse/windows/networkisolatedclusterfunc.ps1
Comment thread staging/cse/windows/networkisolatedclusterfunc.tests.ps1
Copilot AI review requested due to automatic review settings April 13, 2026 19:31
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread staging/cse/windows/networkisolatedclusterfunc.tests.ps1
Comment thread staging/cse/windows/networkisolatedclusterfunc.tests.ps1
Comment thread staging/cse/windows/networkisolatedclusterfunc.ps1
Comment thread staging/cse/windows/kubeletfunc.ps1
Comment thread staging/cse/windows/networkisolatedclusterfunc.ps1
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