Skip to content

Commit

Permalink
create enrollment key on network creation
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Oct 24, 2024
1 parent 6ccafe8 commit 636b2ff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions logic/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 636b2ff

Please sign in to comment.