mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-24 05:29:26 +08:00
Resolved issue with Canary deploy (#247)
This commit is contained in:
+14
-8
@@ -3,6 +3,7 @@ import {createInlineArray} from '../utilities/arrayUtils'
|
||||
import * as core from '@actions/core'
|
||||
import * as toolCache from '@actions/tool-cache'
|
||||
import * as io from '@actions/io'
|
||||
import {exec} from 'child_process'
|
||||
|
||||
export interface Resource {
|
||||
name: string
|
||||
@@ -142,14 +143,16 @@ export class Kubectl {
|
||||
|
||||
public async getResource(
|
||||
resourceType: string,
|
||||
name: string
|
||||
name: string,
|
||||
silentFailure: boolean = false
|
||||
): Promise<ExecOutput> {
|
||||
return await this.execute([
|
||||
'get',
|
||||
`${resourceType}/${name}`,
|
||||
'-o',
|
||||
'json'
|
||||
])
|
||||
core.debug(
|
||||
'fetching resource of type ' + resourceType + ' and name ' + name
|
||||
)
|
||||
return await this.execute(
|
||||
['get', `${resourceType}/${name}`, '-o', 'json'],
|
||||
silentFailure
|
||||
)
|
||||
}
|
||||
|
||||
public executeCommand(command: string, args?: string) {
|
||||
@@ -170,7 +173,10 @@ export class Kubectl {
|
||||
args = args.concat(['--namespace', this.namespace])
|
||||
}
|
||||
core.debug(`Kubectl run with command: ${this.kubectlPath} ${args}`)
|
||||
return await getExecOutput(this.kubectlPath, args, {silent})
|
||||
|
||||
return await getExecOutput(this.kubectlPath, args, {
|
||||
silent
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user