Skip to content

Commit

Permalink
Merge pull request #69 from portainer/fix-namespace-creation-lens
Browse files Browse the repository at this point in the history
fix: introduce required properties for lens namespace creation
  • Loading branch information
deviantony authored Oct 3, 2023
2 parents 6e1d903 + 47f7ab5 commit 3dc4209
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 3dc4209

Please sign in to comment.