Skip to content

Commit c08f76d

Browse files
authored
Merge pull request #200 from snyk-labs/feat/include-image-cluster-rest-mapping
feat: include image cluster in V1 backfill for feature parity
2 parents 4cb2c1e + cbf5be3 commit c08f76d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pysnyk"
3-
version = "0.9.14"
3+
version = "0.9.15"
44
description = "A Python client for the Snyk API"
55
authors = [
66
"Gareth Rushgrove <[email protected]>",

snyk/managers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ def _rest_to_v1_response_format(self, project):
151151
.get("attributes", {})
152152
.get("url")
153153
)
154+
image_cluster = (
155+
project.get("relationships", {})
156+
.get("target", {})
157+
.get("data", {})
158+
.get("meta", {})
159+
.get("integration_data", {})
160+
.get("cluster")
161+
)
154162
return {
155163
"name": attributes.get("name"),
156164
"id": project.get("id"),
@@ -169,6 +177,7 @@ def _rest_to_v1_response_format(self, project):
169177
"targetReference": attributes.get("target_reference"),
170178
"branch": attributes.get("target_reference"),
171179
"remoteRepoUrl": remote_repo_url,
180+
"imageCluster": image_cluster,
172181
"_tags": attributes.get("tags", []),
173182
"importingUserId": project.get("relationships", {})
174183
.get("importer", {})

0 commit comments

Comments
 (0)