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 }