change uri (#77)
This commit is contained in:
@@ -12,26 +12,14 @@ export function getKubectlArch(): string {
|
|||||||
export function getkubectlDownloadURL(version: string, arch: string): string {
|
export function getkubectlDownloadURL(version: string, arch: string): string {
|
||||||
switch (os.type()) {
|
switch (os.type()) {
|
||||||
case 'Linux':
|
case 'Linux':
|
||||||
return util.format(
|
return `https://dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl`
|
||||||
'https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubectl',
|
|
||||||
version,
|
|
||||||
arch
|
|
||||||
)
|
|
||||||
|
|
||||||
case 'Darwin':
|
case 'Darwin':
|
||||||
return util.format(
|
return `https://dl.k8s.io/release/${version}/bin/darwin/${arch}/kubectl`
|
||||||
'https://storage.googleapis.com/kubernetes-release/release/%s/bin/darwin/%s/kubectl',
|
|
||||||
version,
|
|
||||||
arch
|
|
||||||
)
|
|
||||||
|
|
||||||
case 'Windows_NT':
|
case 'Windows_NT':
|
||||||
default:
|
default:
|
||||||
return util.format(
|
return `https://dl.k8s.io/release/${version}/bin/windows/${arch}/kubectl.exe`
|
||||||
'https://storage.googleapis.com/kubernetes-release/release/%s/bin/windows/%s/kubectl.exe',
|
|
||||||
version,
|
|
||||||
arch
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ describe('Testing all functions in run file.', () => {
|
|||||||
(arch) => {
|
(arch) => {
|
||||||
jest.spyOn(os, 'type').mockReturnValue('Linux')
|
jest.spyOn(os, 'type').mockReturnValue('Linux')
|
||||||
const kubectlLinuxUrl = util.format(
|
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
|
arch
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ describe('Testing all functions in run file.', () => {
|
|||||||
(arch) => {
|
(arch) => {
|
||||||
jest.spyOn(os, 'type').mockReturnValue('Darwin')
|
jest.spyOn(os, 'type').mockReturnValue('Darwin')
|
||||||
const kubectlDarwinUrl = util.format(
|
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
|
arch
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ describe('Testing all functions in run file.', () => {
|
|||||||
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
|
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
|
||||||
|
|
||||||
const kubectlWindowsUrl = util.format(
|
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
|
arch
|
||||||
)
|
)
|
||||||
expect(getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl)
|
expect(getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl)
|
||||||
|
|||||||
Reference in New Issue
Block a user