mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-09 23:32:16 +08:00
add proper output
This commit is contained in:
parent
e4d3021456
commit
b307b2cde9
@ -10,7 +10,11 @@ export class PrivateKubectl extends Kubectl {
|
|||||||
args.unshift('kubectl')
|
args.unshift('kubectl')
|
||||||
let kubectlCmd = args.join(' ')
|
let kubectlCmd = args.join(' ')
|
||||||
let addFileFlag = false
|
let addFileFlag = false
|
||||||
let eo = <ExecOptions>{silent: true}
|
let eo = <ExecOptions>{
|
||||||
|
silent: true,
|
||||||
|
failOnStdErr: false,
|
||||||
|
ignoreReturnCode: true
|
||||||
|
}
|
||||||
|
|
||||||
if (this.containsFilenames(kubectlCmd)) {
|
if (this.containsFilenames(kubectlCmd)) {
|
||||||
// For private clusters, files will referenced solely by their basename
|
// For private clusters, files will referenced solely by their basename
|
||||||
@ -62,16 +66,15 @@ export class PrivateKubectl extends Kubectl {
|
|||||||
runOutput.stdout
|
runOutput.stdout
|
||||||
)
|
)
|
||||||
if (!silent) core.info(runObj.logs)
|
if (!silent) core.info(runObj.logs)
|
||||||
if (runObj.exitCode !== 0) {
|
if (runOutput.exitCode !== 0 && runObj.exitCode !== 0) {
|
||||||
throw Error(`failed private cluster Kubectl command: ${kubectlCmd}`)
|
throw Error(`failed private cluster Kubectl command: ${kubectlCmd}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const output: ExecOutput = {
|
return {
|
||||||
exitCode: 0,
|
exitCode: runObj.exitCode,
|
||||||
stdout: '',
|
stdout: runObj.logs,
|
||||||
stderr: ''
|
stderr: ''
|
||||||
}
|
} as ExecOutput
|
||||||
return output
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private replaceFilnamesWithBasenames(kubectlCmd: string) {
|
private replaceFilnamesWithBasenames(kubectlCmd: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user