mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-22 11:29:28 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b307b2cde9 | |||
| e4d3021456 | |||
| 57d0489e1f |
@@ -471,3 +471,7 @@ provided by the bot. You will only need to do this once across all repos using o
|
|||||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
||||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
||||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
k8s-deploy is an open source project that is [**not** covered by the Microsoft Azure support policy](https://support.microsoft.com/en-us/help/2941892/support-for-linux-and-open-source-technology-in-azure). [Please search open issues here](https://github.com/Azure/k8s-deploy/issues), and if your issue isn't already represented please [open a new one](https://github.com/Azure/k8s-deploy/issues/new/choose). The project maintainers will respond to the best of their abilities.
|
||||||
|
|||||||
@@ -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}
|
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
|
||||||
@@ -52,7 +56,25 @@ export class PrivateKubectl extends Kubectl {
|
|||||||
core.debug(
|
core.debug(
|
||||||
`private cluster Kubectl run with invoke command: ${kubectlCmd}`
|
`private cluster Kubectl run with invoke command: ${kubectlCmd}`
|
||||||
)
|
)
|
||||||
return await getExecOutput('az', privateClusterArgs, eo)
|
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
private replaceFilnamesWithBasenames(kubectlCmd: string) {
|
private replaceFilnamesWithBasenames(kubectlCmd: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user