add uncloud machine token command to print machine token to add machine to cluster

This commit is contained in:
Pavel Sviderski committed 2024-09-05 16:13:27 +10:00
1 parent 4656bdd132
commit 945eff471b
9 files changed
+327 -42

No files matched your search

+5
View File
@@ -35,6 +35,11 @@ type PeerConfig struct {
PublicKey secret.Secret
}
func (c Config) IsConfigured() bool {
return c.Subnet != (netip.Prefix{}) && c.ManagementIP != (netip.Addr{}) &&
c.PrivateKey != nil && c.PublicKey != nil
}
func (c Config) toDeviceConfig() (wgtypes.Config, error) {
privateKey, err := wgtypes.NewKey(c.PrivateKey)
if err != nil {