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
+13 -6
View File
@@ -171,18 +171,25 @@ export class Kubectl {
}
protected async execute(args: string[], silent: boolean = false) {
if (this.ignoreSSLErrors) {
args.push('--insecure-skip-tls-verify')
}
if (this.namespace) {
args = args.concat(['--namespace', this.namespace])
}
args = args.concat(this.getExecuteFlags())
core.debug(`Kubectl run with command: ${this.kubectlPath} ${args}`)
return await getExecOutput(this.kubectlPath, args, {
silent
})
}
protected getExecuteFlags(): string[] {
const flags = []
if (this.ignoreSSLErrors) {
flags.push('--insecure-skip-tls-verify')
}
if (this.namespace) {
flags.push('--namespace', this.namespace)
}
return flags
}
}
export async function getKubectlPath() {