Skip to content

Commit

Permalink
Merge pull request #200 from snyk-labs/feat/include-image-cluster-res…
Browse files Browse the repository at this point in the history
…t-mapping

feat: include image cluster in V1 backfill for feature parity
  • Loading branch information
lili2311 authored Oct 5, 2023
2 parents 4cb2c1e + cbf5be3 commit c08f76d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pysnyk"
version = "0.9.14"
version = "0.9.15"
description = "A Python client for the Snyk API"
authors = [
"Gareth Rushgrove <[email protected]>",
Expand Down
9 changes: 9 additions & 0 deletions snyk/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ def _rest_to_v1_response_format(self, project):
.get("attributes", {})
.get("url")
)
image_cluster = (
project.get("relationships", {})
.get("target", {})
.get("data", {})
.get("meta", {})
.get("integration_data", {})
.get("cluster")
)
return {
"name": attributes.get("name"),
"id": project.get("id"),
Expand All @@ -169,6 +177,7 @@ def _rest_to_v1_response_format(self, project):
"targetReference": attributes.get("target_reference"),
"branch": attributes.get("target_reference"),
"remoteRepoUrl": remote_repo_url,
"imageCluster": image_cluster,
"_tags": attributes.get("tags", []),
"importingUserId": project.get("relationships", {})
.get("importer", {})
Expand Down

0 comments on commit c08f76d

Please sign in to comment.