mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-26 14:49:26 +08:00
Add skip tls flag (#260)
This commit is contained in:
+13
-6
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user