Skip to content

Commit

Permalink
fix 28610548: create with dry run will now check if the workflow alre…
Browse files Browse the repository at this point in the history
…ady exists
  • Loading branch information
cegraybl committed Jul 9, 2024
1 parent b7c1cde commit 537eac6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/acrcssc/azext_acrcssc/cssc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _perform_continuous_patch_operation(cmd,

logger.debug('validations completed successfully.')
if dryrun:
acr_cssc_dry_run(cmd, registry=registry, config_file_path=config)
acr_cssc_dry_run(cmd, registry=registry, config_file_path=config, is_create=is_create)
else:
create_update_continuous_patch_v1(cmd, registry, config, cadence, dryrun, defer_immediate_run, is_create)

Expand Down
4 changes: 3 additions & 1 deletion src/acrcssc/azext_acrcssc/helper/_taskoperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ def list_continuous_patch_v1(cmd, registry):
return filtered_cssc_tasks


def acr_cssc_dry_run(cmd, registry, config_file_path):
def acr_cssc_dry_run(cmd, registry, config_file_path, is_create=True):
logger.debug("Entering acr_cssc_dry_run with parameters: %s %s", registry, config_file_path)

if config_file_path is None:
logger.error("--config parameter is needed to perform dry-run check.")
return
if is_create and check_continuous_task_exists(cmd, registry):
raise AzCLIError(f"{CONTINUOUS_PATCHING_WORKFLOW_NAME} workflow task already exists. Use 'az acr supply-chain workflow update' command to perform updates.")
try:
file_name = os.path.basename(config_file_path)
tmp_folder = os.path.join(os.getcwd(), tempfile.mkdtemp(prefix="cli_temp_cssc"))
Expand Down

0 comments on commit 537eac6

Please sign in to comment.