Skip to content

Commit

Permalink
fix: introduce required properties for lens namespace creation
Browse files Browse the repository at this point in the history
  • Loading branch information
deviantony committed Oct 3, 2023
1 parent 6e1d903 commit 47f7ab5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/api/core/v1/namespaces/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
}

0 comments on commit 47f7ab5

Please sign in to comment.