From 4e672a17570956641c8169d87dd090b64dac065b Mon Sep 17 00:00:00 2001 From: Griffin Sullivan <48397354+Griffin-Sullivan@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:03:20 -0400 Subject: [PATCH] Add displayName and description to GetServiceDetails (#486) Signed-off-by: Griffin-Sullivan --- clients/ui/bff/internal/integrations/k8s.go | 27 +++++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/clients/ui/bff/internal/integrations/k8s.go b/clients/ui/bff/internal/integrations/k8s.go index 3399b763..9402fcf1 100644 --- a/clients/ui/bff/internal/integrations/k8s.go +++ b/clients/ui/bff/internal/integrations/k8s.go @@ -3,14 +3,15 @@ package integrations import ( "context" "fmt" - helper "github.com/kubeflow/model-registry/ui/bff/internal/helpers" - corev1 "k8s.io/api/core/v1" "log/slog" "os" + "time" + + helper "github.com/kubeflow/model-registry/ui/bff/internal/helpers" + corev1 "k8s.io/api/core/v1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - "time" ) const componentName = "model-registry-server" @@ -202,12 +203,22 @@ func (kc *KubernetesClient) GetServiceDetails() ([]ServiceDetails, error) { continue } - //TODO (acreasy) DisplayName and Description need to be included and not given a zero value once we - // know how this will be implemented. + displayName := service.Annotations["displayName"] + if displayName == "" { + kc.Logger.Error("service missing displayName annotation", "serviceName", service.Name) + } + + description := service.Annotations["description"] + if description == "" { + kc.Logger.Error("service missing description annotation", "serviceName", service.Name) + } + serviceDetails := ServiceDetails{ - Name: service.Name, - ClusterIP: service.Spec.ClusterIP, - HTTPPort: httpPort, + Name: service.Name, + DisplayName: displayName, + Description: description, + ClusterIP: service.Spec.ClusterIP, + HTTPPort: httpPort, } services = append(services, serviceDetails)