From cbf5be31ea34fdeadbd0c59758a6230fe5f97272 Mon Sep 17 00:00:00 2001 From: ghe Date: Thu, 5 Oct 2023 13:26:51 +0100 Subject: [PATCH] feat: include image cluster in V1 backfill for feature parity --- pyproject.toml | 2 +- snyk/managers.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c6d1f43..5326ea5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ", diff --git a/snyk/managers.py b/snyk/managers.py index 5f658cf..4db2d89 100644 --- a/snyk/managers.py +++ b/snyk/managers.py @@ -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"), @@ -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", {})