From 193174d4fc9514dfd83d6e19663b3f0a965fcb38 Mon Sep 17 00:00:00 2001 From: Yury Kovalev Date: Wed, 29 Nov 2023 12:13:48 +0100 Subject: [PATCH] Rename addon name to id to align with ocm api --- .../dinosaur/pkg/api/dbapi/data_plane_cluster_status.go | 2 +- internal/dinosaur/pkg/api/private/api/openapi.yaml | 8 ++++---- ...del_data_plane_cluster_update_status_request_addons.go | 2 +- .../dinosaur/pkg/presenters/data_plane_cluster_status.go | 2 +- .../test/integration/data_plane_endpoints_test.go | 4 ++-- openapi/fleet-manager-private.yaml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go b/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go index 30636167f5..0bc54f6d4b 100644 --- a/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go +++ b/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go @@ -2,7 +2,7 @@ package dbapi // AddonInstallation represents the actual information about addons installed on the cluster type AddonInstallation struct { - Name string + ID string Version string SourceImage string PackageImage string diff --git a/internal/dinosaur/pkg/api/private/api/openapi.yaml b/internal/dinosaur/pkg/api/private/api/openapi.yaml index f783bdbbd6..ba988d80ad 100644 --- a/internal/dinosaur/pkg/api/private/api/openapi.yaml +++ b/internal/dinosaur/pkg/api/private/api/openapi.yaml @@ -347,13 +347,13 @@ components: example: addons: - packageImage: packageImage - name: name parametersSHA256Sum: parametersSHA256Sum + id: id sourceImage: sourceImage version: version - packageImage: packageImage - name: name parametersSHA256Sum: parametersSHA256Sum + id: id sourceImage: sourceImage version: version properties: @@ -518,12 +518,12 @@ components: DataPlaneClusterUpdateStatusRequest_addons: example: packageImage: packageImage - name: name parametersSHA256Sum: parametersSHA256Sum + id: id sourceImage: sourceImage version: version properties: - name: + id: type: string version: type: string diff --git a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go b/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go index 34d0aa1933..d13671c0ca 100644 --- a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go +++ b/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go @@ -12,7 +12,7 @@ package private // DataPlaneClusterUpdateStatusRequestAddons struct for DataPlaneClusterUpdateStatusRequestAddons type DataPlaneClusterUpdateStatusRequestAddons struct { - Name string `json:"name,omitempty"` + Id string `json:"id,omitempty"` Version string `json:"version,omitempty"` SourceImage string `json:"sourceImage,omitempty"` PackageImage string `json:"packageImage,omitempty"` diff --git a/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go b/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go index 329a476a18..3a6becb1ad 100644 --- a/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go +++ b/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go @@ -10,7 +10,7 @@ func ConvertDataPlaneClusterStatus(status private.DataPlaneClusterUpdateStatusRe var addonInstallations []dbapi.AddonInstallation for _, addon := range status.Addons { addonInstallations = append(addonInstallations, dbapi.AddonInstallation{ - Name: addon.Name, + ID: addon.Id, Version: addon.Version, SourceImage: addon.SourceImage, PackageImage: addon.PackageImage, diff --git a/internal/dinosaur/test/integration/data_plane_endpoints_test.go b/internal/dinosaur/test/integration/data_plane_endpoints_test.go index 6e7d88c7e2..25baf19b74 100644 --- a/internal/dinosaur/test/integration/data_plane_endpoints_test.go +++ b/internal/dinosaur/test/integration/data_plane_endpoints_test.go @@ -79,7 +79,7 @@ func TestDataPlaneClusterStatus(t *testing.T) { resp, err := privateClient.AgentClustersApi.UpdateAgentClusterStatus(ctx, clusterID, private.DataPlaneClusterUpdateStatusRequest{ Addons: []private.DataPlaneClusterUpdateStatusRequestAddons{ { - Name: "acs-fleetshard", + Id: "acs-fleetshard", Version: "0.2.0", SourceImage: "quay.io/osd-addons/acs-fleetshard-index@sha256:71eaaccb4d3962043eac953fb3c19a6cc6a88b18c472dd264efc5eb3da4960ac", PackageImage: "quay.io/osd-addons/acs-fleetshard-package@sha256:3e4fc039662b876c83dd4b48a9608d6867a12ab4932c5b7297bfbe50ba8ee61c", @@ -105,7 +105,7 @@ func TestDataPlaneClusterStatus(t *testing.T) { Expect(addonInstallations).To(HaveLen(1)) fleetshardAddon := addonInstallations[0] - Expect(fleetshardAddon.Name).To(Equal("acs-fleetshard")) + Expect(fleetshardAddon.ID).To(Equal("acs-fleetshard")) Expect(fleetshardAddon.Version).To(Equal("0.2.0")) Expect(fleetshardAddon.SourceImage).To(Equal("quay.io/osd-addons/acs-fleetshard-index@sha256:71eaaccb4d3962043eac953fb3c19a6cc6a88b18c472dd264efc5eb3da4960ac")) Expect(fleetshardAddon.PackageImage).To(Equal("quay.io/osd-addons/acs-fleetshard-package@sha256:3e4fc039662b876c83dd4b48a9608d6867a12ab4932c5b7297bfbe50ba8ee61c")) diff --git a/openapi/fleet-manager-private.yaml b/openapi/fleet-manager-private.yaml index 7be26497c8..7251a289a5 100644 --- a/openapi/fleet-manager-private.yaml +++ b/openapi/fleet-manager-private.yaml @@ -359,7 +359,7 @@ components: items: type: object properties: - name: + id: type: string version: type: string