From febb8a029ce182f754a3f0f2c3373eb91081b17d Mon Sep 17 00:00:00 2001 From: Eder Ignatowicz Date: Wed, 6 Nov 2024 11:47:28 -0500 Subject: [PATCH] Fixing slog.Logger.Error arg err should be a string or a slog.Attr (possible missing key or value) --- clients/ui/bff/internal/mocks/k8s_mock.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/clients/ui/bff/internal/mocks/k8s_mock.go b/clients/ui/bff/internal/mocks/k8s_mock.go index bfdbfdaf4..7ea5bf425 100644 --- a/clients/ui/bff/internal/mocks/k8s_mock.go +++ b/clients/ui/bff/internal/mocks/k8s_mock.go @@ -3,14 +3,15 @@ package mocks import ( "context" "fmt" - k8s "github.com/kubeflow/model-registry/ui/bff/internal/integrations" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" "log/slog" "os" "path/filepath" "runtime" + + k8s "github.com/kubeflow/model-registry/ui/bff/internal/integrations" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" ) @@ -50,21 +51,21 @@ func NewKubernetesClient(logger *slog.Logger, ctx context.Context, cancel contex } cfg, err := testEnv.Start() if err != nil { - logger.Error("failed to start test environment", err) + logger.Error("failed to start test environment", slog.String("error", err.Error())) cancel() os.Exit(1) } mockK8sClient, err := client.New(cfg, client.Options{Scheme: scheme.Scheme}) if err != nil { - logger.Error("failed to create Kubernetes client", err) + logger.Error("failed to create Kubernetes client", slog.String("error", err.Error())) cancel() os.Exit(1) } err = setupMock(mockK8sClient, ctx) if err != nil { - logger.Error("failed on mock setup", err) + logger.Error("failed on mock setup", slog.String("error", err.Error())) cancel() os.Exit(1) }