Skip to content

Commit

Permalink
Add displayName and description to GetServiceDetails (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Griffin-Sullivan <[email protected]>
  • Loading branch information
Griffin-Sullivan authored Oct 17, 2024
1 parent cc9b33d commit 4e672a1
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions clients/ui/bff/internal/integrations/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4e672a1

Please sign in to comment.