From 636b2ff1a779dce7fda90add317c4d6faadd42be Mon Sep 17 00:00:00 2001 From: abhishek9686 Date: Thu, 24 Oct 2024 12:47:53 +0400 Subject: [PATCH] create enrollment key on network creation --- logic/networks.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/logic/networks.go b/logic/networks.go index 14ad794e5..0cee5603c 100644 --- a/logic/networks.go +++ b/logic/networks.go @@ -8,9 +8,11 @@ import ( "sort" "strings" "sync" + "time" "github.com/c-robinson/iplib" validator "github.com/go-playground/validator/v10" + "github.com/google/uuid" "github.com/gravitl/netmaker/database" "github.com/gravitl/netmaker/logger" "github.com/gravitl/netmaker/logic/acls/nodeacls" @@ -233,6 +235,15 @@ func CreateNetwork(network models.Network) (models.Network, error) { storeNetworkInCache(network.NetID, network) } + _, _ = CreateEnrollmentKey( + 0, + time.Time{}, + []string{network.NetID}, + []string{network.NetID}, + true, + uuid.Nil, + ) + return network, nil }