From bd5ca45a6230ee6c815d551fc49e2f3586957a07 Mon Sep 17 00:00:00 2001 From: Oliver King Date: Mon, 9 Jan 2023 12:55:56 -0600 Subject: [PATCH] change uri (#77) --- src/helpers.ts | 18 +++--------------- src/run.test.ts | 6 +++--- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/helpers.ts b/src/helpers.ts index bf16ce3..a0838f6 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -12,26 +12,14 @@ export function getKubectlArch(): string { export function getkubectlDownloadURL(version: string, arch: string): string { switch (os.type()) { case 'Linux': - return util.format( - 'https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubectl', - version, - arch - ) + return `https://dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl` case 'Darwin': - return util.format( - 'https://storage.googleapis.com/kubernetes-release/release/%s/bin/darwin/%s/kubectl', - version, - arch - ) + return `https://dl.k8s.io/release/${version}/bin/darwin/${arch}/kubectl` case 'Windows_NT': default: - return util.format( - 'https://storage.googleapis.com/kubernetes-release/release/%s/bin/windows/%s/kubectl.exe', - version, - arch - ) + return `https://dl.k8s.io/release/${version}/bin/windows/${arch}/kubectl.exe` } } diff --git a/src/run.test.ts b/src/run.test.ts index a9e966d..7fd25e2 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -45,7 +45,7 @@ describe('Testing all functions in run file.', () => { (arch) => { jest.spyOn(os, 'type').mockReturnValue('Linux') const kubectlLinuxUrl = util.format( - 'https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/%s/kubectl', + 'https://dl.k8s.io/release/v1.15.0/bin/linux/%s/kubectl', arch ) @@ -59,7 +59,7 @@ describe('Testing all functions in run file.', () => { (arch) => { jest.spyOn(os, 'type').mockReturnValue('Darwin') const kubectlDarwinUrl = util.format( - 'https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/darwin/%s/kubectl', + 'https://dl.k8s.io/release/v1.15.0/bin/darwin/%s/kubectl', arch ) @@ -74,7 +74,7 @@ describe('Testing all functions in run file.', () => { jest.spyOn(os, 'type').mockReturnValue('Windows_NT') const kubectlWindowsUrl = util.format( - 'https://storage.googleapis.com/kubernetes-release/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)