From 859b77b2060f3043eb1e7cce440f69411089c928 Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 16:45:15 +0800 Subject: [PATCH 01/10] client --- pkg/client/cluster.go | 206 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 pkg/client/cluster.go diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go new file mode 100644 index 00000000..0ef3ddfb --- /dev/null +++ b/pkg/client/cluster.go @@ -0,0 +1,206 @@ +package client + +import ( + "context" + "encoding/base64" + "encoding/json" + "fmt" + "net/netip" + "strings" + "time" + + "github.com/psviderski/uncloud/internal/machine/api/pb" + "google.golang.org/protobuf/types/known/emptypb" +) + +// MachineToken contains the parsed enrollment token from a machine. +type MachineToken struct { + PublicKey []byte `json:"PublicKey"` + PublicIP netip.Addr `json:"PublicIP"` + Endpoints []netip.AddrPort `json:"Endpoints"` +} + +const machineTokenPrefix = "mtkn:" + +// ParseMachineToken decodes a machine enrollment token string. +func ParseMachineToken(s string) (MachineToken, error) { + if !strings.HasPrefix(s, machineTokenPrefix) { + return MachineToken{}, fmt.Errorf("invalid token prefix: expected %q", machineTokenPrefix) + } + decoded, err := base64.StdEncoding.DecodeString(s[len(machineTokenPrefix):]) + if err != nil { + return MachineToken{}, fmt.Errorf("decode token: %w", err) + } + var token MachineToken + if err := json.Unmarshal(decoded, &token); err != nil { + return MachineToken{}, fmt.Errorf("unmarshal token: %w", err) + } + return token, nil +} + +// ToNetworkConfig converts the token to a NetworkConfig for use with AddMachine. +func (t MachineToken) ToNetworkConfig() *pb.NetworkConfig { + return NewNetworkConfig(t.Endpoints, t.PublicKey) +} + +// NewNetworkConfig creates a NetworkConfig from Go-native types. +func NewNetworkConfig(endpoints []netip.AddrPort, publicKey []byte) *pb.NetworkConfig { + eps := make([]*pb.IPPort, len(endpoints)) + for i, ep := range endpoints { + eps[i] = pb.NewIPPort(ep) + } + return &pb.NetworkConfig{ + Endpoints: eps, + PublicKey: publicKey, + } +} + +// AdoptMachineOptions configures the AdoptMachine operation. +type AdoptMachineOptions struct { + // Name is the name to assign to the machine. If empty, a random name is generated. + Name string + // PublicIP configures the machine's public IP for ingress. + // nil = no ingress, zero value = use auto-detected IP from token, valid IP = use that IP. + PublicIP *netip.Addr + // WaitReady waits for the machine to be ready after joining. Defaults to true. + WaitReady bool + // WaitTimeout is how long to wait for the machine to be ready. Defaults to 5 minutes. + WaitTimeout time.Duration +} + +// AdoptMachine adds a new machine to this cluster. The newMachineClient should be +// connected to a machine with the daemon running but not yet joined to any cluster. +// +// This performs the full add flow: +// 1. Check prerequisites on new machine +// 2. Get enrollment token (WireGuard pubkey + endpoints) +// 3. Register machine in cluster (allocates subnet, generates ID) +// 4. Get peer configuration from existing cluster machines +// 5. Configure new machine to join with peer info +// 6. Optionally wait for the machine to be ready +func (cli *Client) AdoptMachine( + ctx context.Context, + newMachineClient *Client, + opts AdoptMachineOptions, +) (*pb.MachineInfo, error) { + if opts.WaitTimeout == 0 { + opts.WaitTimeout = 5 * time.Minute + } + + // 1. Check prerequisites + satisfied, errMsg, err := newMachineClient.CheckPrerequisites(ctx) + if err != nil { + return nil, fmt.Errorf("check prerequisites: %w", err) + } + if !satisfied { + return nil, fmt.Errorf("machine prerequisites not satisfied: %s", errMsg) + } + + // 2. Get enrollment token + tokenStr, err := newMachineClient.Token(ctx) + if err != nil { + return nil, fmt.Errorf("get machine token: %w", err) + } + token, err := ParseMachineToken(tokenStr) + if err != nil { + return nil, fmt.Errorf("parse machine token: %w", err) + } + + // 3. Determine public IP + var pubIP netip.Addr + if opts.PublicIP != nil { + if opts.PublicIP.IsValid() { + pubIP = *opts.PublicIP + } else { + pubIP = token.PublicIP + } + } + + // 4. Register machine in cluster + machineInfo, err := cli.AddMachine(ctx, opts.Name, token.ToNetworkConfig(), pubIP) + if err != nil { + return nil, fmt.Errorf("add machine to cluster: %w", err) + } + + // 5. Get store DB version for sync + var storeDBVersion int64 + resp, err := cli.MachineClient.InspectMachine(ctx, &emptypb.Empty{}) + if err == nil && len(resp.Machines) > 0 { + storeDBVersion = resp.Machines[0].StoreDbVersion + } + + // 6. Get other machines for peer config + machines, err := cli.ListMachines(ctx, nil) + if err != nil { + return nil, fmt.Errorf("list machines: %w", err) + } + others := make([]*pb.MachineInfo, 0, len(machines)-1) + for _, m := range machines { + if m.Machine.Id != machineInfo.Id { + others = append(others, m.Machine) + } + } + + // 7. Join cluster + if err := newMachineClient.JoinCluster(ctx, machineInfo, others, storeDBVersion); err != nil { + return nil, fmt.Errorf("join cluster: %w", err) + } + + // 8. Wait for ready + if opts.WaitReady { + if err := newMachineClient.WaitClusterReady(ctx, opts.WaitTimeout); err != nil { + return nil, fmt.Errorf("wait for machine ready: %w", err) + } + } + + return machineInfo, nil +} + +// Token returns the machine enrollment token. +func (cli *Client) Token(ctx context.Context) (string, error) { + resp, err := cli.MachineClient.Token(ctx, &emptypb.Empty{}) + if err != nil { + return "", err + } + return resp.Token, nil +} + +// CheckPrerequisites verifies the machine meets system requirements. +func (cli *Client) CheckPrerequisites(ctx context.Context) (satisfied bool, errMsg string, err error) { + resp, err := cli.MachineClient.CheckPrerequisites(ctx, &emptypb.Empty{}) + if err != nil { + return false, "", err + } + return resp.Satisfied, resp.Error, nil +} + +// AddMachine registers a new machine to the cluster. +func (cli *Client) AddMachine( + ctx context.Context, name string, network *pb.NetworkConfig, publicIP netip.Addr, +) (*pb.MachineInfo, error) { + req := &pb.AddMachineRequest{ + Name: name, + Network: network, + } + if publicIP.IsValid() { + req.PublicIp = pb.NewIP(publicIP) + } + resp, err := cli.ClusterClient.AddMachine(ctx, req) + if err != nil { + return nil, err + } + return resp.Machine, nil +} + +// JoinCluster configures the connected machine to join an existing cluster. +func (cli *Client) JoinCluster( + ctx context.Context, machine *pb.MachineInfo, others []*pb.MachineInfo, minDBVersion int64, +) error { + req := &pb.JoinClusterRequest{ + Machine: machine, + OtherMachines: others, + MinStoreDbVersion: minDBVersion, + } + _, err := cli.MachineClient.JoinCluster(ctx, req) + return err +} From 695085b369ecb24e802a635a420e62403166c337 Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 17:00:49 +0800 Subject: [PATCH 02/10] updates --- pkg/client/cluster.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go index 0ef3ddfb..172ddc30 100644 --- a/pkg/client/cluster.go +++ b/pkg/client/cluster.go @@ -204,3 +204,13 @@ func (cli *Client) JoinCluster( _, err := cli.MachineClient.JoinCluster(ctx, req) return err } + +// IsInitialized checks if the connected machine is already initialized as a cluster member. +// Returns the machine ID if initialized, empty string if not. +func (cli *Client) IsInitialized(ctx context.Context) (string, error) { + resp, err := cli.MachineClient.Inspect(ctx, &emptypb.Empty{}) + if err != nil { + return "", fmt.Errorf("inspect machine: %w", err) + } + return resp.Id, nil +} From 5c1c78965425a4f0873c79902aeeb620b0f801b1 Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 17:08:22 +0800 Subject: [PATCH 03/10] add machine info --- pkg/client/cluster.go | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go index 172ddc30..06f56235 100644 --- a/pkg/client/cluster.go +++ b/pkg/client/cluster.go @@ -13,6 +13,43 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// MachineInfo represents a machine in the cluster with Go-native types. +type MachineInfo struct { + ID string + Name string + Subnet netip.Prefix + ManagementIP netip.Addr + Endpoints []netip.AddrPort + PublicKey []byte + PublicIP netip.Addr +} + +// machineInfoFromPB converts internal pb.MachineInfo to public MachineInfo. +func machineInfoFromPB(m *pb.MachineInfo) *MachineInfo { + info := &MachineInfo{ + ID: m.Id, + Name: m.Name, + } + if m.Network != nil { + if m.Network.Subnet != nil { + info.Subnet, _ = m.Network.Subnet.ToPrefix() + } + if m.Network.ManagementIp != nil { + info.ManagementIP, _ = m.Network.ManagementIp.ToAddr() + } + for _, ep := range m.Network.Endpoints { + if addr, err := ep.ToAddrPort(); err == nil { + info.Endpoints = append(info.Endpoints, addr) + } + } + info.PublicKey = m.Network.PublicKey + } + if m.PublicIp != nil { + info.PublicIP, _ = m.PublicIp.ToAddr() + } + return info +} + // MachineToken contains the parsed enrollment token from a machine. type MachineToken struct { PublicKey []byte `json:"PublicKey"` @@ -78,11 +115,13 @@ type AdoptMachineOptions struct { // 4. Get peer configuration from existing cluster machines // 5. Configure new machine to join with peer info // 6. Optionally wait for the machine to be ready +// +// Returns a MachineInfo with Go-native types (no protobuf imports needed). func (cli *Client) AdoptMachine( ctx context.Context, newMachineClient *Client, opts AdoptMachineOptions, -) (*pb.MachineInfo, error) { +) (*MachineInfo, error) { if opts.WaitTimeout == 0 { opts.WaitTimeout = 5 * time.Minute } @@ -153,7 +192,7 @@ func (cli *Client) AdoptMachine( } } - return machineInfo, nil + return machineInfoFromPB(machineInfo), nil } // Token returns the machine enrollment token. From 07344154c70d0cfcb5977846c521fe2a200ee85a Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 18:00:18 +0800 Subject: [PATCH 04/10] fixes --- pkg/client/cluster.go | 255 ------------------------------------ pkg/client/ployz/cluster.go | 155 ++++++++++++++++++++++ 2 files changed, 155 insertions(+), 255 deletions(-) delete mode 100644 pkg/client/cluster.go create mode 100644 pkg/client/ployz/cluster.go diff --git a/pkg/client/cluster.go b/pkg/client/cluster.go deleted file mode 100644 index 06f56235..00000000 --- a/pkg/client/cluster.go +++ /dev/null @@ -1,255 +0,0 @@ -package client - -import ( - "context" - "encoding/base64" - "encoding/json" - "fmt" - "net/netip" - "strings" - "time" - - "github.com/psviderski/uncloud/internal/machine/api/pb" - "google.golang.org/protobuf/types/known/emptypb" -) - -// MachineInfo represents a machine in the cluster with Go-native types. -type MachineInfo struct { - ID string - Name string - Subnet netip.Prefix - ManagementIP netip.Addr - Endpoints []netip.AddrPort - PublicKey []byte - PublicIP netip.Addr -} - -// machineInfoFromPB converts internal pb.MachineInfo to public MachineInfo. -func machineInfoFromPB(m *pb.MachineInfo) *MachineInfo { - info := &MachineInfo{ - ID: m.Id, - Name: m.Name, - } - if m.Network != nil { - if m.Network.Subnet != nil { - info.Subnet, _ = m.Network.Subnet.ToPrefix() - } - if m.Network.ManagementIp != nil { - info.ManagementIP, _ = m.Network.ManagementIp.ToAddr() - } - for _, ep := range m.Network.Endpoints { - if addr, err := ep.ToAddrPort(); err == nil { - info.Endpoints = append(info.Endpoints, addr) - } - } - info.PublicKey = m.Network.PublicKey - } - if m.PublicIp != nil { - info.PublicIP, _ = m.PublicIp.ToAddr() - } - return info -} - -// MachineToken contains the parsed enrollment token from a machine. -type MachineToken struct { - PublicKey []byte `json:"PublicKey"` - PublicIP netip.Addr `json:"PublicIP"` - Endpoints []netip.AddrPort `json:"Endpoints"` -} - -const machineTokenPrefix = "mtkn:" - -// ParseMachineToken decodes a machine enrollment token string. -func ParseMachineToken(s string) (MachineToken, error) { - if !strings.HasPrefix(s, machineTokenPrefix) { - return MachineToken{}, fmt.Errorf("invalid token prefix: expected %q", machineTokenPrefix) - } - decoded, err := base64.StdEncoding.DecodeString(s[len(machineTokenPrefix):]) - if err != nil { - return MachineToken{}, fmt.Errorf("decode token: %w", err) - } - var token MachineToken - if err := json.Unmarshal(decoded, &token); err != nil { - return MachineToken{}, fmt.Errorf("unmarshal token: %w", err) - } - return token, nil -} - -// ToNetworkConfig converts the token to a NetworkConfig for use with AddMachine. -func (t MachineToken) ToNetworkConfig() *pb.NetworkConfig { - return NewNetworkConfig(t.Endpoints, t.PublicKey) -} - -// NewNetworkConfig creates a NetworkConfig from Go-native types. -func NewNetworkConfig(endpoints []netip.AddrPort, publicKey []byte) *pb.NetworkConfig { - eps := make([]*pb.IPPort, len(endpoints)) - for i, ep := range endpoints { - eps[i] = pb.NewIPPort(ep) - } - return &pb.NetworkConfig{ - Endpoints: eps, - PublicKey: publicKey, - } -} - -// AdoptMachineOptions configures the AdoptMachine operation. -type AdoptMachineOptions struct { - // Name is the name to assign to the machine. If empty, a random name is generated. - Name string - // PublicIP configures the machine's public IP for ingress. - // nil = no ingress, zero value = use auto-detected IP from token, valid IP = use that IP. - PublicIP *netip.Addr - // WaitReady waits for the machine to be ready after joining. Defaults to true. - WaitReady bool - // WaitTimeout is how long to wait for the machine to be ready. Defaults to 5 minutes. - WaitTimeout time.Duration -} - -// AdoptMachine adds a new machine to this cluster. The newMachineClient should be -// connected to a machine with the daemon running but not yet joined to any cluster. -// -// This performs the full add flow: -// 1. Check prerequisites on new machine -// 2. Get enrollment token (WireGuard pubkey + endpoints) -// 3. Register machine in cluster (allocates subnet, generates ID) -// 4. Get peer configuration from existing cluster machines -// 5. Configure new machine to join with peer info -// 6. Optionally wait for the machine to be ready -// -// Returns a MachineInfo with Go-native types (no protobuf imports needed). -func (cli *Client) AdoptMachine( - ctx context.Context, - newMachineClient *Client, - opts AdoptMachineOptions, -) (*MachineInfo, error) { - if opts.WaitTimeout == 0 { - opts.WaitTimeout = 5 * time.Minute - } - - // 1. Check prerequisites - satisfied, errMsg, err := newMachineClient.CheckPrerequisites(ctx) - if err != nil { - return nil, fmt.Errorf("check prerequisites: %w", err) - } - if !satisfied { - return nil, fmt.Errorf("machine prerequisites not satisfied: %s", errMsg) - } - - // 2. Get enrollment token - tokenStr, err := newMachineClient.Token(ctx) - if err != nil { - return nil, fmt.Errorf("get machine token: %w", err) - } - token, err := ParseMachineToken(tokenStr) - if err != nil { - return nil, fmt.Errorf("parse machine token: %w", err) - } - - // 3. Determine public IP - var pubIP netip.Addr - if opts.PublicIP != nil { - if opts.PublicIP.IsValid() { - pubIP = *opts.PublicIP - } else { - pubIP = token.PublicIP - } - } - - // 4. Register machine in cluster - machineInfo, err := cli.AddMachine(ctx, opts.Name, token.ToNetworkConfig(), pubIP) - if err != nil { - return nil, fmt.Errorf("add machine to cluster: %w", err) - } - - // 5. Get store DB version for sync - var storeDBVersion int64 - resp, err := cli.MachineClient.InspectMachine(ctx, &emptypb.Empty{}) - if err == nil && len(resp.Machines) > 0 { - storeDBVersion = resp.Machines[0].StoreDbVersion - } - - // 6. Get other machines for peer config - machines, err := cli.ListMachines(ctx, nil) - if err != nil { - return nil, fmt.Errorf("list machines: %w", err) - } - others := make([]*pb.MachineInfo, 0, len(machines)-1) - for _, m := range machines { - if m.Machine.Id != machineInfo.Id { - others = append(others, m.Machine) - } - } - - // 7. Join cluster - if err := newMachineClient.JoinCluster(ctx, machineInfo, others, storeDBVersion); err != nil { - return nil, fmt.Errorf("join cluster: %w", err) - } - - // 8. Wait for ready - if opts.WaitReady { - if err := newMachineClient.WaitClusterReady(ctx, opts.WaitTimeout); err != nil { - return nil, fmt.Errorf("wait for machine ready: %w", err) - } - } - - return machineInfoFromPB(machineInfo), nil -} - -// Token returns the machine enrollment token. -func (cli *Client) Token(ctx context.Context) (string, error) { - resp, err := cli.MachineClient.Token(ctx, &emptypb.Empty{}) - if err != nil { - return "", err - } - return resp.Token, nil -} - -// CheckPrerequisites verifies the machine meets system requirements. -func (cli *Client) CheckPrerequisites(ctx context.Context) (satisfied bool, errMsg string, err error) { - resp, err := cli.MachineClient.CheckPrerequisites(ctx, &emptypb.Empty{}) - if err != nil { - return false, "", err - } - return resp.Satisfied, resp.Error, nil -} - -// AddMachine registers a new machine to the cluster. -func (cli *Client) AddMachine( - ctx context.Context, name string, network *pb.NetworkConfig, publicIP netip.Addr, -) (*pb.MachineInfo, error) { - req := &pb.AddMachineRequest{ - Name: name, - Network: network, - } - if publicIP.IsValid() { - req.PublicIp = pb.NewIP(publicIP) - } - resp, err := cli.ClusterClient.AddMachine(ctx, req) - if err != nil { - return nil, err - } - return resp.Machine, nil -} - -// JoinCluster configures the connected machine to join an existing cluster. -func (cli *Client) JoinCluster( - ctx context.Context, machine *pb.MachineInfo, others []*pb.MachineInfo, minDBVersion int64, -) error { - req := &pb.JoinClusterRequest{ - Machine: machine, - OtherMachines: others, - MinStoreDbVersion: minDBVersion, - } - _, err := cli.MachineClient.JoinCluster(ctx, req) - return err -} - -// IsInitialized checks if the connected machine is already initialized as a cluster member. -// Returns the machine ID if initialized, empty string if not. -func (cli *Client) IsInitialized(ctx context.Context) (string, error) { - resp, err := cli.MachineClient.Inspect(ctx, &emptypb.Empty{}) - if err != nil { - return "", fmt.Errorf("inspect machine: %w", err) - } - return resp.Id, nil -} diff --git a/pkg/client/ployz/cluster.go b/pkg/client/ployz/cluster.go new file mode 100644 index 00000000..5e7b6d9f --- /dev/null +++ b/pkg/client/ployz/cluster.go @@ -0,0 +1,155 @@ +package client + +import ( + "context" + "errors" + "fmt" + "net/netip" + "time" + + "github.com/docker/compose/v2/pkg/progress" + "github.com/psviderski/uncloud/cmd/uncloud/caddy" + "github.com/psviderski/uncloud/internal/cli" + "github.com/psviderski/uncloud/internal/cli/config" + "github.com/psviderski/uncloud/pkg/api" + "github.com/psviderski/uncloud/pkg/client" +) + +type AddOptions struct { + Destination string + Name string + PublicIP string + SSHKey string + Version string +} + +const ( + // PublicIPNone is the value used to indicate removal of public IP + PublicIPNone = "none" +) + +func AddMachine(ctx context.Context, opts AddOptions) error { + uncli, err := cli.New("", nil, "") + if err != nil { + return fmt.Errorf("create cli: %w", err) + } + + user, host, port, err := config.SSHDestination(opts.Destination).Parse() + if err != nil { + return fmt.Errorf("parse remote machine: %w", err) + } + remoteMachine := &cli.RemoteMachine{ + User: user, + Host: host, + Port: port, + KeyPath: opts.SSHKey, + UseSSHCLI: false, + } + + return add(ctx, uncli, remoteMachine, opts) +} + +func add(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine, opts AddOptions) error { + var publicIP *netip.Addr + switch opts.PublicIP { + case "auto": + publicIP = &netip.Addr{} + case "", PublicIPNone: + publicIP = nil + default: + ip, err := netip.ParseAddr(opts.PublicIP) + if err != nil { + return fmt.Errorf("parse public IP: %w", err) + } + publicIP = &ip + } + + clusterClient, machineClient, err := uncli.AddMachine(ctx, cli.AddMachineOptions{ + MachineName: opts.Name, + PublicIP: publicIP, + RemoteMachine: remoteMachine, + SkipInstall: false, + Version: opts.Version, + AutoConfirm: true, + }) + if err != nil { + return err + } + defer clusterClient.Close() + defer machineClient.Close() + + // Wait for the cluster to be initialised on the machine to be able to deploy the Caddy service. + err = machineClient.WaitClusterReady(ctx, 5*time.Minute) + if err != nil { + return fmt.Errorf("wait for machine to join the cluster: %w", err) + } + fmt.Println("Machine joined the cluster.") + + // TODO: scale the existing Caddy service to the new machine instead of running a new deployment + // that may cause a small downtime. + // Deploy a Caddy service container to the added machine. If caddy service is already deployed on other machines, + // use the deployed image version. + // NOTE: We use the cluster client to inspect and scale the Caddy service because the newly added machine may have + // issues accessing the Machine API of existing machines in the cluster. + // See the issue for more details: https://github.com/psviderski/uncloud/issues/65. + caddyImage := "" + caddySvc, err := clusterClient.InspectService(ctx, client.CaddyServiceName) + if err != nil { + if errors.Is(err, api.ErrNotFound) { + // Caddy service is not deployed. + return nil + } + return fmt.Errorf("inspect caddy service: %w", err) + } + caddyImage = caddySvc.Containers[0].Container.Config.Image + // Find the latest created container and use its image. + var latestCreated time.Time + for _, c := range caddySvc.Containers[1:] { + created, err := time.Parse(time.RFC3339Nano, c.Container.Created) + if err != nil { + continue + } + if created.After(latestCreated) { + latestCreated = created + caddyImage = c.Container.Config.Image + } + } + + d, err := clusterClient.NewCaddyDeployment(caddyImage, "", api.Placement{}) + if err != nil { + return fmt.Errorf("create caddy deployment: %w", err) + } + + plan, err := d.Plan(ctx) + if err != nil { + return fmt.Errorf("plan caddy deployment: %w", err) + } + + fmt.Println() + if len(plan.Operations) == 0 { + fmt.Printf("%s service is up to date.\n", client.CaddyServiceName) + } else { + // Initialise a machine and container name resolver to properly format the plan output. + resolver, err := clusterClient.ServiceOperationNameResolver(ctx, caddySvc) + if err != nil { + return fmt.Errorf("create machine and container name resolver for service operations: %w", err) + } + + fmt.Println("caddy deployment plan:") + fmt.Println(plan.Format(resolver)) + fmt.Println() + + err = progress.RunWithTitle(ctx, func(ctx context.Context) error { + if _, err = d.Run(ctx); err != nil { + return fmt.Errorf("deploy caddy: %w", err) + } + return nil + }, uncli.ProgressOut(), fmt.Sprintf("Deploying service %s (%s mode)", d.Spec.Name, d.Spec.Mode)) + if err != nil { + return err + } + } + + fmt.Println() + return caddy.UpdateDomainRecords(ctx, machineClient, uncli.ProgressOut()) +} From ee3547ef86ad8e9c1bed4cfed932c6ea011c028d Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 19:00:59 +0800 Subject: [PATCH 05/10] asdf --- pkg/client/ployz/cluster.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/client/ployz/cluster.go b/pkg/client/ployz/cluster.go index 5e7b6d9f..875ae233 100644 --- a/pkg/client/ployz/cluster.go +++ b/pkg/client/ployz/cluster.go @@ -11,6 +11,7 @@ import ( "github.com/psviderski/uncloud/cmd/uncloud/caddy" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/cli/config" + "github.com/psviderski/uncloud/internal/machine" "github.com/psviderski/uncloud/pkg/api" "github.com/psviderski/uncloud/pkg/client" ) @@ -21,6 +22,7 @@ type AddOptions struct { PublicIP string SSHKey string Version string + SocketPath string } const ( @@ -29,7 +31,16 @@ const ( ) func AddMachine(ctx context.Context, opts AddOptions) error { - uncli, err := cli.New("", nil, "") + socketPath := opts.SocketPath + if socketPath == "" { + socketPath = machine.DefaultUncloudSockPath + } + + conn := &config.MachineConnection{ + Unix: socketPath, + } + + uncli, err := cli.New("", conn, "") if err != nil { return fmt.Errorf("create cli: %w", err) } From a275d517507aba3fcff741dae76c1e9608c3a356 Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 19:08:22 +0800 Subject: [PATCH 06/10] cloud --- pkg/client/ployz/cluster.go | 361 ++++++++++++++++++++++++++++++------ 1 file changed, 303 insertions(+), 58 deletions(-) diff --git a/pkg/client/ployz/cluster.go b/pkg/client/ployz/cluster.go index 875ae233..3e28519d 100644 --- a/pkg/client/ployz/cluster.go +++ b/pkg/client/ployz/cluster.go @@ -5,15 +5,25 @@ import ( "errors" "fmt" "net/netip" + "os" + "slices" + "strings" "time" + "github.com/cenkalti/backoff/v4" + "github.com/docker/cli/cli/streams" "github.com/docker/compose/v2/pkg/progress" "github.com/psviderski/uncloud/cmd/uncloud/caddy" "github.com/psviderski/uncloud/internal/cli" - "github.com/psviderski/uncloud/internal/cli/config" "github.com/psviderski/uncloud/internal/machine" + "github.com/psviderski/uncloud/internal/machine/api/pb" + "github.com/psviderski/uncloud/internal/sshexec" "github.com/psviderski/uncloud/pkg/api" "github.com/psviderski/uncloud/pkg/client" + "github.com/psviderski/uncloud/pkg/client/connector" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" ) type AddOptions struct { @@ -26,8 +36,12 @@ type AddOptions struct { } const ( - // PublicIPNone is the value used to indicate removal of public IP + // PublicIPNone is the value used to indicate removal of public IP. PublicIPNone = "none" + + installScriptURL = "https://raw.githubusercontent.com/psviderski/uncloud/refs/heads/main/scripts/install.sh" + rootUser = "root" + defaultSSHPort = 22 ) func AddMachine(ctx context.Context, opts AddOptions) error { @@ -36,74 +50,156 @@ func AddMachine(ctx context.Context, opts AddOptions) error { socketPath = machine.DefaultUncloudSockPath } - conn := &config.MachineConnection{ - Unix: socketPath, + // Connect to the existing cluster via Unix socket. + clusterClient, err := client.New(ctx, connector.NewUnixConnector(socketPath)) + if err != nil { + return fmt.Errorf("connect to cluster: %w", err) } + defer clusterClient.Close() - uncli, err := cli.New("", conn, "") + // Parse SSH destination. + user, host, port, err := parseSSHDestination(opts.Destination) if err != nil { - return fmt.Errorf("create cli: %w", err) + return fmt.Errorf("parse remote machine: %w", err) } - user, host, port, err := config.SSHDestination(opts.Destination).Parse() + // Provision and connect to the remote machine. + machineClient, err := provisionAndConnect(ctx, user, host, port, opts.SSHKey, opts.Version) if err != nil { - return fmt.Errorf("parse remote machine: %w", err) + return fmt.Errorf("provision machine: %w", err) } - remoteMachine := &cli.RemoteMachine{ - User: user, - Host: host, - Port: port, - KeyPath: opts.SSHKey, - UseSSHCLI: false, + defer machineClient.Close() + + // Check if the machine is already initialised as a cluster member. + minfo, err := machineClient.Inspect(ctx, &emptypb.Empty{}) + if err != nil { + return fmt.Errorf("inspect machine: %w", err) } + if minfo.Id != "" { + // Check if the machine is already a member of this cluster. + machines, err := clusterClient.ListMachines(ctx, nil) + if err != nil { + return fmt.Errorf("list cluster machines: %w", err) + } + if slices.ContainsFunc(machines, func(m *pb.MachineMember) bool { + return m.Machine.Id == minfo.Id + }) { + return fmt.Errorf("machine is already a member of this cluster (%s)", minfo.Name) + } - return add(ctx, uncli, remoteMachine, opts) -} + // Auto-confirm reset for programmatic usage. + if err = resetAndWaitMachine(ctx, machineClient.MachineClient); err != nil { + return err + } + } -func add(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine, opts AddOptions) error { - var publicIP *netip.Addr + // Check machine meets all necessary system requirements before proceeding. + checkResp, err := machineClient.MachineClient.CheckPrerequisites(ctx, &emptypb.Empty{}) + if err != nil { + if status.Convert(err).Code() != codes.Unimplemented { + return fmt.Errorf("check machine prerequisites: %w", err) + } + } else if !checkResp.Satisfied { + return fmt.Errorf("machine prerequisites not satisfied: %s", checkResp.Error) + } + + // Get machine token from the new machine. + tokenResp, err := machineClient.MachineClient.Token(ctx, &emptypb.Empty{}) + if err != nil { + return fmt.Errorf("get remote machine token: %w", err) + } + token, err := machine.ParseToken(tokenResp.Token) + if err != nil { + return fmt.Errorf("parse remote machine token: %w", err) + } + + // Parse public IP option. + var publicIPProto *pb.IP switch opts.PublicIP { case "auto": - publicIP = &netip.Addr{} + if token.PublicIP.IsValid() { + publicIPProto = pb.NewIP(token.PublicIP) + } case "", PublicIPNone: - publicIP = nil + publicIPProto = nil default: ip, err := netip.ParseAddr(opts.PublicIP) if err != nil { return fmt.Errorf("parse public IP: %w", err) } - publicIP = &ip + publicIPProto = pb.NewIP(ip) } - clusterClient, machineClient, err := uncli.AddMachine(ctx, cli.AddMachineOptions{ - MachineName: opts.Name, - PublicIP: publicIP, - RemoteMachine: remoteMachine, - SkipInstall: false, - Version: opts.Version, - AutoConfirm: true, - }) + // Register the machine in the cluster using its public key and endpoints from the token. + endpoints := make([]*pb.IPPort, len(token.Endpoints)) + for i, addrPort := range token.Endpoints { + endpoints[i] = pb.NewIPPort(addrPort) + } + addReq := &pb.AddMachineRequest{ + Name: opts.Name, + Network: &pb.NetworkConfig{ + Endpoints: endpoints, + PublicKey: token.PublicKey, + }, + PublicIp: publicIPProto, + } + + addResp, err := clusterClient.ClusterClient.AddMachine(ctx, addReq) if err != nil { - return err + return fmt.Errorf("add machine to cluster: %w", err) } - defer clusterClient.Close() - defer machineClient.Close() - // Wait for the cluster to be initialised on the machine to be able to deploy the Caddy service. - err = machineClient.WaitClusterReady(ctx, 5*time.Minute) + // Get the current store DB version from the cluster to pass to the join request. + var storeDBVersion int64 + inspectResp, err := clusterClient.MachineClient.InspectMachine(ctx, &emptypb.Empty{}) + if err != nil { + if status.Convert(err).Code() != codes.Unimplemented { + return fmt.Errorf("inspect current cluster machine: %w", err) + } + } else { + storeDBVersion = inspectResp.Machines[0].StoreDbVersion + } + + // Get the most up-to-date list of other machines in the cluster to include them in the join request. + machines, err := clusterClient.ListMachines(ctx, nil) if err != nil { + return fmt.Errorf("list cluster machines: %w", err) + } + otherMachines := make([]*pb.MachineInfo, 0, len(machines)-1) + for _, m := range machines { + if m.Machine.Id != addResp.Machine.Id { + otherMachines = append(otherMachines, m.Machine) + } + } + + // Configure the remote machine to join the cluster. + joinReq := &pb.JoinClusterRequest{ + Machine: addResp.Machine, + OtherMachines: otherMachines, + MinStoreDbVersion: storeDBVersion, + } + if _, err = machineClient.MachineClient.JoinCluster(ctx, joinReq); err != nil { + return fmt.Errorf("join cluster: %w", err) + } + + fmt.Printf("Machine '%s' added to the cluster.\n", addResp.Machine.Name) + + // Wait for the cluster to be initialised on the machine to be able to deploy the Caddy service. + if err = machineClient.WaitClusterReady(ctx, 5*time.Minute); err != nil { return fmt.Errorf("wait for machine to join the cluster: %w", err) } fmt.Println("Machine joined the cluster.") - // TODO: scale the existing Caddy service to the new machine instead of running a new deployment - // that may cause a small downtime. - // Deploy a Caddy service container to the added machine. If caddy service is already deployed on other machines, - // use the deployed image version. - // NOTE: We use the cluster client to inspect and scale the Caddy service because the newly added machine may have - // issues accessing the Machine API of existing machines in the cluster. - // See the issue for more details: https://github.com/psviderski/uncloud/issues/65. - caddyImage := "" + // Deploy Caddy service if it exists on other machines. + if err = deployCaddyIfNeeded(ctx, clusterClient); err != nil { + return err + } + + fmt.Println() + return caddy.UpdateDomainRecords(ctx, machineClient, progressOut()) +} + +func deployCaddyIfNeeded(ctx context.Context, clusterClient *client.Client) error { caddySvc, err := clusterClient.InspectService(ctx, client.CaddyServiceName) if err != nil { if errors.Is(err, api.ErrNotFound) { @@ -112,7 +208,8 @@ func add(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine, } return fmt.Errorf("inspect caddy service: %w", err) } - caddyImage = caddySvc.Containers[0].Container.Config.Image + + caddyImage := caddySvc.Containers[0].Container.Config.Image // Find the latest created container and use its image. var latestCreated time.Time for _, c := range caddySvc.Containers[1:] { @@ -139,28 +236,176 @@ func add(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine, fmt.Println() if len(plan.Operations) == 0 { fmt.Printf("%s service is up to date.\n", client.CaddyServiceName) + return nil + } + + // Initialise a machine and container name resolver to properly format the plan output. + resolver, err := clusterClient.ServiceOperationNameResolver(ctx, caddySvc) + if err != nil { + return fmt.Errorf("create machine and container name resolver for service operations: %w", err) + } + + fmt.Println("caddy deployment plan:") + fmt.Println(plan.Format(resolver)) + fmt.Println() + + err = progress.RunWithTitle(ctx, func(ctx context.Context) error { + if _, err = d.Run(ctx); err != nil { + return fmt.Errorf("deploy caddy: %w", err) + } + return nil + }, progressOut(), fmt.Sprintf("Deploying service %s (%s mode)", d.Spec.Name, d.Spec.Mode)) + + return err +} + +func provisionAndConnect(ctx context.Context, user, host string, port int, keyPath, version string) (*client.Client, error) { + // Connect via SSH. + sshClient, err := sshexec.Connect(user, host, port, keyPath) + // If the SSH connection using SSH agent fails and no key path is provided, try to use the default SSH key. + if err != nil && keyPath == "" { + keyPath = cli.DefaultSSHKeyPath + sshClient, err = sshexec.Connect(user, host, port, keyPath) + } + if err != nil { + return nil, fmt.Errorf("SSH login to remote machine %s@%s:%d: %w", user, host, port, err) + } + + // Provision the remote machine by installing the Uncloud daemon and dependencies over SSH. + exec := sshexec.NewRemote(sshClient) + if err = provisionMachine(ctx, exec, user, version); err != nil { + return nil, fmt.Errorf("provision machine: %w", err) + } + + // Create a machine API client over a new SSH connection (to pick up group membership changes). + var machineClient *client.Client + if user == rootUser { + machineClient, err = client.New(ctx, connector.NewSSHConnectorFromClient(sshClient)) } else { - // Initialise a machine and container name resolver to properly format the plan output. - resolver, err := clusterClient.ServiceOperationNameResolver(ctx, caddySvc) - if err != nil { - return fmt.Errorf("create machine and container name resolver for service operations: %w", err) + sshConfig := &connector.SSHConnectorConfig{ + User: user, + Host: host, + Port: port, + KeyPath: keyPath, } + machineClient, err = client.New(ctx, connector.NewSSHConnector(sshConfig)) + } + if err != nil { + return nil, fmt.Errorf("connect to remote machine: %w", err) + } - fmt.Println("caddy deployment plan:") - fmt.Println(plan.Format(resolver)) - fmt.Println() + return machineClient, nil +} - err = progress.RunWithTitle(ctx, func(ctx context.Context) error { - if _, err = d.Run(ctx); err != nil { - return fmt.Errorf("deploy caddy: %w", err) +func provisionMachine(ctx context.Context, exec sshexec.Executor, user, version string) error { + currentUser, err := exec.Run(ctx, "whoami") + if err != nil { + return fmt.Errorf("run whoami: %w", err) + } + + if currentUser != rootUser { + out, err := exec.Run(ctx, "sudo true") + if err != nil { + if strings.Contains(out, "password is required") { + return fmt.Errorf( + "user '%[1]s' requires a password for sudo, but Uncloud needs passwordless sudo or root access "+ + "to install and configure the uncloudd daemon on the remote machine.\n\n"+ + "Possible solutions:\n"+ + "1. Use root user or a user with passwordless sudo instead.\n"+ + "2. Configure passwordless sudo for the user '%[1]s' by running on the remote machine:\n"+ + " echo '%[1]s ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/%[1]s", + currentUser) } - return nil - }, uncli.ProgressOut(), fmt.Sprintf("Deploying service %s (%s mode)", d.Spec.Name, d.Spec.Mode)) + return fmt.Errorf("sudo command failed for user '%s': %w. "+ + "Please ensure the user has sudo privileges or use root user instead", currentUser, err) + } + } + + cmd := installCmd(user, version) + + fmt.Println("Downloading Uncloud install script:", installScriptURL) + + cmd = sshexec.QuoteCommand("bash", "-c", "set -o pipefail; "+cmd) + if err = exec.Stream(ctx, cmd, os.Stdout, os.Stderr); err != nil { + return fmt.Errorf("download and run install script: %w", err) + } + return nil +} + +func installCmd(user string, version string) string { + sudoPrefix := "" + var env []string + + if user != rootUser { + sudoPrefix = "sudo" + env = append(env, "UNCLOUD_GROUP_ADD_USER="+sshexec.Quote(user)) + } + if version != "" { + env = append(env, "UNCLOUD_VERSION="+sshexec.Quote(version)) + } + + envCmd := strings.Join(env, " ") + return fmt.Sprintf("curl -fsSL %s | %s %s bash", sshexec.Quote(installScriptURL), sudoPrefix, envCmd) +} + +func resetAndWaitMachine(ctx context.Context, machineClient pb.MachineClient) error { + if _, err := machineClient.Reset(ctx, &pb.ResetRequest{}); err != nil { + return fmt.Errorf("reset remote machine: %w. You can also manually run 'uncloud-uninstall' "+ + "on the remote machine to fully uninstall Uncloud from it", err) + } + + fmt.Println("Resetting the remote machine...") + if err := waitMachineReady(ctx, machineClient, 1*time.Minute); err != nil { + return fmt.Errorf("wait for machine to be ready after reset: %w", err) + } + + return nil +} + +func waitMachineReady(ctx context.Context, machineClient pb.MachineClient, timeout time.Duration) error { + boff := backoff.WithContext(backoff.NewExponentialBackOff( + backoff.WithMaxInterval(1*time.Second), + backoff.WithMaxElapsedTime(timeout), + ), ctx) + + inspect := func() error { + _, err := machineClient.Inspect(ctx, &emptypb.Empty{}) if err != nil { - return err + return fmt.Errorf("inspect machine: %w", err) } + return nil } + return backoff.Retry(inspect, boff) +} - fmt.Println() - return caddy.UpdateDomainRecords(ctx, machineClient, uncli.ProgressOut()) +func parseSSHDestination(dest string) (user, host string, port int, err error) { + port = defaultSSHPort + user = "root" + + // Handle user@host format. + if idx := strings.LastIndex(dest, "@"); idx != -1 { + user = dest[:idx] + dest = dest[idx+1:] + } + + // Handle host:port format. + if idx := strings.LastIndex(dest, ":"); idx != -1 { + host = dest[:idx] + _, err = fmt.Sscanf(dest[idx+1:], "%d", &port) + if err != nil { + return "", "", 0, fmt.Errorf("invalid port in destination: %s", dest) + } + } else { + host = dest + } + + if host == "" { + return "", "", 0, fmt.Errorf("empty host in destination") + } + + return user, host, port, nil +} + +func progressOut() *streams.Out { + return streams.NewOut(os.Stdout) } From eac5dc4dc0539e0705c0f6c768ad92de17067509 Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 19:27:11 +0800 Subject: [PATCH 07/10] handle ssh keys --- pkg/client/ployz/cluster.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/client/ployz/cluster.go b/pkg/client/ployz/cluster.go index 3e28519d..eff1c7ee 100644 --- a/pkg/client/ployz/cluster.go +++ b/pkg/client/ployz/cluster.go @@ -260,6 +260,26 @@ func deployCaddyIfNeeded(ctx context.Context, clusterClient *client.Client) erro } func provisionAndConnect(ctx context.Context, user, host string, port int, keyPath, version string) (*client.Client, error) { + // If keyPath is actually key content, write it to a temp file. + if strings.HasPrefix(keyPath, "-----BEGIN") { + tmpFile, err := os.CreateTemp("", "ssh-key-*") + if err != nil { + return nil, fmt.Errorf("create temp key file: %w", err) + } + if _, err := tmpFile.WriteString(keyPath); err != nil { + tmpFile.Close() + os.Remove(tmpFile.Name()) + return nil, fmt.Errorf("write temp key file: %w", err) + } + tmpFile.Close() + if err := os.Chmod(tmpFile.Name(), 0600); err != nil { + os.Remove(tmpFile.Name()) + return nil, fmt.Errorf("chmod temp key file: %w", err) + } + keyPath = tmpFile.Name() + defer os.Remove(keyPath) + } + // Connect via SSH. sshClient, err := sshexec.Connect(user, host, port, keyPath) // If the SSH connection using SSH agent fails and no key path is provided, try to use the default SSH key. From cc62bed3a4424135119780b155443cc29cc781da Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sun, 25 Jan 2026 19:27:49 +0800 Subject: [PATCH 08/10] asdf --- pkg/client/ployz/cluster.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/client/ployz/cluster.go b/pkg/client/ployz/cluster.go index eff1c7ee..d3783fe7 100644 --- a/pkg/client/ployz/cluster.go +++ b/pkg/client/ployz/cluster.go @@ -277,7 +277,8 @@ func provisionAndConnect(ctx context.Context, user, host string, port int, keyPa return nil, fmt.Errorf("chmod temp key file: %w", err) } keyPath = tmpFile.Name() - defer os.Remove(keyPath) + // Note: temp file is not cleaned up here as it may be needed by SSH connector later. + // OS will clean it up on reboot. } // Connect via SSH. From 919a85d48401f62799b275bc6e5ae370a0ef179b Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Sat, 24 Jan 2026 19:56:17 +0800 Subject: [PATCH 09/10] add a version command --- cmd/uncloud/main.go | 1 + cmd/uncloud/version.go | 57 ++++ internal/machine/api/pb/machine.pb.go | 359 ++++++++++++--------- internal/machine/api/pb/machine.proto | 6 + internal/machine/api/pb/machine_grpc.pb.go | 42 ++- internal/machine/machine.go | 8 + pkg/client/machine.go | 9 + 7 files changed, 336 insertions(+), 146 deletions(-) create mode 100644 cmd/uncloud/version.go diff --git a/cmd/uncloud/main.go b/cmd/uncloud/main.go index 819af02c..9d307529 100644 --- a/cmd/uncloud/main.go +++ b/cmd/uncloud/main.go @@ -119,6 +119,7 @@ func main() { NewDocsCommand(), NewImagesCommand(), NewPsCommand(), + NewVersionCommand(), caddy.NewRootCommand(), cmdcontext.NewRootCommand(), dns.NewRootCommand(), diff --git a/cmd/uncloud/version.go b/cmd/uncloud/version.go new file mode 100644 index 00000000..79cc72e3 --- /dev/null +++ b/cmd/uncloud/version.go @@ -0,0 +1,57 @@ +package main + +import ( + "context" + "fmt" + + "github.com/psviderski/uncloud/internal/cli" + "github.com/psviderski/uncloud/internal/version" + "github.com/spf13/cobra" +) + +func NewVersionCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "version", + Short: "Show client and server version information.", + Long: `Show version information for both the local client and the connected server. + +The client version is always shown. If connected to a cluster, the server (daemon) +version is also displayed.`, + RunE: func(cmd *cobra.Command, args []string) error { + uncli := cmd.Context().Value("cli").(*cli.CLI) + return runVersion(cmd.Context(), uncli) + }, + } + return cmd +} + +func runVersion(ctx context.Context, uncli *cli.CLI) error { + fmt.Printf("Client: %s\n", versionOrDev(version.String())) + + // Try to connect to the cluster to get the server version. + clusterClient, err := uncli.ConnectClusterWithOptions(ctx, cli.ConnectOptions{ + ShowProgress: false, + }) + if err != nil { + fmt.Printf("Server: %s\n", "(not connected)") + return nil + } + defer clusterClient.Close() + + serverVersion, err := clusterClient.GetVersion(ctx) + if err != nil { + fmt.Printf("Server: %s\n", "(unavailable)") + return nil + } + + fmt.Printf("Server: %s\n", versionOrDev(serverVersion)) + return nil +} + +// versionOrDev returns "(dev)" if the version is empty, otherwise returns the version as-is. +func versionOrDev(v string) string { + if v == "" { + return "(dev)" + } + return v +} diff --git a/internal/machine/api/pb/machine.pb.go b/internal/machine/api/pb/machine.pb.go index 5107ecff..6ebcd627 100644 --- a/internal/machine/api/pb/machine.pb.go +++ b/internal/machine/api/pb/machine.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.3 +// protoc v5.29.3 // source: internal/machine/api/pb/machine.proto package pb @@ -221,6 +221,53 @@ func (x *CheckPrerequisitesResponse) GetError() string { return "" } +type GetVersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *GetVersionResponse) Reset() { + *x = GetVersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersionResponse) ProtoMessage() {} + +func (x *GetVersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetVersionResponse.ProtoReflect.Descriptor instead. +func (*GetVersionResponse) Descriptor() ([]byte, []int) { + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{3} +} + +func (x *GetVersionResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type InitClusterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -238,7 +285,7 @@ type InitClusterRequest struct { func (x *InitClusterRequest) Reset() { *x = InitClusterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -251,7 +298,7 @@ func (x *InitClusterRequest) String() string { func (*InitClusterRequest) ProtoMessage() {} func (x *InitClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -264,7 +311,7 @@ func (x *InitClusterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InitClusterRequest.ProtoReflect.Descriptor instead. func (*InitClusterRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{3} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{4} } func (x *InitClusterRequest) GetMachineName() string { @@ -329,7 +376,7 @@ type InitClusterResponse struct { func (x *InitClusterResponse) Reset() { *x = InitClusterResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -342,7 +389,7 @@ func (x *InitClusterResponse) String() string { func (*InitClusterResponse) ProtoMessage() {} func (x *InitClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -355,7 +402,7 @@ func (x *InitClusterResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InitClusterResponse.ProtoReflect.Descriptor instead. func (*InitClusterResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{4} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{5} } func (x *InitClusterResponse) GetMachine() *MachineInfo { @@ -379,7 +426,7 @@ type JoinClusterRequest struct { func (x *JoinClusterRequest) Reset() { *x = JoinClusterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -392,7 +439,7 @@ func (x *JoinClusterRequest) String() string { func (*JoinClusterRequest) ProtoMessage() {} func (x *JoinClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -405,7 +452,7 @@ func (x *JoinClusterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use JoinClusterRequest.ProtoReflect.Descriptor instead. func (*JoinClusterRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{5} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{6} } func (x *JoinClusterRequest) GetMachine() *MachineInfo { @@ -441,7 +488,7 @@ type InspectMachineResponse struct { func (x *InspectMachineResponse) Reset() { *x = InspectMachineResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -454,7 +501,7 @@ func (x *InspectMachineResponse) String() string { func (*InspectMachineResponse) ProtoMessage() {} func (x *InspectMachineResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -467,7 +514,7 @@ func (x *InspectMachineResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectMachineResponse.ProtoReflect.Descriptor instead. func (*InspectMachineResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{6} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{7} } func (x *InspectMachineResponse) GetMachines() []*MachineDetails { @@ -491,7 +538,7 @@ type MachineDetails struct { func (x *MachineDetails) Reset() { *x = MachineDetails{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -504,7 +551,7 @@ func (x *MachineDetails) String() string { func (*MachineDetails) ProtoMessage() {} func (x *MachineDetails) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -517,7 +564,7 @@ func (x *MachineDetails) ProtoReflect() protoreflect.Message { // Deprecated: Use MachineDetails.ProtoReflect.Descriptor instead. func (*MachineDetails) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{7} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{8} } func (x *MachineDetails) GetMetadata() *Metadata { @@ -552,7 +599,7 @@ type TokenResponse struct { func (x *TokenResponse) Reset() { *x = TokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -565,7 +612,7 @@ func (x *TokenResponse) String() string { func (*TokenResponse) ProtoMessage() {} func (x *TokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -578,7 +625,7 @@ func (x *TokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TokenResponse.ProtoReflect.Descriptor instead. func (*TokenResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{8} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{9} } func (x *TokenResponse) GetToken() string { @@ -597,7 +644,7 @@ type ResetRequest struct { func (x *ResetRequest) Reset() { *x = ResetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -610,7 +657,7 @@ func (x *ResetRequest) String() string { func (*ResetRequest) ProtoMessage() {} func (x *ResetRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -623,7 +670,7 @@ func (x *ResetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetRequest.ProtoReflect.Descriptor instead. func (*ResetRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{9} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{10} } type Service struct { @@ -640,7 +687,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -653,7 +700,7 @@ func (x *Service) String() string { func (*Service) ProtoMessage() {} func (x *Service) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -666,7 +713,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{10} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{11} } func (x *Service) GetId() string { @@ -708,7 +755,7 @@ type InspectServiceRequest struct { func (x *InspectServiceRequest) Reset() { *x = InspectServiceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -721,7 +768,7 @@ func (x *InspectServiceRequest) String() string { func (*InspectServiceRequest) ProtoMessage() {} func (x *InspectServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -734,7 +781,7 @@ func (x *InspectServiceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectServiceRequest.ProtoReflect.Descriptor instead. func (*InspectServiceRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{11} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{12} } func (x *InspectServiceRequest) GetId() string { @@ -755,7 +802,7 @@ type InspectServiceResponse struct { func (x *InspectServiceResponse) Reset() { *x = InspectServiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -768,7 +815,7 @@ func (x *InspectServiceResponse) String() string { func (*InspectServiceResponse) ProtoMessage() {} func (x *InspectServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -781,7 +828,7 @@ func (x *InspectServiceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectServiceResponse.ProtoReflect.Descriptor instead. func (*InspectServiceResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{12} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{13} } func (x *InspectServiceResponse) GetService() *Service { @@ -805,7 +852,7 @@ type InspectWireGuardNetworkResponse struct { func (x *InspectWireGuardNetworkResponse) Reset() { *x = InspectWireGuardNetworkResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -818,7 +865,7 @@ func (x *InspectWireGuardNetworkResponse) String() string { func (*InspectWireGuardNetworkResponse) ProtoMessage() {} func (x *InspectWireGuardNetworkResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -831,7 +878,7 @@ func (x *InspectWireGuardNetworkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectWireGuardNetworkResponse.ProtoReflect.Descriptor instead. func (*InspectWireGuardNetworkResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{13} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{14} } func (x *InspectWireGuardNetworkResponse) GetInterfaceName() string { @@ -878,7 +925,7 @@ type WireGuardPeer struct { func (x *WireGuardPeer) Reset() { *x = WireGuardPeer{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -891,7 +938,7 @@ func (x *WireGuardPeer) String() string { func (*WireGuardPeer) ProtoMessage() {} func (x *WireGuardPeer) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -904,7 +951,7 @@ func (x *WireGuardPeer) ProtoReflect() protoreflect.Message { // Deprecated: Use WireGuardPeer.ProtoReflect.Descriptor instead. func (*WireGuardPeer) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{14} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{15} } func (x *WireGuardPeer) GetPublicKey() []byte { @@ -962,7 +1009,7 @@ type Service_Container struct { func (x *Service_Container) Reset() { *x = Service_Container{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -975,7 +1022,7 @@ func (x *Service_Container) String() string { func (*Service_Container) ProtoMessage() {} func (x *Service_Container) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -988,7 +1035,7 @@ func (x *Service_Container) ProtoReflect() protoreflect.Message { // Deprecated: Use Service_Container.ProtoReflect.Descriptor instead. func (*Service_Container) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{10, 0} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{11, 0} } func (x *Service_Container) GetMachineId() string { @@ -1041,7 +1088,10 @@ var file_internal_machine_api_pb_machine_proto_rawDesc = []byte{ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xc3, 0x01, 0x0a, 0x12, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2e, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc3, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, @@ -1133,49 +1183,53 @@ var file_internal_machine_api_pb_machine_proto_rawDesc = []byte{ 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, - 0x49, 0x70, 0x73, 0x32, 0xe3, 0x04, 0x0a, 0x07, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, + 0x49, 0x70, 0x73, 0x32, 0xa2, 0x05, 0x0a, 0x07, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x72, 0x65, 0x71, 0x75, 0x69, 0x73, 0x69, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x72, 0x65, 0x71, 0x75, - 0x69, 0x73, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, - 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, - 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3e, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, - 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x33, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, - 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x0e, 0x49, 0x6e, - 0x73, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x2e, 0x67, + 0x69, 0x73, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, - 0x63, 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x57, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, - 0x47, 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, - 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, - 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, - 0x6b, 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3e, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x33, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x0e, 0x49, 0x6e, 0x73, + 0x70, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, + 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x57, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, + 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, + 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, + 0x0e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x6b, + 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1190,69 +1244,72 @@ func file_internal_machine_api_pb_machine_proto_rawDescGZIP() []byte { return file_internal_machine_api_pb_machine_proto_rawDescData } -var file_internal_machine_api_pb_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_internal_machine_api_pb_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_internal_machine_api_pb_machine_proto_goTypes = []any{ (*MachineInfo)(nil), // 0: api.MachineInfo (*NetworkConfig)(nil), // 1: api.NetworkConfig (*CheckPrerequisitesResponse)(nil), // 2: api.CheckPrerequisitesResponse - (*InitClusterRequest)(nil), // 3: api.InitClusterRequest - (*InitClusterResponse)(nil), // 4: api.InitClusterResponse - (*JoinClusterRequest)(nil), // 5: api.JoinClusterRequest - (*InspectMachineResponse)(nil), // 6: api.InspectMachineResponse - (*MachineDetails)(nil), // 7: api.MachineDetails - (*TokenResponse)(nil), // 8: api.TokenResponse - (*ResetRequest)(nil), // 9: api.ResetRequest - (*Service)(nil), // 10: api.Service - (*InspectServiceRequest)(nil), // 11: api.InspectServiceRequest - (*InspectServiceResponse)(nil), // 12: api.InspectServiceResponse - (*InspectWireGuardNetworkResponse)(nil), // 13: api.InspectWireGuardNetworkResponse - (*WireGuardPeer)(nil), // 14: api.WireGuardPeer - (*Service_Container)(nil), // 15: api.Service.Container - (*IP)(nil), // 16: api.IP - (*IPPrefix)(nil), // 17: api.IPPrefix - (*IPPort)(nil), // 18: api.IPPort - (*Metadata)(nil), // 19: api.Metadata - (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 21: google.protobuf.Empty + (*GetVersionResponse)(nil), // 3: api.GetVersionResponse + (*InitClusterRequest)(nil), // 4: api.InitClusterRequest + (*InitClusterResponse)(nil), // 5: api.InitClusterResponse + (*JoinClusterRequest)(nil), // 6: api.JoinClusterRequest + (*InspectMachineResponse)(nil), // 7: api.InspectMachineResponse + (*MachineDetails)(nil), // 8: api.MachineDetails + (*TokenResponse)(nil), // 9: api.TokenResponse + (*ResetRequest)(nil), // 10: api.ResetRequest + (*Service)(nil), // 11: api.Service + (*InspectServiceRequest)(nil), // 12: api.InspectServiceRequest + (*InspectServiceResponse)(nil), // 13: api.InspectServiceResponse + (*InspectWireGuardNetworkResponse)(nil), // 14: api.InspectWireGuardNetworkResponse + (*WireGuardPeer)(nil), // 15: api.WireGuardPeer + (*Service_Container)(nil), // 16: api.Service.Container + (*IP)(nil), // 17: api.IP + (*IPPrefix)(nil), // 18: api.IPPrefix + (*IPPort)(nil), // 19: api.IPPort + (*Metadata)(nil), // 20: api.Metadata + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 22: google.protobuf.Empty } var file_internal_machine_api_pb_machine_proto_depIdxs = []int32{ 1, // 0: api.MachineInfo.network:type_name -> api.NetworkConfig - 16, // 1: api.MachineInfo.public_ip:type_name -> api.IP - 17, // 2: api.NetworkConfig.subnet:type_name -> api.IPPrefix - 16, // 3: api.NetworkConfig.management_ip:type_name -> api.IP - 18, // 4: api.NetworkConfig.endpoints:type_name -> api.IPPort - 17, // 5: api.InitClusterRequest.network:type_name -> api.IPPrefix - 16, // 6: api.InitClusterRequest.public_ip:type_name -> api.IP + 17, // 1: api.MachineInfo.public_ip:type_name -> api.IP + 18, // 2: api.NetworkConfig.subnet:type_name -> api.IPPrefix + 17, // 3: api.NetworkConfig.management_ip:type_name -> api.IP + 19, // 4: api.NetworkConfig.endpoints:type_name -> api.IPPort + 18, // 5: api.InitClusterRequest.network:type_name -> api.IPPrefix + 17, // 6: api.InitClusterRequest.public_ip:type_name -> api.IP 0, // 7: api.InitClusterResponse.machine:type_name -> api.MachineInfo 0, // 8: api.JoinClusterRequest.machine:type_name -> api.MachineInfo 0, // 9: api.JoinClusterRequest.other_machines:type_name -> api.MachineInfo - 7, // 10: api.InspectMachineResponse.machines:type_name -> api.MachineDetails - 19, // 11: api.MachineDetails.metadata:type_name -> api.Metadata + 8, // 10: api.InspectMachineResponse.machines:type_name -> api.MachineDetails + 20, // 11: api.MachineDetails.metadata:type_name -> api.Metadata 0, // 12: api.MachineDetails.machine:type_name -> api.MachineInfo - 15, // 13: api.Service.containers:type_name -> api.Service.Container - 10, // 14: api.InspectServiceResponse.service:type_name -> api.Service - 14, // 15: api.InspectWireGuardNetworkResponse.peers:type_name -> api.WireGuardPeer - 20, // 16: api.WireGuardPeer.last_handshake_time:type_name -> google.protobuf.Timestamp - 21, // 17: api.Machine.CheckPrerequisites:input_type -> google.protobuf.Empty - 3, // 18: api.Machine.InitCluster:input_type -> api.InitClusterRequest - 5, // 19: api.Machine.JoinCluster:input_type -> api.JoinClusterRequest - 21, // 20: api.Machine.Token:input_type -> google.protobuf.Empty - 21, // 21: api.Machine.Inspect:input_type -> google.protobuf.Empty - 21, // 22: api.Machine.InspectMachine:input_type -> google.protobuf.Empty - 21, // 23: api.Machine.InspectWireGuardNetwork:input_type -> google.protobuf.Empty - 9, // 24: api.Machine.Reset:input_type -> api.ResetRequest - 11, // 25: api.Machine.InspectService:input_type -> api.InspectServiceRequest - 2, // 26: api.Machine.CheckPrerequisites:output_type -> api.CheckPrerequisitesResponse - 4, // 27: api.Machine.InitCluster:output_type -> api.InitClusterResponse - 21, // 28: api.Machine.JoinCluster:output_type -> google.protobuf.Empty - 8, // 29: api.Machine.Token:output_type -> api.TokenResponse - 0, // 30: api.Machine.Inspect:output_type -> api.MachineInfo - 6, // 31: api.Machine.InspectMachine:output_type -> api.InspectMachineResponse - 13, // 32: api.Machine.InspectWireGuardNetwork:output_type -> api.InspectWireGuardNetworkResponse - 21, // 33: api.Machine.Reset:output_type -> google.protobuf.Empty - 12, // 34: api.Machine.InspectService:output_type -> api.InspectServiceResponse - 26, // [26:35] is the sub-list for method output_type - 17, // [17:26] is the sub-list for method input_type + 16, // 13: api.Service.containers:type_name -> api.Service.Container + 11, // 14: api.InspectServiceResponse.service:type_name -> api.Service + 15, // 15: api.InspectWireGuardNetworkResponse.peers:type_name -> api.WireGuardPeer + 21, // 16: api.WireGuardPeer.last_handshake_time:type_name -> google.protobuf.Timestamp + 22, // 17: api.Machine.CheckPrerequisites:input_type -> google.protobuf.Empty + 22, // 18: api.Machine.GetVersion:input_type -> google.protobuf.Empty + 4, // 19: api.Machine.InitCluster:input_type -> api.InitClusterRequest + 6, // 20: api.Machine.JoinCluster:input_type -> api.JoinClusterRequest + 22, // 21: api.Machine.Token:input_type -> google.protobuf.Empty + 22, // 22: api.Machine.Inspect:input_type -> google.protobuf.Empty + 22, // 23: api.Machine.InspectMachine:input_type -> google.protobuf.Empty + 22, // 24: api.Machine.InspectWireGuardNetwork:input_type -> google.protobuf.Empty + 10, // 25: api.Machine.Reset:input_type -> api.ResetRequest + 12, // 26: api.Machine.InspectService:input_type -> api.InspectServiceRequest + 2, // 27: api.Machine.CheckPrerequisites:output_type -> api.CheckPrerequisitesResponse + 3, // 28: api.Machine.GetVersion:output_type -> api.GetVersionResponse + 5, // 29: api.Machine.InitCluster:output_type -> api.InitClusterResponse + 22, // 30: api.Machine.JoinCluster:output_type -> google.protobuf.Empty + 9, // 31: api.Machine.Token:output_type -> api.TokenResponse + 0, // 32: api.Machine.Inspect:output_type -> api.MachineInfo + 7, // 33: api.Machine.InspectMachine:output_type -> api.InspectMachineResponse + 14, // 34: api.Machine.InspectWireGuardNetwork:output_type -> api.InspectWireGuardNetworkResponse + 22, // 35: api.Machine.Reset:output_type -> google.protobuf.Empty + 13, // 36: api.Machine.InspectService:output_type -> api.InspectServiceResponse + 27, // [27:37] is the sub-list for method output_type + 17, // [17:27] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name 17, // [17:17] is the sub-list for extension extendee 0, // [0:17] is the sub-list for field type_name @@ -1302,7 +1359,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*InitClusterRequest); i { + switch v := v.(*GetVersionResponse); i { case 0: return &v.state case 1: @@ -1314,7 +1371,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*InitClusterResponse); i { + switch v := v.(*InitClusterRequest); i { case 0: return &v.state case 1: @@ -1326,7 +1383,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*JoinClusterRequest); i { + switch v := v.(*InitClusterResponse); i { case 0: return &v.state case 1: @@ -1338,7 +1395,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*InspectMachineResponse); i { + switch v := v.(*JoinClusterRequest); i { case 0: return &v.state case 1: @@ -1350,7 +1407,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*MachineDetails); i { + switch v := v.(*InspectMachineResponse); i { case 0: return &v.state case 1: @@ -1362,7 +1419,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*TokenResponse); i { + switch v := v.(*MachineDetails); i { case 0: return &v.state case 1: @@ -1374,7 +1431,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*ResetRequest); i { + switch v := v.(*TokenResponse); i { case 0: return &v.state case 1: @@ -1386,7 +1443,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*Service); i { + switch v := v.(*ResetRequest); i { case 0: return &v.state case 1: @@ -1398,7 +1455,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*InspectServiceRequest); i { + switch v := v.(*Service); i { case 0: return &v.state case 1: @@ -1410,7 +1467,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*InspectServiceResponse); i { + switch v := v.(*InspectServiceRequest); i { case 0: return &v.state case 1: @@ -1422,7 +1479,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*InspectWireGuardNetworkResponse); i { + switch v := v.(*InspectServiceResponse); i { case 0: return &v.state case 1: @@ -1434,7 +1491,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*WireGuardPeer); i { + switch v := v.(*InspectWireGuardNetworkResponse); i { case 0: return &v.state case 1: @@ -1446,6 +1503,18 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*WireGuardPeer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_internal_machine_api_pb_machine_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*Service_Container); i { case 0: return &v.state @@ -1458,7 +1527,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } } - file_internal_machine_api_pb_machine_proto_msgTypes[3].OneofWrappers = []any{ + file_internal_machine_api_pb_machine_proto_msgTypes[4].OneofWrappers = []any{ (*InitClusterRequest_PublicIp)(nil), (*InitClusterRequest_PublicIpAuto)(nil), } @@ -1468,7 +1537,7 @@ func file_internal_machine_api_pb_machine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_machine_api_pb_machine_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 17, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/machine/api/pb/machine.proto b/internal/machine/api/pb/machine.proto index 4f6451da..747cad9c 100644 --- a/internal/machine/api/pb/machine.proto +++ b/internal/machine/api/pb/machine.proto @@ -11,6 +11,8 @@ import "internal/machine/api/pb/common.proto"; service Machine { // CheckPrerequisites verifies if the machine meets all necessary system requirements to participate in the cluster. rpc CheckPrerequisites(google.protobuf.Empty) returns (CheckPrerequisitesResponse); + // GetVersion returns the version of the daemon running on the machine. + rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse); rpc InitCluster(InitClusterRequest) returns (InitClusterResponse); rpc JoinCluster(JoinClusterRequest) returns (google.protobuf.Empty); rpc Token(google.protobuf.Empty) returns (TokenResponse); @@ -47,6 +49,10 @@ message CheckPrerequisitesResponse { string error = 2; } +message GetVersionResponse { + string version = 1; +} + message InitClusterRequest { string machineName = 1; IPPrefix network = 2; diff --git a/internal/machine/api/pb/machine_grpc.pb.go b/internal/machine/api/pb/machine_grpc.pb.go index 3f9c19bd..eb3703ac 100644 --- a/internal/machine/api/pb/machine_grpc.pb.go +++ b/internal/machine/api/pb/machine_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.29.3 // source: internal/machine/api/pb/machine.proto package pb @@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion9 const ( Machine_CheckPrerequisites_FullMethodName = "/api.Machine/CheckPrerequisites" + Machine_GetVersion_FullMethodName = "/api.Machine/GetVersion" Machine_InitCluster_FullMethodName = "/api.Machine/InitCluster" Machine_JoinCluster_FullMethodName = "/api.Machine/JoinCluster" Machine_Token_FullMethodName = "/api.Machine/Token" @@ -37,6 +38,8 @@ const ( type MachineClient interface { // CheckPrerequisites verifies if the machine meets all necessary system requirements to participate in the cluster. CheckPrerequisites(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CheckPrerequisitesResponse, error) + // GetVersion returns the version of the daemon running on the machine. + GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetVersionResponse, error) InitCluster(ctx context.Context, in *InitClusterRequest, opts ...grpc.CallOption) (*InitClusterResponse, error) JoinCluster(ctx context.Context, in *JoinClusterRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Token(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TokenResponse, error) @@ -69,6 +72,16 @@ func (c *machineClient) CheckPrerequisites(ctx context.Context, in *emptypb.Empt return out, nil } +func (c *machineClient) GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetVersionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetVersionResponse) + err := c.cc.Invoke(ctx, Machine_GetVersion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *machineClient) InitCluster(ctx context.Context, in *InitClusterRequest, opts ...grpc.CallOption) (*InitClusterResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(InitClusterResponse) @@ -155,6 +168,8 @@ func (c *machineClient) InspectService(ctx context.Context, in *InspectServiceRe type MachineServer interface { // CheckPrerequisites verifies if the machine meets all necessary system requirements to participate in the cluster. CheckPrerequisites(context.Context, *emptypb.Empty) (*CheckPrerequisitesResponse, error) + // GetVersion returns the version of the daemon running on the machine. + GetVersion(context.Context, *emptypb.Empty) (*GetVersionResponse, error) InitCluster(context.Context, *InitClusterRequest) (*InitClusterResponse, error) JoinCluster(context.Context, *JoinClusterRequest) (*emptypb.Empty, error) Token(context.Context, *emptypb.Empty) (*TokenResponse, error) @@ -180,6 +195,9 @@ type UnimplementedMachineServer struct{} func (UnimplementedMachineServer) CheckPrerequisites(context.Context, *emptypb.Empty) (*CheckPrerequisitesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckPrerequisites not implemented") } +func (UnimplementedMachineServer) GetVersion(context.Context, *emptypb.Empty) (*GetVersionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") +} func (UnimplementedMachineServer) InitCluster(context.Context, *InitClusterRequest) (*InitClusterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitCluster not implemented") } @@ -243,6 +261,24 @@ func _Machine_CheckPrerequisites_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _Machine_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MachineServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Machine_GetVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MachineServer).GetVersion(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + func _Machine_InitCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(InitClusterRequest) if err := dec(in); err != nil { @@ -398,6 +434,10 @@ var Machine_ServiceDesc = grpc.ServiceDesc{ MethodName: "CheckPrerequisites", Handler: _Machine_CheckPrerequisites_Handler, }, + { + MethodName: "GetVersion", + Handler: _Machine_GetVersion_Handler, + }, { MethodName: "InitCluster", Handler: _Machine_InitCluster_Handler, diff --git a/internal/machine/machine.go b/internal/machine/machine.go index 0f726dfc..3fe589c9 100644 --- a/internal/machine/machine.go +++ b/internal/machine/machine.go @@ -30,6 +30,7 @@ import ( machinedocker "github.com/psviderski/uncloud/internal/machine/docker" "github.com/psviderski/uncloud/internal/machine/network" "github.com/psviderski/uncloud/internal/machine/store" + "github.com/psviderski/uncloud/internal/version" "github.com/psviderski/unregistry" "github.com/siderolabs/grpc-proxy/proxy" "golang.org/x/sync/errgroup" @@ -662,6 +663,13 @@ func (m *Machine) CheckPrerequisites(_ context.Context, _ *emptypb.Empty) (*pb.C }, nil } +// GetVersion returns the version of the daemon running on the machine. +func (m *Machine) GetVersion(_ context.Context, _ *emptypb.Empty) (*pb.GetVersionResponse, error) { + return &pb.GetVersionResponse{ + Version: version.String(), + }, nil +} + // checkDNSPortAvailable verifies that DNS port 53/udp is available for Uncloud's embedded DNS service. func checkDNSPortAvailable() error { addr := &net.UDPAddr{ diff --git a/pkg/client/machine.go b/pkg/client/machine.go index 3efee19b..5fadd12a 100644 --- a/pkg/client/machine.go +++ b/pkg/client/machine.go @@ -147,3 +147,12 @@ func (cli *Client) WaitClusterReady(ctx context.Context, timeout time.Duration) } return backoff.Retry(listMachines, boff) } + +// GetVersion returns the version of the daemon running on the connected machine. +func (cli *Client) GetVersion(ctx context.Context) (string, error) { + resp, err := cli.MachineClient.GetVersion(ctx, &emptypb.Empty{}) + if err != nil { + return "", err + } + return resp.Version, nil +} From ec27398d1a3eb941c69b61eabdcb8812fce49c82 Mon Sep 17 00:00:00 2001 From: Nick Potts Date: Mon, 26 Jan 2026 09:44:41 +0800 Subject: [PATCH 10/10] make it query all machines --- cmd/uncloud/version.go | 160 ++++++- internal/machine/api/pb/machine.pb.go | 477 +++++++++------------ internal/machine/api/pb/machine.proto | 8 +- internal/machine/api/pb/machine_grpc.pb.go | 40 -- internal/machine/machine.go | 8 +- pkg/client/machine.go | 9 - 6 files changed, 358 insertions(+), 344 deletions(-) diff --git a/cmd/uncloud/version.go b/cmd/uncloud/version.go index 79cc72e3..fa132bdb 100644 --- a/cmd/uncloud/version.go +++ b/cmd/uncloud/version.go @@ -3,9 +3,15 @@ package main import ( "context" "fmt" + "strings" + "github.com/charmbracelet/huh/spinner" + "github.com/charmbracelet/lipgloss" + "github.com/charmbracelet/lipgloss/table" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/version" + "github.com/psviderski/uncloud/pkg/api" + "github.com/psviderski/uncloud/pkg/client" "github.com/spf13/cobra" ) @@ -13,10 +19,10 @@ func NewVersionCommand() *cobra.Command { cmd := &cobra.Command{ Use: "version", Short: "Show client and server version information.", - Long: `Show version information for both the local client and the connected server. + Long: `Show version information for both the local client and all machines in the cluster. -The client version is always shown. If connected to a cluster, the server (daemon) -version is also displayed.`, +The client version is always shown. If connected to a cluster, the version of the +daemon running on each machine is also displayed.`, RunE: func(cmd *cobra.Command, args []string) error { uncli := cmd.Context().Value("cli").(*cli.CLI) return runVersion(cmd.Context(), uncli) @@ -25,33 +31,157 @@ version is also displayed.`, return cmd } +type machineVersion struct { + name string + state string + version string +} + func runVersion(ctx context.Context, uncli *cli.CLI) error { - fmt.Printf("Client: %s\n", versionOrDev(version.String())) + fmt.Printf("Client: %s\n", versionOrUnknown(version.String())) + fmt.Println() - // Try to connect to the cluster to get the server version. - clusterClient, err := uncli.ConnectClusterWithOptions(ctx, cli.ConnectOptions{ - ShowProgress: false, - }) + // Try to connect to the cluster to get server versions. + clusterClient, err := uncli.ConnectCluster(ctx) if err != nil { - fmt.Printf("Server: %s\n", "(not connected)") + fmt.Println("Cluster: (not connected)") return nil } defer clusterClient.Close() - serverVersion, err := clusterClient.GetVersion(ctx) + var machines api.MachineMembersList + var versions map[string]string + + err = spinner.New(). + Title(" Collecting version info..."). + Type(spinner.MiniDot). + Style(lipgloss.NewStyle().Foreground(lipgloss.Color("3"))). + ActionWithErr(func(ctx context.Context) error { + var err error + machines, err = clusterClient.ListMachines(ctx, nil) + if err != nil { + return fmt.Errorf("list machines: %w", err) + } + if len(machines) == 0 { + return nil + } + versions, err = inspectMachineVersions(ctx, clusterClient) + if err != nil { + return fmt.Errorf("inspect machine versions: %w", err) + } + return nil + }). + Run() if err != nil { - fmt.Printf("Server: %s\n", "(unavailable)") + return err + } + + if len(machines) == 0 { + fmt.Println("Cluster: (no machines)") return nil } - fmt.Printf("Server: %s\n", versionOrDev(serverVersion)) + // Build version info for each machine. + machineVersions := make([]machineVersion, 0, len(machines)) + for _, m := range machines { + ver := "(unreachable)" + if v, ok := versions[m.Machine.Name]; ok { + ver = v + } + machineVersions = append(machineVersions, machineVersion{ + name: m.Machine.Name, + state: capitalise(m.State.String()), + version: ver, + }) + } + + printVersions(machineVersions) return nil } -// versionOrDev returns "(dev)" if the version is empty, otherwise returns the version as-is. -func versionOrDev(v string) string { +func printVersions(machineVersions []machineVersion) { + t := table.New(). + Border(lipgloss.Border{}). + BorderTop(false). + BorderBottom(false). + BorderLeft(false). + BorderRight(false). + BorderHeader(false). + BorderColumn(false). + StyleFunc(func(row, col int) lipgloss.Style { + if row == table.HeaderRow { + return lipgloss.NewStyle().Bold(true).PaddingRight(3) + } + return lipgloss.NewStyle().PaddingRight(3) + }) + + t.Headers("MACHINE", "STATE", "VERSION") + + for _, mv := range machineVersions { + t.Row(mv.name, mv.state, mv.version) + } + + fmt.Println(t) +} + +// inspectMachineVersions broadcasts InspectMachine to all available machines and returns a map of machine name to version. +func inspectMachineVersions(ctx context.Context, c *client.Client) (map[string]string, error) { + // Create a context that proxies to all available (non-DOWN) machines. + proxyCtx, availableMachines, err := c.ProxyMachinesContext(ctx, nil) + if err != nil { + return nil, fmt.Errorf("proxy machines context: %w", err) + } + + // Build a map of management IP to machine name for resolving response metadata. + machineNamesByIP := make(map[string]string) + for _, m := range availableMachines { + if addr, err := m.Machine.Network.ManagementIp.ToAddr(); err == nil { + machineNamesByIP[addr.String()] = m.Machine.Name + } + } + + // Broadcast InspectMachine to all machines. + resp, err := c.MachineClient.InspectMachine(proxyCtx, nil) + if err != nil { + return nil, fmt.Errorf("inspect machines: %w", err) + } + + versions := make(map[string]string) + for _, details := range resp.Machines { + var machineName string + if details.Metadata != nil { + machineName = machineNamesByIP[details.Metadata.Machine] + if details.Metadata.Error != "" { + client.PrintWarning(fmt.Sprintf("failed to get version from machine %s: %s", + machineName, details.Metadata.Error)) + continue + } + } else if len(resp.Machines) == 1 && len(availableMachines) == 1 { + // Single machine response without metadata. + machineName = availableMachines[0].Machine.Name + } + + if machineName != "" { + versions[machineName] = versionOrUnknown(details.DaemonVersion) + } + } + + return versions, nil +} + +// versionOrUnknown returns "(unknown)" if the version is empty (e.g., old daemon without version field), +// otherwise returns the version as-is. +func versionOrUnknown(v string) string { if v == "" { - return "(dev)" + return "(unknown)" } return v } + +// capitalise returns a string where the first character is upper case, and the rest is lower case. +func capitalise(s string) string { + if s == "" { + return "" + } + return strings.ToUpper(s[:1]) + strings.ToLower(s[1:]) +} diff --git a/internal/machine/api/pb/machine.pb.go b/internal/machine/api/pb/machine.pb.go index 6ebcd627..3d0914fe 100644 --- a/internal/machine/api/pb/machine.pb.go +++ b/internal/machine/api/pb/machine.pb.go @@ -221,53 +221,6 @@ func (x *CheckPrerequisitesResponse) GetError() string { return "" } -type GetVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetVersionResponse) Reset() { - *x = GetVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVersionResponse) ProtoMessage() {} - -func (x *GetVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetVersionResponse.ProtoReflect.Descriptor instead. -func (*GetVersionResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{3} -} - -func (x *GetVersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - type InitClusterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -285,7 +238,7 @@ type InitClusterRequest struct { func (x *InitClusterRequest) Reset() { *x = InitClusterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -298,7 +251,7 @@ func (x *InitClusterRequest) String() string { func (*InitClusterRequest) ProtoMessage() {} func (x *InitClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -311,7 +264,7 @@ func (x *InitClusterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InitClusterRequest.ProtoReflect.Descriptor instead. func (*InitClusterRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{4} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{3} } func (x *InitClusterRequest) GetMachineName() string { @@ -376,7 +329,7 @@ type InitClusterResponse struct { func (x *InitClusterResponse) Reset() { *x = InitClusterResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -389,7 +342,7 @@ func (x *InitClusterResponse) String() string { func (*InitClusterResponse) ProtoMessage() {} func (x *InitClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -402,7 +355,7 @@ func (x *InitClusterResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InitClusterResponse.ProtoReflect.Descriptor instead. func (*InitClusterResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{5} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{4} } func (x *InitClusterResponse) GetMachine() *MachineInfo { @@ -426,7 +379,7 @@ type JoinClusterRequest struct { func (x *JoinClusterRequest) Reset() { *x = JoinClusterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -439,7 +392,7 @@ func (x *JoinClusterRequest) String() string { func (*JoinClusterRequest) ProtoMessage() {} func (x *JoinClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -452,7 +405,7 @@ func (x *JoinClusterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use JoinClusterRequest.ProtoReflect.Descriptor instead. func (*JoinClusterRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{6} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{5} } func (x *JoinClusterRequest) GetMachine() *MachineInfo { @@ -488,7 +441,7 @@ type InspectMachineResponse struct { func (x *InspectMachineResponse) Reset() { *x = InspectMachineResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -501,7 +454,7 @@ func (x *InspectMachineResponse) String() string { func (*InspectMachineResponse) ProtoMessage() {} func (x *InspectMachineResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -514,7 +467,7 @@ func (x *InspectMachineResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectMachineResponse.ProtoReflect.Descriptor instead. func (*InspectMachineResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{7} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{6} } func (x *InspectMachineResponse) GetMachines() []*MachineDetails { @@ -533,12 +486,14 @@ type MachineDetails struct { Machine *MachineInfo `protobuf:"bytes,2,opt,name=machine,proto3" json:"machine,omitempty"` // Current Corrosion cr-sqlite database version (Lamport timestamp) of the cluster store. StoreDbVersion int64 `protobuf:"varint,3,opt,name=store_db_version,json=storeDbVersion,proto3" json:"store_db_version,omitempty"` + // Version of the Uncloud daemon running on the machine. + DaemonVersion string `protobuf:"bytes,4,opt,name=daemon_version,json=daemonVersion,proto3" json:"daemon_version,omitempty"` } func (x *MachineDetails) Reset() { *x = MachineDetails{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +506,7 @@ func (x *MachineDetails) String() string { func (*MachineDetails) ProtoMessage() {} func (x *MachineDetails) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -564,7 +519,7 @@ func (x *MachineDetails) ProtoReflect() protoreflect.Message { // Deprecated: Use MachineDetails.ProtoReflect.Descriptor instead. func (*MachineDetails) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{8} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{7} } func (x *MachineDetails) GetMetadata() *Metadata { @@ -588,6 +543,13 @@ func (x *MachineDetails) GetStoreDbVersion() int64 { return 0 } +func (x *MachineDetails) GetDaemonVersion() string { + if x != nil { + return x.DaemonVersion + } + return "" +} + type TokenResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -599,7 +561,7 @@ type TokenResponse struct { func (x *TokenResponse) Reset() { *x = TokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -612,7 +574,7 @@ func (x *TokenResponse) String() string { func (*TokenResponse) ProtoMessage() {} func (x *TokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -625,7 +587,7 @@ func (x *TokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TokenResponse.ProtoReflect.Descriptor instead. func (*TokenResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{9} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{8} } func (x *TokenResponse) GetToken() string { @@ -644,7 +606,7 @@ type ResetRequest struct { func (x *ResetRequest) Reset() { *x = ResetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -657,7 +619,7 @@ func (x *ResetRequest) String() string { func (*ResetRequest) ProtoMessage() {} func (x *ResetRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -670,7 +632,7 @@ func (x *ResetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetRequest.ProtoReflect.Descriptor instead. func (*ResetRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{10} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{9} } type Service struct { @@ -687,7 +649,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -700,7 +662,7 @@ func (x *Service) String() string { func (*Service) ProtoMessage() {} func (x *Service) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -713,7 +675,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{11} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{10} } func (x *Service) GetId() string { @@ -755,7 +717,7 @@ type InspectServiceRequest struct { func (x *InspectServiceRequest) Reset() { *x = InspectServiceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -768,7 +730,7 @@ func (x *InspectServiceRequest) String() string { func (*InspectServiceRequest) ProtoMessage() {} func (x *InspectServiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -781,7 +743,7 @@ func (x *InspectServiceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectServiceRequest.ProtoReflect.Descriptor instead. func (*InspectServiceRequest) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{12} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{11} } func (x *InspectServiceRequest) GetId() string { @@ -802,7 +764,7 @@ type InspectServiceResponse struct { func (x *InspectServiceResponse) Reset() { *x = InspectServiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -815,7 +777,7 @@ func (x *InspectServiceResponse) String() string { func (*InspectServiceResponse) ProtoMessage() {} func (x *InspectServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -828,7 +790,7 @@ func (x *InspectServiceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectServiceResponse.ProtoReflect.Descriptor instead. func (*InspectServiceResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{13} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{12} } func (x *InspectServiceResponse) GetService() *Service { @@ -852,7 +814,7 @@ type InspectWireGuardNetworkResponse struct { func (x *InspectWireGuardNetworkResponse) Reset() { *x = InspectWireGuardNetworkResponse{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -865,7 +827,7 @@ func (x *InspectWireGuardNetworkResponse) String() string { func (*InspectWireGuardNetworkResponse) ProtoMessage() {} func (x *InspectWireGuardNetworkResponse) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -878,7 +840,7 @@ func (x *InspectWireGuardNetworkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InspectWireGuardNetworkResponse.ProtoReflect.Descriptor instead. func (*InspectWireGuardNetworkResponse) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{14} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{13} } func (x *InspectWireGuardNetworkResponse) GetInterfaceName() string { @@ -925,7 +887,7 @@ type WireGuardPeer struct { func (x *WireGuardPeer) Reset() { *x = WireGuardPeer{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -938,7 +900,7 @@ func (x *WireGuardPeer) String() string { func (*WireGuardPeer) ProtoMessage() {} func (x *WireGuardPeer) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -951,7 +913,7 @@ func (x *WireGuardPeer) ProtoReflect() protoreflect.Message { // Deprecated: Use WireGuardPeer.ProtoReflect.Descriptor instead. func (*WireGuardPeer) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{15} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{14} } func (x *WireGuardPeer) GetPublicKey() []byte { @@ -1009,7 +971,7 @@ type Service_Container struct { func (x *Service_Container) Reset() { *x = Service_Container{} if protoimpl.UnsafeEnabled { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[16] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1022,7 +984,7 @@ func (x *Service_Container) String() string { func (*Service_Container) ProtoMessage() {} func (x *Service_Container) ProtoReflect() protoreflect.Message { - mi := &file_internal_machine_api_pb_machine_proto_msgTypes[16] + mi := &file_internal_machine_api_pb_machine_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1035,7 +997,7 @@ func (x *Service_Container) ProtoReflect() protoreflect.Message { // Deprecated: Use Service_Container.ProtoReflect.Descriptor instead. func (*Service_Container) Descriptor() ([]byte, []int) { - return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{11, 0} + return file_internal_machine_api_pb_machine_proto_rawDescGZIP(), []int{10, 0} } func (x *Service_Container) GetMachineId() string { @@ -1088,10 +1050,7 @@ var file_internal_machine_api_pb_machine_proto_rawDesc = []byte{ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2e, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc3, 0x01, 0x0a, 0x12, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xc3, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, @@ -1123,7 +1082,7 @@ var file_internal_machine_api_pb_machine_proto_rawDesc = []byte{ 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x52, 0x08, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x22, 0x91, 0x01, 0x0a, + 0x6c, 0x73, 0x52, 0x08, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x0e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, @@ -1133,103 +1092,102 @@ var file_internal_machine_api_pb_machine_proto_rawDesc = []byte{ 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x64, 0x62, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x44, 0x62, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0x25, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x73, 0x1a, 0x48, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x27, 0x0a, - 0x15, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x40, 0x0a, 0x16, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x26, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x1f, 0x49, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, - 0x6f, 0x72, 0x74, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, - 0x72, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x83, 0x02, - 0x0a, 0x0d, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, - 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4a, 0x0a, 0x13, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, - 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, - 0x49, 0x70, 0x73, 0x32, 0xa2, 0x05, 0x0a, 0x07, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, - 0x4d, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x72, 0x65, 0x71, 0x75, 0x69, - 0x73, 0x69, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x72, 0x65, 0x71, 0x75, - 0x69, 0x73, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, - 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, + 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x25, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x0e, + 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc3, + 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, + 0x64, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x48, 0x0a, 0x09, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x15, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x40, 0x0a, + 0x16, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, + 0xb2, 0x01, 0x0a, 0x1f, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, + 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x73, + 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x65, + 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x22, 0x83, 0x02, 0x0a, 0x0d, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, + 0x72, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x4a, 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, + 0x61, 0x6b, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, + 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x73, 0x32, 0xe3, 0x04, 0x0a, 0x07, 0x4d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, + 0x72, 0x65, 0x72, 0x65, 0x71, 0x75, 0x69, 0x73, 0x69, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, - 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3e, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x33, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x12, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x50, 0x72, 0x65, 0x72, 0x65, 0x71, 0x75, 0x69, 0x73, 0x69, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x6f, 0x69, + 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, - 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x0e, 0x49, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, - 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x57, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, - 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, - 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x52, 0x65, 0x73, - 0x65, 0x74, 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, - 0x0e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x6b, - 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, + 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x45, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x70, + 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, + 0x72, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x32, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, + 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x6b, 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1244,72 +1202,69 @@ func file_internal_machine_api_pb_machine_proto_rawDescGZIP() []byte { return file_internal_machine_api_pb_machine_proto_rawDescData } -var file_internal_machine_api_pb_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_internal_machine_api_pb_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_internal_machine_api_pb_machine_proto_goTypes = []any{ (*MachineInfo)(nil), // 0: api.MachineInfo (*NetworkConfig)(nil), // 1: api.NetworkConfig (*CheckPrerequisitesResponse)(nil), // 2: api.CheckPrerequisitesResponse - (*GetVersionResponse)(nil), // 3: api.GetVersionResponse - (*InitClusterRequest)(nil), // 4: api.InitClusterRequest - (*InitClusterResponse)(nil), // 5: api.InitClusterResponse - (*JoinClusterRequest)(nil), // 6: api.JoinClusterRequest - (*InspectMachineResponse)(nil), // 7: api.InspectMachineResponse - (*MachineDetails)(nil), // 8: api.MachineDetails - (*TokenResponse)(nil), // 9: api.TokenResponse - (*ResetRequest)(nil), // 10: api.ResetRequest - (*Service)(nil), // 11: api.Service - (*InspectServiceRequest)(nil), // 12: api.InspectServiceRequest - (*InspectServiceResponse)(nil), // 13: api.InspectServiceResponse - (*InspectWireGuardNetworkResponse)(nil), // 14: api.InspectWireGuardNetworkResponse - (*WireGuardPeer)(nil), // 15: api.WireGuardPeer - (*Service_Container)(nil), // 16: api.Service.Container - (*IP)(nil), // 17: api.IP - (*IPPrefix)(nil), // 18: api.IPPrefix - (*IPPort)(nil), // 19: api.IPPort - (*Metadata)(nil), // 20: api.Metadata - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 22: google.protobuf.Empty + (*InitClusterRequest)(nil), // 3: api.InitClusterRequest + (*InitClusterResponse)(nil), // 4: api.InitClusterResponse + (*JoinClusterRequest)(nil), // 5: api.JoinClusterRequest + (*InspectMachineResponse)(nil), // 6: api.InspectMachineResponse + (*MachineDetails)(nil), // 7: api.MachineDetails + (*TokenResponse)(nil), // 8: api.TokenResponse + (*ResetRequest)(nil), // 9: api.ResetRequest + (*Service)(nil), // 10: api.Service + (*InspectServiceRequest)(nil), // 11: api.InspectServiceRequest + (*InspectServiceResponse)(nil), // 12: api.InspectServiceResponse + (*InspectWireGuardNetworkResponse)(nil), // 13: api.InspectWireGuardNetworkResponse + (*WireGuardPeer)(nil), // 14: api.WireGuardPeer + (*Service_Container)(nil), // 15: api.Service.Container + (*IP)(nil), // 16: api.IP + (*IPPrefix)(nil), // 17: api.IPPrefix + (*IPPort)(nil), // 18: api.IPPort + (*Metadata)(nil), // 19: api.Metadata + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 21: google.protobuf.Empty } var file_internal_machine_api_pb_machine_proto_depIdxs = []int32{ 1, // 0: api.MachineInfo.network:type_name -> api.NetworkConfig - 17, // 1: api.MachineInfo.public_ip:type_name -> api.IP - 18, // 2: api.NetworkConfig.subnet:type_name -> api.IPPrefix - 17, // 3: api.NetworkConfig.management_ip:type_name -> api.IP - 19, // 4: api.NetworkConfig.endpoints:type_name -> api.IPPort - 18, // 5: api.InitClusterRequest.network:type_name -> api.IPPrefix - 17, // 6: api.InitClusterRequest.public_ip:type_name -> api.IP + 16, // 1: api.MachineInfo.public_ip:type_name -> api.IP + 17, // 2: api.NetworkConfig.subnet:type_name -> api.IPPrefix + 16, // 3: api.NetworkConfig.management_ip:type_name -> api.IP + 18, // 4: api.NetworkConfig.endpoints:type_name -> api.IPPort + 17, // 5: api.InitClusterRequest.network:type_name -> api.IPPrefix + 16, // 6: api.InitClusterRequest.public_ip:type_name -> api.IP 0, // 7: api.InitClusterResponse.machine:type_name -> api.MachineInfo 0, // 8: api.JoinClusterRequest.machine:type_name -> api.MachineInfo 0, // 9: api.JoinClusterRequest.other_machines:type_name -> api.MachineInfo - 8, // 10: api.InspectMachineResponse.machines:type_name -> api.MachineDetails - 20, // 11: api.MachineDetails.metadata:type_name -> api.Metadata + 7, // 10: api.InspectMachineResponse.machines:type_name -> api.MachineDetails + 19, // 11: api.MachineDetails.metadata:type_name -> api.Metadata 0, // 12: api.MachineDetails.machine:type_name -> api.MachineInfo - 16, // 13: api.Service.containers:type_name -> api.Service.Container - 11, // 14: api.InspectServiceResponse.service:type_name -> api.Service - 15, // 15: api.InspectWireGuardNetworkResponse.peers:type_name -> api.WireGuardPeer - 21, // 16: api.WireGuardPeer.last_handshake_time:type_name -> google.protobuf.Timestamp - 22, // 17: api.Machine.CheckPrerequisites:input_type -> google.protobuf.Empty - 22, // 18: api.Machine.GetVersion:input_type -> google.protobuf.Empty - 4, // 19: api.Machine.InitCluster:input_type -> api.InitClusterRequest - 6, // 20: api.Machine.JoinCluster:input_type -> api.JoinClusterRequest - 22, // 21: api.Machine.Token:input_type -> google.protobuf.Empty - 22, // 22: api.Machine.Inspect:input_type -> google.protobuf.Empty - 22, // 23: api.Machine.InspectMachine:input_type -> google.protobuf.Empty - 22, // 24: api.Machine.InspectWireGuardNetwork:input_type -> google.protobuf.Empty - 10, // 25: api.Machine.Reset:input_type -> api.ResetRequest - 12, // 26: api.Machine.InspectService:input_type -> api.InspectServiceRequest - 2, // 27: api.Machine.CheckPrerequisites:output_type -> api.CheckPrerequisitesResponse - 3, // 28: api.Machine.GetVersion:output_type -> api.GetVersionResponse - 5, // 29: api.Machine.InitCluster:output_type -> api.InitClusterResponse - 22, // 30: api.Machine.JoinCluster:output_type -> google.protobuf.Empty - 9, // 31: api.Machine.Token:output_type -> api.TokenResponse - 0, // 32: api.Machine.Inspect:output_type -> api.MachineInfo - 7, // 33: api.Machine.InspectMachine:output_type -> api.InspectMachineResponse - 14, // 34: api.Machine.InspectWireGuardNetwork:output_type -> api.InspectWireGuardNetworkResponse - 22, // 35: api.Machine.Reset:output_type -> google.protobuf.Empty - 13, // 36: api.Machine.InspectService:output_type -> api.InspectServiceResponse - 27, // [27:37] is the sub-list for method output_type - 17, // [17:27] is the sub-list for method input_type + 15, // 13: api.Service.containers:type_name -> api.Service.Container + 10, // 14: api.InspectServiceResponse.service:type_name -> api.Service + 14, // 15: api.InspectWireGuardNetworkResponse.peers:type_name -> api.WireGuardPeer + 20, // 16: api.WireGuardPeer.last_handshake_time:type_name -> google.protobuf.Timestamp + 21, // 17: api.Machine.CheckPrerequisites:input_type -> google.protobuf.Empty + 3, // 18: api.Machine.InitCluster:input_type -> api.InitClusterRequest + 5, // 19: api.Machine.JoinCluster:input_type -> api.JoinClusterRequest + 21, // 20: api.Machine.Token:input_type -> google.protobuf.Empty + 21, // 21: api.Machine.Inspect:input_type -> google.protobuf.Empty + 21, // 22: api.Machine.InspectMachine:input_type -> google.protobuf.Empty + 21, // 23: api.Machine.InspectWireGuardNetwork:input_type -> google.protobuf.Empty + 9, // 24: api.Machine.Reset:input_type -> api.ResetRequest + 11, // 25: api.Machine.InspectService:input_type -> api.InspectServiceRequest + 2, // 26: api.Machine.CheckPrerequisites:output_type -> api.CheckPrerequisitesResponse + 4, // 27: api.Machine.InitCluster:output_type -> api.InitClusterResponse + 21, // 28: api.Machine.JoinCluster:output_type -> google.protobuf.Empty + 8, // 29: api.Machine.Token:output_type -> api.TokenResponse + 0, // 30: api.Machine.Inspect:output_type -> api.MachineInfo + 6, // 31: api.Machine.InspectMachine:output_type -> api.InspectMachineResponse + 13, // 32: api.Machine.InspectWireGuardNetwork:output_type -> api.InspectWireGuardNetworkResponse + 21, // 33: api.Machine.Reset:output_type -> google.protobuf.Empty + 12, // 34: api.Machine.InspectService:output_type -> api.InspectServiceResponse + 26, // [26:35] is the sub-list for method output_type + 17, // [17:26] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name 17, // [17:17] is the sub-list for extension extendee 0, // [0:17] is the sub-list for field type_name @@ -1359,18 +1314,6 @@ func file_internal_machine_api_pb_machine_proto_init() { } } file_internal_machine_api_pb_machine_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_machine_api_pb_machine_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*InitClusterRequest); i { case 0: return &v.state @@ -1382,7 +1325,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*InitClusterResponse); i { case 0: return &v.state @@ -1394,7 +1337,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*JoinClusterRequest); i { case 0: return &v.state @@ -1406,7 +1349,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*InspectMachineResponse); i { case 0: return &v.state @@ -1418,7 +1361,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*MachineDetails); i { case 0: return &v.state @@ -1430,7 +1373,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*TokenResponse); i { case 0: return &v.state @@ -1442,7 +1385,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*ResetRequest); i { case 0: return &v.state @@ -1454,7 +1397,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*Service); i { case 0: return &v.state @@ -1466,7 +1409,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*InspectServiceRequest); i { case 0: return &v.state @@ -1478,7 +1421,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*InspectServiceResponse); i { case 0: return &v.state @@ -1490,7 +1433,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[14].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*InspectWireGuardNetworkResponse); i { case 0: return &v.state @@ -1502,7 +1445,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[15].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*WireGuardPeer); i { case 0: return &v.state @@ -1514,7 +1457,7 @@ func file_internal_machine_api_pb_machine_proto_init() { return nil } } - file_internal_machine_api_pb_machine_proto_msgTypes[16].Exporter = func(v any, i int) any { + file_internal_machine_api_pb_machine_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*Service_Container); i { case 0: return &v.state @@ -1527,7 +1470,7 @@ func file_internal_machine_api_pb_machine_proto_init() { } } } - file_internal_machine_api_pb_machine_proto_msgTypes[4].OneofWrappers = []any{ + file_internal_machine_api_pb_machine_proto_msgTypes[3].OneofWrappers = []any{ (*InitClusterRequest_PublicIp)(nil), (*InitClusterRequest_PublicIpAuto)(nil), } @@ -1537,7 +1480,7 @@ func file_internal_machine_api_pb_machine_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_machine_api_pb_machine_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/machine/api/pb/machine.proto b/internal/machine/api/pb/machine.proto index 747cad9c..1a274781 100644 --- a/internal/machine/api/pb/machine.proto +++ b/internal/machine/api/pb/machine.proto @@ -11,8 +11,6 @@ import "internal/machine/api/pb/common.proto"; service Machine { // CheckPrerequisites verifies if the machine meets all necessary system requirements to participate in the cluster. rpc CheckPrerequisites(google.protobuf.Empty) returns (CheckPrerequisitesResponse); - // GetVersion returns the version of the daemon running on the machine. - rpc GetVersion(google.protobuf.Empty) returns (GetVersionResponse); rpc InitCluster(InitClusterRequest) returns (InitClusterResponse); rpc JoinCluster(JoinClusterRequest) returns (google.protobuf.Empty); rpc Token(google.protobuf.Empty) returns (TokenResponse); @@ -49,10 +47,6 @@ message CheckPrerequisitesResponse { string error = 2; } -message GetVersionResponse { - string version = 1; -} - message InitClusterRequest { string machineName = 1; IPPrefix network = 2; @@ -84,6 +78,8 @@ message MachineDetails { MachineInfo machine = 2; // Current Corrosion cr-sqlite database version (Lamport timestamp) of the cluster store. int64 store_db_version = 3; + // Version of the Uncloud daemon running on the machine. + string daemon_version = 4; } message TokenResponse { diff --git a/internal/machine/api/pb/machine_grpc.pb.go b/internal/machine/api/pb/machine_grpc.pb.go index eb3703ac..de4b43d6 100644 --- a/internal/machine/api/pb/machine_grpc.pb.go +++ b/internal/machine/api/pb/machine_grpc.pb.go @@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion9 const ( Machine_CheckPrerequisites_FullMethodName = "/api.Machine/CheckPrerequisites" - Machine_GetVersion_FullMethodName = "/api.Machine/GetVersion" Machine_InitCluster_FullMethodName = "/api.Machine/InitCluster" Machine_JoinCluster_FullMethodName = "/api.Machine/JoinCluster" Machine_Token_FullMethodName = "/api.Machine/Token" @@ -38,8 +37,6 @@ const ( type MachineClient interface { // CheckPrerequisites verifies if the machine meets all necessary system requirements to participate in the cluster. CheckPrerequisites(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CheckPrerequisitesResponse, error) - // GetVersion returns the version of the daemon running on the machine. - GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetVersionResponse, error) InitCluster(ctx context.Context, in *InitClusterRequest, opts ...grpc.CallOption) (*InitClusterResponse, error) JoinCluster(ctx context.Context, in *JoinClusterRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Token(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TokenResponse, error) @@ -72,16 +69,6 @@ func (c *machineClient) CheckPrerequisites(ctx context.Context, in *emptypb.Empt return out, nil } -func (c *machineClient) GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetVersionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetVersionResponse) - err := c.cc.Invoke(ctx, Machine_GetVersion_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *machineClient) InitCluster(ctx context.Context, in *InitClusterRequest, opts ...grpc.CallOption) (*InitClusterResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(InitClusterResponse) @@ -168,8 +155,6 @@ func (c *machineClient) InspectService(ctx context.Context, in *InspectServiceRe type MachineServer interface { // CheckPrerequisites verifies if the machine meets all necessary system requirements to participate in the cluster. CheckPrerequisites(context.Context, *emptypb.Empty) (*CheckPrerequisitesResponse, error) - // GetVersion returns the version of the daemon running on the machine. - GetVersion(context.Context, *emptypb.Empty) (*GetVersionResponse, error) InitCluster(context.Context, *InitClusterRequest) (*InitClusterResponse, error) JoinCluster(context.Context, *JoinClusterRequest) (*emptypb.Empty, error) Token(context.Context, *emptypb.Empty) (*TokenResponse, error) @@ -195,9 +180,6 @@ type UnimplementedMachineServer struct{} func (UnimplementedMachineServer) CheckPrerequisites(context.Context, *emptypb.Empty) (*CheckPrerequisitesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckPrerequisites not implemented") } -func (UnimplementedMachineServer) GetVersion(context.Context, *emptypb.Empty) (*GetVersionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") -} func (UnimplementedMachineServer) InitCluster(context.Context, *InitClusterRequest) (*InitClusterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitCluster not implemented") } @@ -261,24 +243,6 @@ func _Machine_CheckPrerequisites_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _Machine_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MachineServer).GetVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Machine_GetVersion_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MachineServer).GetVersion(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - func _Machine_InitCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(InitClusterRequest) if err := dec(in); err != nil { @@ -434,10 +398,6 @@ var Machine_ServiceDesc = grpc.ServiceDesc{ MethodName: "CheckPrerequisites", Handler: _Machine_CheckPrerequisites_Handler, }, - { - MethodName: "GetVersion", - Handler: _Machine_GetVersion_Handler, - }, { MethodName: "InitCluster", Handler: _Machine_InitCluster_Handler, diff --git a/internal/machine/machine.go b/internal/machine/machine.go index 3fe589c9..6c166fbc 100644 --- a/internal/machine/machine.go +++ b/internal/machine/machine.go @@ -663,13 +663,6 @@ func (m *Machine) CheckPrerequisites(_ context.Context, _ *emptypb.Empty) (*pb.C }, nil } -// GetVersion returns the version of the daemon running on the machine. -func (m *Machine) GetVersion(_ context.Context, _ *emptypb.Empty) (*pb.GetVersionResponse, error) { - return &pb.GetVersionResponse{ - Version: version.String(), - }, nil -} - // checkDNSPortAvailable verifies that DNS port 53/udp is available for Uncloud's embedded DNS service. func checkDNSPortAvailable() error { addr := &net.UDPAddr{ @@ -916,6 +909,7 @@ func (m *Machine) InspectMachine(ctx context.Context, _ *emptypb.Empty) (*pb.Ins }, }, StoreDbVersion: dbVersion, + DaemonVersion: version.String(), }, }, }, nil diff --git a/pkg/client/machine.go b/pkg/client/machine.go index 5fadd12a..3efee19b 100644 --- a/pkg/client/machine.go +++ b/pkg/client/machine.go @@ -147,12 +147,3 @@ func (cli *Client) WaitClusterReady(ctx context.Context, timeout time.Duration) } return backoff.Retry(listMachines, boff) } - -// GetVersion returns the version of the daemon running on the connected machine. -func (cli *Client) GetVersion(ctx context.Context) (string, error) { - resp, err := cli.MachineClient.GetVersion(ctx, &emptypb.Empty{}) - if err != nil { - return "", err - } - return resp.Version, nil -}