From c917b552a9bc25615b9f98af9309fb34908fdb83 Mon Sep 17 00:00:00 2001 From: yungbender Date: Thu, 19 Oct 2023 16:42:49 +0200 Subject: [PATCH] feat(manager): return satellite_managed flag in package/package_name/systems RHINENG-2627 --- docs/v3/openapi.json | 3 +++ manager/controllers/package_systems.go | 1 + manager/controllers/package_systems_export_test.go | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/v3/openapi.json b/docs/v3/openapi.json index 80daa6071..a87397e29 100644 --- a/docs/v3/openapi.json +++ b/docs/v3/openapi.json @@ -6519,6 +6519,9 @@ "rhsm": { "type": "string" }, + "satellite_managed": { + "type": "boolean" + }, "tags": { "type": "array", "items": { diff --git a/manager/controllers/package_systems.go b/manager/controllers/package_systems.go index e85c8c647..11bcb3300 100644 --- a/manager/controllers/package_systems.go +++ b/manager/controllers/package_systems.go @@ -40,6 +40,7 @@ type PackageSystemItemV2 struct { //nolint:lll type PackageSystemItemV3 struct { PackageSystemItemCommon + SystemSatelliteManaged BaselineIDAttr OSAttributes UpdateStatus string `json:"update_status" csv:"update_status" query:"update_status(spkg.update_data)" gorm:"column:update_status"` diff --git a/manager/controllers/package_systems_export_test.go b/manager/controllers/package_systems_export_test.go index 5aa100fe0..54717eadd 100644 --- a/manager/controllers/package_systems_export_test.go +++ b/manager/controllers/package_systems_export_test.go @@ -37,14 +37,14 @@ func TestPackageSystemsExportHandlerCSV(t *testing.T) { assert.Equal(t, 5, len(lines)) assert.Equal(t, "id,display_name,installed_evra,available_evra,updatable,tags,"+ - "baseline_name,baseline_uptodate,baseline_id,os,rhsm,update_status,groups", lines[0]) + "baseline_name,baseline_uptodate,satellite_managed,baseline_id,os,rhsm,update_status,groups", lines[0]) assert.Equal(t, "00000000-0000-0000-0000-000000000012,00000000-0000-0000-0000-000000000012,"+ "5.6.13-200.fc31.x86_64,5.10.13-200.fc31.x86_64,true,"+ - "\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,0,RHEL 8.1,8.1,Installable,[]", + "\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,false,0,RHEL 8.1,8.1,Installable,[]", lines[1]) assert.Equal(t, "00000000-0000-0000-0000-000000000013,00000000-0000-0000-0000-000000000013,"+ "5.6.13-200.fc31.x86_64,,false,\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,"+ - "0,RHEL 8.2,8.2,None,[]", lines[2]) + "false,0,RHEL 8.2,8.2,None,[]", lines[2]) } func TestPackageSystemsExportInvalidName(t *testing.T) {