diff --git a/src/subCommands/deploy/impl/function.ts b/src/subCommands/deploy/impl/function.ts index bd72bae1..0915f9cb 100644 --- a/src/subCommands/deploy/impl/function.ts +++ b/src/subCommands/deploy/impl/function.ts @@ -166,24 +166,22 @@ export default class Service extends Base { throw new Error('CustomContainerRuntime must have a valid image URL'); } if (Acr.isAcrRegistry(image)) { - const isExist = await this._getAcr().checkAcr(image); - if (!isExist) { + if (this.skipPush) { if (_.isEmpty(diffResult)) { this.needDeploy = true; return; } } else { - // eslint-disable-next-line no-lonely-if - if (!this.skipPush) { - tipsMsg = yellow( - `WARNING: You are pushing ${image} to overwrite an existing image tag.If this image tag is being used by any other functions, subsequent calls to these functions may fail.Please confirm if you want to continue.`, - ); - } else { - // eslint-disable-next-line no-lonely-if + const isExist = await this._getAcr().checkAcr(image); + if (!isExist) { if (_.isEmpty(diffResult)) { this.needDeploy = true; return; } + } else { + tipsMsg = yellow( + `WARNING: You are pushing ${image} to overwrite an existing image tag.If this image tag is being used by any other functions, subsequent calls to these functions may fail.Please confirm if you want to continue.`, + ); } } } diff --git a/src/subCommands/remove/index.ts b/src/subCommands/remove/index.ts index 612e63b2..ff132e22 100644 --- a/src/subCommands/remove/index.ts +++ b/src/subCommands/remove/index.ts @@ -49,7 +49,7 @@ export default class Remove { if (!this.functionName) { // throw new Error('Function name not specified, please specify --function-name'); logger.error('Function name not specified, please specify --function-name'); - this.functionName = "undefined_placeholder" + this.functionName = 'undefined_placeholder_not_exist_123456789'; } if (removeAll || needRemoveFunction === true) {