Skip to content

Commit be65c87

Browse files
wju-MSFTwju
andauthored
[ACR] Fix #31130: Fix extra version line in encodedTask created by file (#31153)
* fix extra version line in encodedTask created by file * add comment to call out version requirement for cmd source --------- Co-authored-by: wju <[email protected]>
1 parent 1c0a31b commit be65c87

File tree

4 files changed

+950
-282
lines changed

4 files changed

+950
-282
lines changed

src/azure-cli/azure/cli/command_modules/acr/_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,11 @@ def get_yaml_template(cmd_value, timeout, file):
248248
:param str timeout: The timeout for each step
249249
:param str file: The task definition
250250
"""
251-
yaml_template = "version: v1.1.0\n"
251+
yaml_template = ""
252+
# The default version is required to be added to cmd source Task.
253+
# The version is expeced to be included in the file for file source Task.
252254
if cmd_value:
255+
yaml_template += "version: v1.1.0\n"
253256
yaml_template += "steps: \n - cmd: {0}\n disableWorkingDirectoryOverride: true\n".format(cmd_value)
254257
if timeout:
255258
yaml_template += " timeout: {0}\n".format(timeout)

0 commit comments

Comments
 (0)