From ef7e8f900a58476a9dab15114bc9529cbb0e56bd Mon Sep 17 00:00:00 2001 From: David Gamero Date: Wed, 18 Feb 2026 15:32:20 -0500 Subject: [PATCH] Replace cdn.dl.k8s.io with dl.k8s.io (#227) (#228) The cdn.dl.k8s.io domain is no longer available. Switch all download URLs back to dl.k8s.io. --- src/helpers.ts | 8 ++++---- src/run.test.ts | 10 +++++----- src/run.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/helpers.ts b/src/helpers.ts index 531da62..f4b32fe 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -14,14 +14,14 @@ export function getKubectlArch(): string { export function getkubectlDownloadURL(version: string, arch: string): string { switch (os.type()) { case 'Linux': - return `https://cdn.dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl` + return `https://dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl` case 'Darwin': - return `https://cdn.dl.k8s.io/release/${version}/bin/darwin/${arch}/kubectl` + return `https://dl.k8s.io/release/${version}/bin/darwin/${arch}/kubectl` case 'Windows_NT': default: - return `https://cdn.dl.k8s.io/release/${version}/bin/windows/${arch}/kubectl.exe` + return `https://dl.k8s.io/release/${version}/bin/windows/${arch}/kubectl.exe` } } @@ -30,7 +30,7 @@ export async function getLatestPatchVersion( minor: string ): Promise { const version = `${major}.${minor}` - const sourceURL = `https://cdn.dl.k8s.io/release/stable-${version}.txt` + const sourceURL = `https://dl.k8s.io/release/stable-${version}.txt` try { const downloadPath = await toolCache.downloadTool(sourceURL) const latestPatch = fs diff --git a/src/run.test.ts b/src/run.test.ts index 234c893..e20d3e1 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -43,7 +43,7 @@ describe('Testing all functions in run file.', () => { (arch) => { jest.spyOn(os, 'type').mockReturnValue('Linux') const kubectlLinuxUrl = util.format( - 'https://cdn.dl.k8s.io/release/v1.15.0/bin/linux/%s/kubectl', + 'https://dl.k8s.io/release/v1.15.0/bin/linux/%s/kubectl', arch ) expect(getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlLinuxUrl) @@ -55,7 +55,7 @@ describe('Testing all functions in run file.', () => { (arch) => { jest.spyOn(os, 'type').mockReturnValue('Darwin') const kubectlDarwinUrl = util.format( - 'https://cdn.dl.k8s.io/release/v1.15.0/bin/darwin/%s/kubectl', + 'https://dl.k8s.io/release/v1.15.0/bin/darwin/%s/kubectl', arch ) expect(getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlDarwinUrl) @@ -67,7 +67,7 @@ describe('Testing all functions in run file.', () => { (arch) => { jest.spyOn(os, 'type').mockReturnValue('Windows_NT') const kubectlWindowsUrl = util.format( - 'https://cdn.dl.k8s.io/release/v1.15.0/bin/windows/%s/kubectl.exe', + 'https://dl.k8s.io/release/v1.15.0/bin/windows/%s/kubectl.exe', arch ) expect(getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl) @@ -176,7 +176,7 @@ describe('Testing all functions in run file.', () => { expect(result).toBe('v1.27.15') expect(toolCache.downloadTool).toHaveBeenCalledWith( - 'https://cdn.dl.k8s.io/release/stable-1.27.txt' + 'https://dl.k8s.io/release/stable-1.27.txt' ) }) @@ -251,7 +251,7 @@ describe('Testing all functions in run file.', () => { jest.spyOn(core, 'setOutput').mockImplementation() expect(await run.run()).toBeUndefined() expect(toolCache.downloadTool).toHaveBeenCalledWith( - 'https://cdn.dl.k8s.io/release/stable.txt' + 'https://dl.k8s.io/release/stable.txt' ) expect(core.getInput).toHaveBeenCalledWith('version', {required: true}) expect(core.addPath).toHaveBeenCalledWith('pathToCachedTool') diff --git a/src/run.ts b/src/run.ts index e74c819..5a92bb9 100644 --- a/src/run.ts +++ b/src/run.ts @@ -12,7 +12,7 @@ import { const kubectlToolName = 'kubectl' const stableKubectlVersion = 'v1.15.0' -const stableVersionUrl = 'https://cdn.dl.k8s.io/release/stable.txt' +const stableVersionUrl = 'https://dl.k8s.io/release/stable.txt' export async function run() { let version = core.getInput('version', {required: true})