diff --git a/src/helpers.ts b/src/helpers.ts index 0652265f..531da620 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://dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl` + return `https://cdn.dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl` case 'Darwin': - return `https://dl.k8s.io/release/${version}/bin/darwin/${arch}/kubectl` + return `https://cdn.dl.k8s.io/release/${version}/bin/darwin/${arch}/kubectl` case 'Windows_NT': default: - return `https://dl.k8s.io/release/${version}/bin/windows/${arch}/kubectl.exe` + return `https://cdn.dl.k8s.io/release/${version}/bin/windows/${arch}/kubectl.exe` } } diff --git a/src/run.test.ts b/src/run.test.ts index b08affe4..234c8930 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://dl.k8s.io/release/v1.15.0/bin/linux/%s/kubectl', + 'https://cdn.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://dl.k8s.io/release/v1.15.0/bin/darwin/%s/kubectl', + 'https://cdn.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://dl.k8s.io/release/v1.15.0/bin/windows/%s/kubectl.exe', + 'https://cdn.dl.k8s.io/release/v1.15.0/bin/windows/%s/kubectl.exe', arch ) expect(getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl) @@ -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://dl.k8s.io/release/stable.txt' + 'https://cdn.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 5a92bb9a..e74c8192 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://dl.k8s.io/release/stable.txt' +const stableVersionUrl = 'https://cdn.dl.k8s.io/release/stable.txt' export async function run() { let version = core.getInput('version', {required: true})