This commit is contained in:
Oliver King 2023-01-09 12:55:56 -06:00 коммит произвёл GitHub
Родитель ad011b0706
Коммит bd5ca45a62
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 18 удалений

Просмотреть файл

@ -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`
}
}

Просмотреть файл

@ -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)