mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-12 01:15:09 +08:00
added regex to check whitespace
This commit is contained in:
parent
36041268eb
commit
ce6bc40bc4
@ -8,8 +8,6 @@ export class DockerExec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async pull(image: string, args: string[], silent?: boolean) {
|
public async pull(image: string, args: string[], silent?: boolean) {
|
||||||
image = image.replace(/^[ ]+/g, '') //Remove whitespace at beginning of the string
|
|
||||||
image = image.replace(/[ ]+$/g, '') //Remove whitespace at end of the string
|
|
||||||
const result = await this.execute(['pull', image, ...args], silent)
|
const result = await this.execute(['pull', image, ...args], silent)
|
||||||
if (result.stderr != '' || result.exitCode != 0) {
|
if (result.stderr != '' || result.exitCode != 0) {
|
||||||
throw new Error(`docker images pull failed: ${result.stderr}`)
|
throw new Error(`docker images pull failed: ${result.stderr}`)
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export async function getDeploymentConfig(): Promise<DeploymentConfig> {
|
|||||||
|
|
||||||
let imageNames = core.getInput('images').split('\n') || []
|
let imageNames = core.getInput('images').split('\n') || []
|
||||||
imageNames.forEach((element) => {
|
imageNames.forEach((element) => {
|
||||||
if (element == ' ' || '') {
|
if (element === null || '/^s+$/') {
|
||||||
imageNames.pop()
|
imageNames.pop()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user