From 47f7ab5236748641e2feb0485944956e84bc526b Mon Sep 17 00:00:00 2001 From: deviantony Date: Tue, 3 Oct 2023 10:18:59 +0000 Subject: [PATCH] fix: introduce required properties for lens namespace creation --- internal/api/core/v1/namespaces/create.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/api/core/v1/namespaces/create.go b/internal/api/core/v1/namespaces/create.go index e50efd4..23ecc01 100644 --- a/internal/api/core/v1/namespaces/create.go +++ b/internal/api/core/v1/namespaces/create.go @@ -10,6 +10,8 @@ import ( "github.com/portainer/k2d/internal/types" httputils "github.com/portainer/k2d/pkg/http" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/uuid" ) func (svc NamespaceService) CreateNamespace(r *restful.Request, w *restful.Response) { @@ -29,5 +31,9 @@ func (svc NamespaceService) CreateNamespace(r *restful.Request, w *restful.Respo svc.operations <- controller.NewOperation(namespace, controller.HighPriorityOperation, r.HeaderParameter(types.RequestIDHeader)) + namespace.CreationTimestamp = metav1.Now() + namespace.UID = uuid.NewUUID() + namespace.ResourceVersion = "1" + w.WriteAsJson(namespace) }