Add node modules and new code for release
This commit is contained in:
parent
a10d84bc2e
commit
90f63cb10d
7655 changed files with 1763577 additions and 14 deletions
|
@ -52,10 +52,10 @@ function downloadKubectl(version) {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let cachedToolpath = toolCache.find(kubectlToolName, version);
|
||||
let kubectlDownloadPath = '';
|
||||
const arch = helpers_1.getKubectlArch();
|
||||
const arch = (0, helpers_1.getKubectlArch)();
|
||||
if (!cachedToolpath) {
|
||||
try {
|
||||
kubectlDownloadPath = yield toolCache.downloadTool(helpers_1.getkubectlDownloadURL(version, arch));
|
||||
kubectlDownloadPath = yield toolCache.downloadTool((0, helpers_1.getkubectlDownloadURL)(version, arch));
|
||||
}
|
||||
catch (exception) {
|
||||
if (exception instanceof toolCache.HTTPError && exception.httpStatusCode === 404) {
|
||||
|
@ -65,9 +65,9 @@ function downloadKubectl(version) {
|
|||
throw new Error('DownloadKubectlFailed');
|
||||
}
|
||||
}
|
||||
cachedToolpath = yield toolCache.cacheFile(kubectlDownloadPath, kubectlToolName + helpers_1.getExecutableExtension(), kubectlToolName, version);
|
||||
cachedToolpath = yield toolCache.cacheFile(kubectlDownloadPath, kubectlToolName + (0, helpers_1.getExecutableExtension)(), kubectlToolName, version);
|
||||
}
|
||||
const kubectlPath = path.join(cachedToolpath, kubectlToolName + helpers_1.getExecutableExtension());
|
||||
const kubectlPath = path.join(cachedToolpath, kubectlToolName + (0, helpers_1.getExecutableExtension)());
|
||||
fs.chmodSync(kubectlPath, '777');
|
||||
return kubectlPath;
|
||||
});
|
||||
|
|
|
@ -20,12 +20,12 @@ const util = require("util");
|
|||
describe('Testing all functions in run file.', () => {
|
||||
test('getExecutableExtension() - return .exe when os is Windows', () => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Windows_NT');
|
||||
expect(helpers_1.getExecutableExtension()).toBe('.exe');
|
||||
expect((0, helpers_1.getExecutableExtension)()).toBe('.exe');
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test('getExecutableExtension() - return empty string for non-windows OS', () => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Darwin');
|
||||
expect(helpers_1.getExecutableExtension()).toBe('');
|
||||
expect((0, helpers_1.getExecutableExtension)()).toBe('');
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
|
@ -34,7 +34,7 @@ describe('Testing all functions in run file.', () => {
|
|||
['x64', 'amd64']
|
||||
])("getKubectlArch() - return on %s os arch %s kubectl arch", (osArch, kubectlArch) => {
|
||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
||||
expect(helpers_1.getKubectlArch()).toBe(kubectlArch);
|
||||
expect((0, helpers_1.getKubectlArch)()).toBe(kubectlArch);
|
||||
expect(os.arch).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
|
@ -44,7 +44,7 @@ describe('Testing all functions in run file.', () => {
|
|||
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Linux', (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', arch);
|
||||
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlLinuxUrl);
|
||||
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlLinuxUrl);
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
|
@ -54,7 +54,7 @@ describe('Testing all functions in run file.', () => {
|
|||
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Darwin', (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', arch);
|
||||
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlDarwinUrl);
|
||||
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlDarwinUrl);
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
|
@ -64,7 +64,7 @@ describe('Testing all functions in run file.', () => {
|
|||
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Windows', (arch) => {
|
||||
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', arch);
|
||||
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl);
|
||||
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlWindowsUrl);
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test('getStableKubectlVersion() - download stable version file, read version and return it', () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue