Skip to content

Commit

Permalink
Merge pull request #118 from uc-cdis/fix/metadata_label_parsing
Browse files Browse the repository at this point in the history
Fix/metadata label parsing
  • Loading branch information
pieterlukasse authored Nov 15, 2023
2 parents 95d0a91 + 7ce1f9a commit a136ab3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/argowrapper/engine/argo_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def get_workflows_for_label_selector(self, label_selector: str) -> List[Dict]:
namespace=ARGO_NAMESPACE,
list_options_label_selector=label_selector,
_check_return_type=False,
fields="items.metadata.name,items.metadata.namespace,items.metadata.annotations,items.metadata.uid,items.metadata.creationTimestamp,items.spec.arguments,items.spec.shutdown,items.status.phase,items.status.startedAt,items.status.finishedAt",
fields="items.metadata.name,items.metadata.namespace,items.metadata.annotations,items.metadata.uid,items.metadata.creationTimestamp,items.metadata.labels,items.spec.arguments,items.spec.shutdown,items.status.phase,items.status.startedAt,items.status.finishedAt",
)
archived_workflow_list_return = (
self.archive_api_instance.list_archived_workflows(
Expand Down
2 changes: 1 addition & 1 deletion src/argowrapper/engine/helpers/argo_engine_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def parse_list_item(
result["wf_name"] = (
workflow_details["metadata"].get("annotations", {}).get("workflow_name")
)
result[GEN3_TEAM_PROJECT_METADATA_LABEL] = (
result[GEN3_TEAM_PROJECT_METADATA_LABEL] = convert_pod_label_to_gen3teamproject(
workflow_details["metadata"]
.get("labels")
.get(GEN3_TEAM_PROJECT_METADATA_LABEL)
Expand Down
4 changes: 3 additions & 1 deletion test/test_argo_engine_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ def test_parse_list_item():
"creationTimestamp": "test_creationtime",
"labels": {
GEN3_USER_METADATA_LABEL: "dummyuser",
GEN3_TEAM_PROJECT_METADATA_LABEL: "dummyteam",
GEN3_TEAM_PROJECT_METADATA_LABEL: argo_engine_helper.convert_gen3teamproject_to_pod_label(
"dummyteam"
),
},
},
"spec": {"shutdown": "Terminate"},
Expand Down

0 comments on commit a136ab3

Please sign in to comment.