Add skip tls flag (#260)

This commit is contained in:
Oliver King
2022-11-23 12:59:45 -05:00
committed by GitHub
parent c875a14bde
commit 47445fb82f
6 changed files with 42 additions and 11 deletions
+17
View File
@@ -353,4 +353,21 @@ describe('Kubectl class', () => {
const result = await kubectl.getNewReplicaSet(deployment)
expect(result).toBe(name)
})
it('executes with constructor flags', async () => {
const skipTls = true
const kubectl = new Kubectl(kubectlPath, testNamespace, skipTls)
jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
return {exitCode: 0, stderr: '', stdout: ''}
})
const command = 'command'
kubectl.executeCommand(command)
expect(exec.getExecOutput).toBeCalledWith(
kubectlPath,
[command, '--insecure-skip-tls-verify', '--namespace', testNamespace],
{silent: false}
)
})
})