Skip to content

Commit

Permalink
fix: scheduling tag retrieval (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
julesbertrand authored Oct 5, 2023
1 parent 0226088 commit 11347ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions deployer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ def deploy( # noqa: C901
parameter_values, input_artifacts = load_config(config_filepath)

if compile:
with console.status("Compiling pipeline...\n"):
with console.status("Compiling pipeline..."):
deployer.compile()

if upload:
with console.status("Uploading pipeline...\n"):
with console.status("Uploading pipeline..."):
deployer.upload_to_registry(tags=tags)

if run:
with console.status("Running pipeline...\n"):
with console.status("Running pipeline..."):
deployer.run(
enable_caching=enable_caching,
parameter_values=parameter_values,
Expand All @@ -226,7 +226,7 @@ def deploy( # noqa: C901
)

if schedule:
with console.status("Scheduling pipeline...\n"):
with console.status("Scheduling pipeline..."):
cron = cron.replace("-", " ") # ugly fix to allow cron expression as env variable
deployer.schedule(
cron=cron,
Expand Down
7 changes: 4 additions & 3 deletions deployer/pipeline_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,14 @@ def schedule(

if tag:
client = RegistryClient(host=self.gar_host)
package_name = self.pipeline_name.replace("_", "-")
try:
tag_metadata = client.get_tag(package_name=self.pipeline_name, tag=tag)
tag_metadata = client.get_tag(package_name=package_name, tag=tag)
except HTTPError as e:
tags_list = client.list_tags(self.pipeline_name)
tags_list = client.list_tags(package_name)
tags_list_parsed = [x["name"].split("/")[-1] for x in tags_list]
raise TagNotFoundError(
f"Tag {tag} not found for package {self.gar_host}/{self.pipeline_name}.\
f"Tag {tag} not found for package {self.gar_host}/{package_name}.\
Available tags: {tags_list_parsed}"
) from e

Expand Down

0 comments on commit 11347ba

Please sign in to comment.