Compare commits

..

1 Commits

Author SHA1 Message Date
asgayle 0b282a825d Added support message 2022-10-17 11:15:16 -04:00
+2 -24
View File
@@ -10,11 +10,7 @@ export class PrivateKubectl extends Kubectl {
args.unshift('kubectl')
let kubectlCmd = args.join(' ')
let addFileFlag = false
let eo = <ExecOptions>{
silent: true,
failOnStdErr: false,
ignoreReturnCode: true
}
let eo = <ExecOptions>{silent}
if (this.containsFilenames(kubectlCmd)) {
// For private clusters, files will referenced solely by their basename
@@ -56,25 +52,7 @@ export class PrivateKubectl extends Kubectl {
core.debug(
`private cluster Kubectl run with invoke command: ${kubectlCmd}`
)
const runOutput = await getExecOutput(
'az',
[...privateClusterArgs, '-o', 'json'],
eo
)
const runObj: {logs: string; exitCode: number} = JSON.parse(
runOutput.stdout
)
if (!silent) core.info(runObj.logs)
if (runOutput.exitCode !== 0 && runObj.exitCode !== 0) {
throw Error(`failed private cluster Kubectl command: ${kubectlCmd}`)
}
return {
exitCode: runObj.exitCode,
stdout: runObj.logs,
stderr: ''
} as ExecOutput
return await getExecOutput('az', privateClusterArgs, eo)
}
private replaceFilnamesWithBasenames(kubectlCmd: string) {