Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Dec 12, 2024
1 parent 008bf6c commit 828c281
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hooks/moduleconfig_labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def generate_config(self) -> dict:
"nameSelector": {
"matchNames": [self.module_name]
},
"group": "main",
"includeSnapshotsFrom": [self.SNAPSHOT_NAME],
"jqFilter": '{"labels": .metadata.labels}',
"queue": f"/modules/{self.module_name}/{self.SNAPSHOT_NAME}",
"keepFullObjectsInMemory": False
Expand All @@ -53,7 +53,7 @@ def reconcile(self) -> Callable[[hook.Context], None]:
def r(ctx: hook.Context):
labels = {}
if (snaps := ctx.snapshots.get(self.SNAPSHOT_NAME, [])) and len(snaps) > 0:
labels = snaps[0]["filterResult"]["labels"]
labels = snaps[0]["filterResult"].get("labels", {})

if labels.get(self.LABEL, "") == self.module_name:
return
Expand Down

0 comments on commit 828c281

Please sign in to comment.