mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 22:34:56 -04:00
Rename coordinator to bootstrapper and rename roles
This commit is contained in:
parent
3280ed200c
commit
916e5d6b55
191 changed files with 1763 additions and 2030 deletions
|
@ -19,7 +19,7 @@ With `cdbg` and `yq` installed in your path:
|
|||
authorizedKeys:
|
||||
- username: my-username
|
||||
publicKey: ssh-rsa AAAAB…LJuM=
|
||||
coordinatorPath: "./coordinator"
|
||||
bootstrapperPath: "./bootstrapper"
|
||||
systemdUnits:
|
||||
- name: some-custom.service
|
||||
contents: |-
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package coordinator
|
||||
package bootstrapper
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -56,7 +56,7 @@ func (f *FileStreamer) WriteStream(filename string, stream ReadChunkStream, show
|
|||
if showProgress {
|
||||
bar = progressbar.NewOptions64(
|
||||
-1,
|
||||
progressbar.OptionSetDescription("receiving coordinator"),
|
||||
progressbar.OptionSetDescription("receiving bootstrapper"),
|
||||
progressbar.OptionShowBytes(true),
|
||||
progressbar.OptionClearOnFinish(),
|
||||
)
|
||||
|
@ -111,7 +111,7 @@ func (f *FileStreamer) ReadStream(filename string, stream WriteChunkStream, chun
|
|||
}
|
||||
bar = progressbar.NewOptions64(
|
||||
stat.Size(),
|
||||
progressbar.OptionSetDescription("uploading coordinator"),
|
||||
progressbar.OptionSetDescription("uploading bootstrapper"),
|
||||
progressbar.OptionShowBytes(true),
|
||||
progressbar.OptionClearOnFinish(),
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
package coordinator
|
||||
package bootstrapper
|
||||
|
||||
import (
|
||||
"errors"
|
|
@ -8,9 +8,9 @@ import (
|
|||
"log"
|
||||
"net"
|
||||
|
||||
"github.com/edgelesssys/constellation/debugd/bootstrapper"
|
||||
"github.com/edgelesssys/constellation/debugd/cdbg/config"
|
||||
"github.com/edgelesssys/constellation/debugd/cdbg/state"
|
||||
"github.com/edgelesssys/constellation/debugd/coordinator"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd"
|
||||
depl "github.com/edgelesssys/constellation/debugd/debugd/deploy"
|
||||
pb "github.com/edgelesssys/constellation/debugd/service"
|
||||
|
@ -26,13 +26,13 @@ import (
|
|||
|
||||
var deployCmd = &cobra.Command{
|
||||
Use: "deploy",
|
||||
Short: "Deploys a self-compiled coordinator binary and SSH keys on the current constellation",
|
||||
Long: `Deploys a self-compiled coordinator binary and SSH keys on the current constellation.
|
||||
Short: "Deploys a self-compiled bootstrapper binary and SSH keys on the current constellation",
|
||||
Long: `Deploys a self-compiled bootstrapper binary and SSH keys on the current constellation.
|
||||
Uses config provided by --config and reads constellation config from its default location.
|
||||
If required, you can override the IP addresses that are used for a deployment by specifying "--ips" and a list of IP addresses.
|
||||
Specifying --coordinator will upload the coordinator from the specified path.`,
|
||||
Specifying --bootstrapper will upload the bootstrapper from the specified path.`,
|
||||
RunE: runDeploy,
|
||||
Example: "cdbg deploy\ncdbg deploy --config /path/to/config\ncdbg deploy --coordinator /path/to/coordinator --ips 192.0.2.1,192.0.2.2,192.0.2.3 --config /path/to/config",
|
||||
Example: "cdbg deploy\ncdbg deploy --config /path/to/config\ncdbg deploy --bootstrapper /path/to/bootstrapper --ips 192.0.2.1,192.0.2.2,192.0.2.3 --config /path/to/config",
|
||||
}
|
||||
|
||||
func runDeploy(cmd *cobra.Command, args []string) error {
|
||||
|
@ -54,16 +54,16 @@ func runDeploy(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return deploy(cmd, fileHandler, constellationConfig, debugConfig, coordinator.NewFileStreamer(afero.NewOsFs()))
|
||||
return deploy(cmd, fileHandler, constellationConfig, debugConfig, bootstrapper.NewFileStreamer(afero.NewOsFs()))
|
||||
}
|
||||
|
||||
func deploy(cmd *cobra.Command, fileHandler file.Handler, constellationConfig *configc.Config, debugConfig *config.CDBGConfig, reader fileToStreamReader) error {
|
||||
overrideCoordinatorPath, err := cmd.Flags().GetString("coordinator")
|
||||
overrideBootstrapperPath, err := cmd.Flags().GetString("bootstrapper")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(overrideCoordinatorPath) > 0 {
|
||||
debugConfig.ConstellationDebugConfig.CoordinatorPath = overrideCoordinatorPath
|
||||
if len(overrideBootstrapperPath) > 0 {
|
||||
debugConfig.ConstellationDebugConfig.BootstrapperPath = overrideBootstrapperPath
|
||||
}
|
||||
|
||||
overrideIPs, err := cmd.Flags().GetStringSlice("ips")
|
||||
|
@ -90,11 +90,11 @@ func deploy(cmd *cobra.Command, fileHandler file.Handler, constellationConfig *c
|
|||
|
||||
for _, ip := range ips {
|
||||
input := deployOnEndpointInput{
|
||||
debugdEndpoint: net.JoinHostPort(ip, debugd.DebugdPort),
|
||||
coordinatorPath: debugConfig.ConstellationDebugConfig.CoordinatorPath,
|
||||
reader: reader,
|
||||
authorizedKeys: debugConfig.ConstellationDebugConfig.AuthorizedKeys,
|
||||
systemdUnits: debugConfig.ConstellationDebugConfig.SystemdUnits,
|
||||
debugdEndpoint: net.JoinHostPort(ip, debugd.DebugdPort),
|
||||
bootstrapperPath: debugConfig.ConstellationDebugConfig.BootstrapperPath,
|
||||
reader: reader,
|
||||
authorizedKeys: debugConfig.ConstellationDebugConfig.AuthorizedKeys,
|
||||
systemdUnits: debugConfig.ConstellationDebugConfig.SystemdUnits,
|
||||
}
|
||||
if err := deployOnEndpoint(cmd.Context(), input); err != nil {
|
||||
return err
|
||||
|
@ -105,14 +105,14 @@ func deploy(cmd *cobra.Command, fileHandler file.Handler, constellationConfig *c
|
|||
}
|
||||
|
||||
type deployOnEndpointInput struct {
|
||||
debugdEndpoint string
|
||||
coordinatorPath string
|
||||
reader fileToStreamReader
|
||||
authorizedKeys []configc.UserKey
|
||||
systemdUnits []depl.SystemdUnit
|
||||
debugdEndpoint string
|
||||
bootstrapperPath string
|
||||
reader fileToStreamReader
|
||||
authorizedKeys []configc.UserKey
|
||||
systemdUnits []depl.SystemdUnit
|
||||
}
|
||||
|
||||
// deployOnEndpoint deploys SSH public keys, systemd units and a locally built coordinator binary to a debugd endpoint.
|
||||
// deployOnEndpoint deploys SSH public keys, systemd units and a locally built bootstrapper binary to a debugd endpoint.
|
||||
func deployOnEndpoint(ctx context.Context, in deployOnEndpointInput) error {
|
||||
log.Printf("Deploying on %v\n", in.debugdEndpoint)
|
||||
dialCTX, cancel := context.WithTimeout(ctx, debugd.GRPCTimeout)
|
||||
|
@ -134,7 +134,7 @@ func deployOnEndpoint(ctx context.Context, in deployOnEndpointInput) error {
|
|||
}
|
||||
authorizedKeysResponse, err := client.UploadAuthorizedKeys(ctx, &pb.UploadAuthorizedKeysRequest{Keys: pbKeys}, grpc.WaitForReady(true))
|
||||
if err != nil || authorizedKeysResponse.Status != pb.UploadAuthorizedKeysStatus_UPLOAD_AUTHORIZED_KEYS_SUCCESS {
|
||||
return fmt.Errorf("uploading coordinator to instance %v failed: %v / %w", in.debugdEndpoint, authorizedKeysResponse, err)
|
||||
return fmt.Errorf("uploading bootstrapper to instance %v failed: %v / %w", in.debugdEndpoint, authorizedKeysResponse, err)
|
||||
}
|
||||
|
||||
if len(in.systemdUnits) > 0 {
|
||||
|
@ -153,36 +153,36 @@ func deployOnEndpoint(ctx context.Context, in deployOnEndpointInput) error {
|
|||
}
|
||||
}
|
||||
|
||||
stream, err := client.UploadCoordinator(ctx)
|
||||
stream, err := client.UploadBootstrapper(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("starting coordinator upload to instance %v: %w", in.debugdEndpoint, err)
|
||||
return fmt.Errorf("starting bootstrapper upload to instance %v: %w", in.debugdEndpoint, err)
|
||||
}
|
||||
streamErr := in.reader.ReadStream(in.coordinatorPath, stream, debugd.Chunksize, true)
|
||||
streamErr := in.reader.ReadStream(in.bootstrapperPath, stream, debugd.Chunksize, true)
|
||||
|
||||
uploadResponse, closeErr := stream.CloseAndRecv()
|
||||
if closeErr != nil {
|
||||
return fmt.Errorf("closing upload stream after uploading coordinator to %v: %w", in.debugdEndpoint, closeErr)
|
||||
return fmt.Errorf("closing upload stream after uploading bootstrapper to %v: %w", in.debugdEndpoint, closeErr)
|
||||
}
|
||||
if uploadResponse.Status == pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_FILE_EXISTS {
|
||||
log.Println("Coordinator was already uploaded")
|
||||
if uploadResponse.Status == pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_FILE_EXISTS {
|
||||
log.Println("Bootstrapper was already uploaded")
|
||||
return nil
|
||||
}
|
||||
if uploadResponse.Status != pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS || streamErr != nil {
|
||||
return fmt.Errorf("uploading coordinator to instance %v failed: %v / %w", in.debugdEndpoint, uploadResponse, streamErr)
|
||||
if uploadResponse.Status != pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_SUCCESS || streamErr != nil {
|
||||
return fmt.Errorf("uploading bootstrapper to instance %v failed: %v / %w", in.debugdEndpoint, uploadResponse, streamErr)
|
||||
}
|
||||
log.Println("Uploaded coordinator")
|
||||
log.Println("Uploaded bootstrapper")
|
||||
return nil
|
||||
}
|
||||
|
||||
func getIPsFromConfig(stat statec.ConstellationState, config configc.Config) ([]string, error) {
|
||||
coordinators, nodes, err := state.GetScalingGroupsFromConfig(stat, &config)
|
||||
controlPlanes, workers, err := state.GetScalingGroupsFromConfig(stat, &config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var ips []string
|
||||
// only deploy to non empty public IPs
|
||||
for _, ip := range append(coordinators.PublicIPs(), nodes.PublicIPs()...) {
|
||||
for _, ip := range append(controlPlanes.PublicIPs(), workers.PublicIPs()...) {
|
||||
if ip != "" {
|
||||
ips = append(ips, ip)
|
||||
}
|
||||
|
@ -197,10 +197,10 @@ func getIPsFromConfig(stat statec.ConstellationState, config configc.Config) ([]
|
|||
func init() {
|
||||
rootCmd.AddCommand(deployCmd)
|
||||
|
||||
deployCmd.Flags().StringSlice("ips", nil, "override the ips that the coordinator will be uploaded to (defaults to ips from constellation config)")
|
||||
deployCmd.Flags().String("coordinator", "", "override the path to the coordinator binary uploaded to instances (defaults to path set in config)")
|
||||
deployCmd.Flags().StringSlice("ips", nil, "override the ips that the bootstrapper will be uploaded to (defaults to ips from constellation config)")
|
||||
deployCmd.Flags().String("bootstrapper", "", "override the path to the bootstrapper binary uploaded to instances (defaults to path set in config)")
|
||||
}
|
||||
|
||||
type fileToStreamReader interface {
|
||||
ReadStream(filename string, stream coordinator.WriteChunkStream, chunksize uint, showProgress bool) error
|
||||
ReadStream(filename string, stream bootstrapper.WriteChunkStream, chunksize uint, showProgress bool) error
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ var rootCmd = &cobra.Command{
|
|||
Use: "cdbg",
|
||||
Short: "Constellation debugging client",
|
||||
Long: `cdbg is the constellation debugging client.
|
||||
It connects to CoreOS instances running debugd and deploys a self-compiled version of the coordinator.`,
|
||||
It connects to CoreOS instances running debugd and deploys a self-compiled version of the bootstrapper.`,
|
||||
}
|
||||
|
||||
// Execute starts the CLI.
|
||||
|
|
|
@ -17,9 +17,9 @@ type CDBGConfig struct {
|
|||
|
||||
// ConstellationDebugdConfig is the cdbg specific configuration.
|
||||
type ConstellationDebugdConfig struct {
|
||||
AuthorizedKeys []configc.UserKey `yaml:"authorizedKeys"`
|
||||
CoordinatorPath string `yaml:"coordinatorPath"`
|
||||
SystemdUnits []deploy.SystemdUnit `yaml:"systemdUnits,omitempty"`
|
||||
AuthorizedKeys []configc.UserKey `yaml:"authorizedKeys"`
|
||||
BootstrapperPath string `yaml:"bootstrapperPath"`
|
||||
SystemdUnits []deploy.SystemdUnit `yaml:"systemdUnits,omitempty"`
|
||||
}
|
||||
|
||||
// FromFile reads a debug configuration.
|
||||
|
|
|
@ -8,71 +8,71 @@ import (
|
|||
"github.com/edgelesssys/constellation/internal/state"
|
||||
)
|
||||
|
||||
// Code in this file is mostly copied from constellation-coordinator
|
||||
// TODO: import as package from coordinator once it is properly refactored
|
||||
// Code in this file is mostly copied from constellation-controlPlane
|
||||
// TODO: import as package from controlPlane once it is properly refactored
|
||||
|
||||
func GetScalingGroupsFromConfig(stat state.ConstellationState, config *config.Config) (coordinators, nodes cloudtypes.ScalingGroup, err error) {
|
||||
func GetScalingGroupsFromConfig(stat state.ConstellationState, config *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
switch {
|
||||
case len(stat.GCPCoordinators) != 0:
|
||||
case len(stat.GCPControlPlanes) != 0:
|
||||
return getGCPInstances(stat, config)
|
||||
case len(stat.AzureCoordinators) != 0:
|
||||
case len(stat.AzureControlPlane) != 0:
|
||||
return getAzureInstances(stat, config)
|
||||
case len(stat.QEMUCoordinators) != 0:
|
||||
case len(stat.QEMUControlPlane) != 0:
|
||||
return getQEMUInstances(stat, config)
|
||||
default:
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no instances to init")
|
||||
}
|
||||
}
|
||||
|
||||
func getGCPInstances(stat state.ConstellationState, config *config.Config) (coordinators, nodes cloudtypes.ScalingGroup, err error) {
|
||||
if len(stat.GCPCoordinators) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane nodes available, can't create Constellation without any instance")
|
||||
func getGCPInstances(stat state.ConstellationState, config *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
if len(stat.GCPControlPlanes) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane workers available, can't create Constellation without any instance")
|
||||
}
|
||||
|
||||
// GroupID of coordinators is empty, since they currently do not scale.
|
||||
coordinators = cloudtypes.ScalingGroup{Instances: stat.GCPCoordinators}
|
||||
// GroupID of controlPlanes is empty, since they currently do not scale.
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.GCPControlPlanes}
|
||||
|
||||
if len(stat.GCPNodes) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no worker nodes available, can't create Constellation with one instance")
|
||||
if len(stat.GCPWorkers) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no worker workers available, can't create Constellation with one instance")
|
||||
}
|
||||
|
||||
// TODO: make min / max configurable and abstract autoscaling for different cloud providers
|
||||
nodes = cloudtypes.ScalingGroup{Instances: stat.GCPNodes}
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.GCPWorkers}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func getAzureInstances(stat state.ConstellationState, _ *config.Config) (coordinators, nodes cloudtypes.ScalingGroup, err error) {
|
||||
if len(stat.AzureCoordinators) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane nodes available, can't create Constellation cluster without any instance")
|
||||
func getAzureInstances(stat state.ConstellationState, _ *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
if len(stat.AzureControlPlane) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane workers available, can't create Constellation cluster without any instance")
|
||||
}
|
||||
|
||||
// GroupID of coordinators is empty, since they currently do not scale.
|
||||
coordinators = cloudtypes.ScalingGroup{Instances: stat.AzureCoordinators}
|
||||
// GroupID of controlPlanes is empty, since they currently do not scale.
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.AzureControlPlane}
|
||||
|
||||
if len(stat.AzureNodes) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no worker nodes available, can't create Constellation cluster with one instance")
|
||||
if len(stat.AzureWorkers) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no worker workers available, can't create Constellation cluster with one instance")
|
||||
}
|
||||
|
||||
// TODO: make min / max configurable and abstract autoscaling for different cloud providers
|
||||
nodes = cloudtypes.ScalingGroup{Instances: stat.AzureNodes}
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.AzureWorkers}
|
||||
return
|
||||
}
|
||||
|
||||
func getQEMUInstances(stat state.ConstellationState, config *config.Config) (coordinators, nodes cloudtypes.ScalingGroup, err error) {
|
||||
coordinatorMap := stat.QEMUCoordinators
|
||||
if len(coordinatorMap) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no coordinators available, can't create Constellation without any instance")
|
||||
func getQEMUInstances(stat state.ConstellationState, config *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) {
|
||||
controlPlaneMap := stat.QEMUControlPlane
|
||||
if len(controlPlaneMap) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no controlPlanes available, can't create Constellation without any instance")
|
||||
}
|
||||
|
||||
// QEMU does not support autoscaling
|
||||
coordinators = cloudtypes.ScalingGroup{Instances: stat.QEMUCoordinators}
|
||||
controlPlanes = cloudtypes.ScalingGroup{Instances: stat.QEMUControlPlane}
|
||||
|
||||
if len(stat.QEMUNodes) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no nodes available, can't create Constellation with one instance")
|
||||
if len(stat.QEMUWorkers) == 0 {
|
||||
return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no workers available, can't create Constellation with one instance")
|
||||
}
|
||||
|
||||
// QEMU does not support autoscaling
|
||||
nodes = cloudtypes.ScalingGroup{Instances: stat.QEMUNodes}
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.QEMUWorkers}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/edgelesssys/constellation/debugd/coordinator"
|
||||
"github.com/edgelesssys/constellation/debugd/bootstrapper"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd/deploy"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd/metadata"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd/metadata/cloudprovider"
|
||||
|
@ -27,7 +27,7 @@ func main() {
|
|||
flag.Parse()
|
||||
log := logger.New(logger.JSONLog, logger.VerbosityFromInt(*verbosity))
|
||||
fs := afero.NewOsFs()
|
||||
streamer := coordinator.NewFileStreamer(fs)
|
||||
streamer := bootstrapper.NewFileStreamer(fs)
|
||||
serviceManager := deploy.NewServiceManager(log.Named("serviceManager"))
|
||||
ssh := ssh.NewAccess(log, user.NewLinuxUserManager(fs))
|
||||
|
||||
|
|
|
@ -3,17 +3,17 @@ package debugd
|
|||
import "time"
|
||||
|
||||
const (
|
||||
DebugdMetadataFlag = "constellation-debugd"
|
||||
DebugdPort = "4000"
|
||||
GRPCTimeout = 5 * time.Minute
|
||||
SSHCheckInterval = 30 * time.Second
|
||||
DiscoverDebugdInterval = 30 * time.Second
|
||||
CoordinatorDownloadRetryBackoff = 1 * time.Minute
|
||||
CoordinatorDeployFilename = "/opt/coordinator"
|
||||
Chunksize = 1024
|
||||
CoordinatorSystemdUnitName = "coordinator.service"
|
||||
CoordinatorSystemdUnitContents = `[Unit]
|
||||
Description=Constellation Coordinator
|
||||
DebugdMetadataFlag = "constellation-debugd"
|
||||
DebugdPort = "4000"
|
||||
GRPCTimeout = 5 * time.Minute
|
||||
SSHCheckInterval = 30 * time.Second
|
||||
DiscoverDebugdInterval = 30 * time.Second
|
||||
BootstrapperDownloadRetryBackoff = 1 * time.Minute
|
||||
BootstrapperDeployFilename = "/opt/bootstrapper"
|
||||
Chunksize = 1024
|
||||
BootstrapperSystemdUnitName = "bootstrapper.service"
|
||||
BootstrapperSystemdUnitContents = `[Unit]
|
||||
Description=Constellation Bootstrapper
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
[Service]
|
||||
|
@ -23,7 +23,7 @@ ExecStartPre=-setenforce Permissive
|
|||
ExecStartPre=/usr/bin/mkdir -p /opt/cni/bin/
|
||||
# merge all CNI binaries in writable folder until containerd can use multiple CNI bins: https://github.com/containerd/containerd/issues/6600
|
||||
ExecStartPre=/bin/sh -c "/usr/bin/cp /usr/libexec/cni/* /opt/cni/bin/"
|
||||
ExecStart=/opt/coordinator
|
||||
ExecStart=/opt/bootstrapper
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
`
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/edgelesssys/constellation/debugd/coordinator"
|
||||
"github.com/edgelesssys/constellation/debugd/bootstrapper"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd"
|
||||
pb "github.com/edgelesssys/constellation/debugd/service"
|
||||
"github.com/edgelesssys/constellation/internal/logger"
|
||||
|
@ -15,7 +15,7 @@ import (
|
|||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
// Download downloads a coordinator from a given debugd instance.
|
||||
// Download downloads a bootstrapper from a given debugd instance.
|
||||
type Download struct {
|
||||
log *logger.Logger
|
||||
dialer NetDialer
|
||||
|
@ -35,15 +35,15 @@ func New(log *logger.Logger, dialer NetDialer, serviceManager serviceManager, wr
|
|||
}
|
||||
}
|
||||
|
||||
// DownloadCoordinator will open a new grpc connection to another instance, attempting to download a coordinator from that instance.
|
||||
func (d *Download) DownloadCoordinator(ctx context.Context, ip string) error {
|
||||
// DownloadBootstrapper will open a new grpc connection to another instance, attempting to download a bootstrapper from that instance.
|
||||
func (d *Download) DownloadBootstrapper(ctx context.Context, ip string) error {
|
||||
log := d.log.With(zap.String("ip", ip))
|
||||
serverAddr := net.JoinHostPort(ip, debugd.DebugdPort)
|
||||
// only retry download from same endpoint after backoff
|
||||
if lastAttempt, ok := d.attemptedDownloads[serverAddr]; ok && time.Since(lastAttempt) < debugd.CoordinatorDownloadRetryBackoff {
|
||||
return fmt.Errorf("download failed too recently: %v / %v", time.Since(lastAttempt), debugd.CoordinatorDownloadRetryBackoff)
|
||||
if lastAttempt, ok := d.attemptedDownloads[serverAddr]; ok && time.Since(lastAttempt) < debugd.BootstrapperDownloadRetryBackoff {
|
||||
return fmt.Errorf("download failed too recently: %v / %v", time.Since(lastAttempt), debugd.BootstrapperDownloadRetryBackoff)
|
||||
}
|
||||
log.Infof("Trying to download coordinator")
|
||||
log.Infof("Trying to download bootstrapper")
|
||||
d.attemptedDownloads[serverAddr] = time.Now()
|
||||
conn, err := d.dial(ctx, serverAddr)
|
||||
if err != nil {
|
||||
|
@ -52,23 +52,23 @@ func (d *Download) DownloadCoordinator(ctx context.Context, ip string) error {
|
|||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
|
||||
stream, err := client.DownloadCoordinator(ctx, &pb.DownloadCoordinatorRequest{})
|
||||
stream, err := client.DownloadBootstrapper(ctx, &pb.DownloadBootstrapperRequest{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("starting coordinator download from other instance: %w", err)
|
||||
return fmt.Errorf("starting bootstrapper download from other instance: %w", err)
|
||||
}
|
||||
if err := d.writer.WriteStream(debugd.CoordinatorDeployFilename, stream, true); err != nil {
|
||||
return fmt.Errorf("streaming coordinator from other instance: %w", err)
|
||||
if err := d.writer.WriteStream(debugd.BootstrapperDeployFilename, stream, true); err != nil {
|
||||
return fmt.Errorf("streaming bootstrapper from other instance: %w", err)
|
||||
}
|
||||
|
||||
log.Infof("Successfully downloaded coordinator")
|
||||
log.Infof("Successfully downloaded bootstrapper")
|
||||
|
||||
// after the upload succeeds, try to restart the coordinator
|
||||
// after the upload succeeds, try to restart the bootstrapper
|
||||
restartAction := ServiceManagerRequest{
|
||||
Unit: debugd.CoordinatorSystemdUnitName,
|
||||
Unit: debugd.BootstrapperSystemdUnitName,
|
||||
Action: Restart,
|
||||
}
|
||||
if err := d.serviceManager.SystemdAction(ctx, restartAction); err != nil {
|
||||
return fmt.Errorf("restarting coordinator: %w", err)
|
||||
return fmt.Errorf("restarting bootstrapper: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -92,7 +92,7 @@ type serviceManager interface {
|
|||
}
|
||||
|
||||
type streamToFileWriter interface {
|
||||
WriteStream(filename string, stream coordinator.ReadChunkStream, showProgress bool) error
|
||||
WriteStream(filename string, stream bootstrapper.ReadChunkStream, showProgress bool) error
|
||||
}
|
||||
|
||||
// NetDialer can open a net.Conn.
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/edgelesssys/constellation/debugd/coordinator"
|
||||
"github.com/edgelesssys/constellation/debugd/bootstrapper"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd"
|
||||
pb "github.com/edgelesssys/constellation/debugd/service"
|
||||
"github.com/edgelesssys/constellation/internal/grpc/testdialer"
|
||||
|
@ -27,8 +27,8 @@ func TestMain(m *testing.M) {
|
|||
)
|
||||
}
|
||||
|
||||
func TestDownloadCoordinator(t *testing.T) {
|
||||
filename := "/opt/coordinator"
|
||||
func TestDownloadBootstrapper(t *testing.T) {
|
||||
filename := "/opt/bootstrapper"
|
||||
|
||||
testCases := map[string]struct {
|
||||
server fakeOnlyDownloadServer
|
||||
|
@ -108,7 +108,7 @@ func TestDownloadCoordinator(t *testing.T) {
|
|||
serviceManager: &tc.serviceManager,
|
||||
attemptedDownloads: tc.attemptedDownloads,
|
||||
}
|
||||
err := download.DownloadCoordinator(context.Background(), ip)
|
||||
err := download.DownloadBootstrapper(context.Background(), ip)
|
||||
grpcServ.GracefulStop()
|
||||
|
||||
if tc.wantDownloadErr {
|
||||
|
@ -124,7 +124,7 @@ func TestDownloadCoordinator(t *testing.T) {
|
|||
if tc.wantSystemdAction {
|
||||
assert.ElementsMatch(
|
||||
[]ServiceManagerRequest{
|
||||
{Unit: debugd.CoordinatorSystemdUnitName, Action: Restart},
|
||||
{Unit: debugd.BootstrapperSystemdUnitName, Action: Restart},
|
||||
},
|
||||
tc.serviceManager.requests,
|
||||
)
|
||||
|
@ -134,13 +134,13 @@ func TestDownloadCoordinator(t *testing.T) {
|
|||
}
|
||||
|
||||
type stubDownloadClient struct {
|
||||
requests []*pb.DownloadCoordinatorRequest
|
||||
stream coordinator.ReadChunkStream
|
||||
requests []*pb.DownloadBootstrapperRequest
|
||||
stream bootstrapper.ReadChunkStream
|
||||
downloadErr error
|
||||
}
|
||||
|
||||
func (s *stubDownloadClient) DownloadCoordinator(ctx context.Context, in *pb.DownloadCoordinatorRequest, opts ...grpc.CallOption) (coordinator.ReadChunkStream, error) {
|
||||
s.requests = append(s.requests, proto.Clone(in).(*pb.DownloadCoordinatorRequest))
|
||||
func (s *stubDownloadClient) DownloadBootstrapper(ctx context.Context, in *pb.DownloadBootstrapperRequest, opts ...grpc.CallOption) (bootstrapper.ReadChunkStream, error) {
|
||||
s.requests = append(s.requests, proto.Clone(in).(*pb.DownloadBootstrapperRequest))
|
||||
return s.stream, s.downloadErr
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ type fakeStreamToFileWriter struct {
|
|||
filename string
|
||||
}
|
||||
|
||||
func (f *fakeStreamToFileWriter) WriteStream(filename string, stream coordinator.ReadChunkStream, showProgress bool) error {
|
||||
func (f *fakeStreamToFileWriter) WriteStream(filename string, stream bootstrapper.ReadChunkStream, showProgress bool) error {
|
||||
f.filename = filename
|
||||
for {
|
||||
chunk, err := stream.Recv()
|
||||
|
@ -173,14 +173,14 @@ func (f *fakeStreamToFileWriter) WriteStream(filename string, stream coordinator
|
|||
}
|
||||
}
|
||||
|
||||
// fakeOnlyDownloadServer implements DebugdServer; only fakes DownloadCoordinator, panics on every other rpc.
|
||||
// fakeOnlyDownloadServer implements DebugdServer; only fakes DownloadBootstrapper, panics on every other rpc.
|
||||
type fakeOnlyDownloadServer struct {
|
||||
chunks [][]byte
|
||||
downladErr error
|
||||
pb.UnimplementedDebugdServer
|
||||
}
|
||||
|
||||
func (f *fakeOnlyDownloadServer) DownloadCoordinator(request *pb.DownloadCoordinatorRequest, stream pb.Debugd_DownloadCoordinatorServer) error {
|
||||
func (f *fakeOnlyDownloadServer) DownloadBootstrapper(request *pb.DownloadBootstrapperRequest, stream pb.Debugd_DownloadBootstrapperServer) error {
|
||||
for _, chunk := range f.chunks {
|
||||
if err := stream.Send(&pb.Chunk{Content: chunk}); err != nil {
|
||||
return fmt.Errorf("sending chunk: %w", err)
|
||||
|
|
|
@ -140,21 +140,21 @@ func (s *ServiceManager) WriteSystemdUnitFile(ctx context.Context, unit SystemdU
|
|||
return nil
|
||||
}
|
||||
|
||||
// DeployDefaultServiceUnit will write the default "coordinator.service" unit file.
|
||||
// DeployDefaultServiceUnit will write the default "bootstrapper.service" unit file.
|
||||
func DeployDefaultServiceUnit(ctx context.Context, serviceManager *ServiceManager) error {
|
||||
if err := serviceManager.WriteSystemdUnitFile(ctx, SystemdUnit{
|
||||
Name: debugd.CoordinatorSystemdUnitName,
|
||||
Contents: debugd.CoordinatorSystemdUnitContents,
|
||||
Name: debugd.BootstrapperSystemdUnitName,
|
||||
Contents: debugd.BootstrapperSystemdUnitContents,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("writing systemd unit file %q: %w", debugd.CoordinatorSystemdUnitName, err)
|
||||
return fmt.Errorf("writing systemd unit file %q: %w", debugd.BootstrapperSystemdUnitName, err)
|
||||
}
|
||||
|
||||
// try to start the default service if the binary exists but ignore failure.
|
||||
// this is meant to start the coordinator after a reboot
|
||||
// if a coordinator binary was uploaded before.
|
||||
if ok, err := afero.Exists(serviceManager.fs, debugd.CoordinatorDeployFilename); ok && err == nil {
|
||||
// this is meant to start the bootstrapper after a reboot
|
||||
// if a bootstrapper binary was uploaded before.
|
||||
if ok, err := afero.Exists(serviceManager.fs, debugd.BootstrapperDeployFilename); ok && err == nil {
|
||||
_ = serviceManager.SystemdAction(ctx, ServiceManagerRequest{
|
||||
Unit: debugd.CoordinatorSystemdUnitName,
|
||||
Unit: debugd.BootstrapperSystemdUnitName,
|
||||
Action: Start,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
azurecloud "github.com/edgelesssys/constellation/coordinator/cloudprovider/azure"
|
||||
gcpcloud "github.com/edgelesssys/constellation/coordinator/cloudprovider/gcp"
|
||||
qemucloud "github.com/edgelesssys/constellation/coordinator/cloudprovider/qemu"
|
||||
azurecloud "github.com/edgelesssys/constellation/bootstrapper/cloudprovider/azure"
|
||||
gcpcloud "github.com/edgelesssys/constellation/bootstrapper/cloudprovider/gcp"
|
||||
qemucloud "github.com/edgelesssys/constellation/bootstrapper/cloudprovider/qemu"
|
||||
"github.com/edgelesssys/constellation/internal/cloud/metadata"
|
||||
"github.com/edgelesssys/constellation/internal/deploy/ssh"
|
||||
)
|
||||
|
|
|
@ -54,7 +54,7 @@ func (s *Scheduler) discoveryLoop(ctx context.Context, wg *sync.WaitGroup) {
|
|||
if err != nil {
|
||||
s.log.With(zap.Error(err)).Errorf("Discovering debugd IPs failed")
|
||||
} else {
|
||||
if s.downloadCoordinator(ctx, ips) {
|
||||
if s.downloadBootstrapper(ctx, ips) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ func (s *Scheduler) discoveryLoop(ctx context.Context, wg *sync.WaitGroup) {
|
|||
continue
|
||||
}
|
||||
s.log.With(zap.Strings("ips", ips)).Infof("Discovered instances")
|
||||
if s.downloadCoordinator(ctx, ips) {
|
||||
if s.downloadBootstrapper(ctx, ips) {
|
||||
return
|
||||
}
|
||||
case <-ctx.Done():
|
||||
|
@ -102,19 +102,19 @@ func (s *Scheduler) sshLoop(ctx context.Context, wg *sync.WaitGroup) {
|
|||
}
|
||||
}
|
||||
|
||||
// downloadCoordinator tries to download coordinator from a list of ips and logs errors encountered.
|
||||
func (s *Scheduler) downloadCoordinator(ctx context.Context, ips []string) (success bool) {
|
||||
// downloadBootstrapper tries to download bootstrapper from a list of ips and logs errors encountered.
|
||||
func (s *Scheduler) downloadBootstrapper(ctx context.Context, ips []string) (success bool) {
|
||||
for _, ip := range ips {
|
||||
err := s.downloader.DownloadCoordinator(ctx, ip)
|
||||
err := s.downloader.DownloadBootstrapper(ctx, ip)
|
||||
if err == nil {
|
||||
// early exit with success since coordinator should only be downloaded once
|
||||
// early exit with success since bootstrapper should only be downloaded once
|
||||
return true
|
||||
}
|
||||
if errors.Is(err, fs.ErrExist) {
|
||||
// coordinator was already uploaded
|
||||
// bootstrapper was already uploaded
|
||||
return true
|
||||
}
|
||||
s.log.With(zap.Error(err), zap.String("peer", ip)).Errorf("Downloading coordinator from peer failed")
|
||||
s.log.With(zap.Error(err), zap.String("peer", ip)).Errorf("Downloading bootstrapper from peer failed")
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ func (s *Scheduler) deploySSHKeys(ctx context.Context, keys []ssh.UserKey) {
|
|||
}
|
||||
|
||||
type downloader interface {
|
||||
DownloadCoordinator(ctx context.Context, ip string) error
|
||||
DownloadBootstrapper(ctx context.Context, ip string) error
|
||||
}
|
||||
|
||||
type sshDeployer interface {
|
||||
|
|
|
@ -134,7 +134,7 @@ type stubDownloader struct {
|
|||
err error
|
||||
}
|
||||
|
||||
func (s *stubDownloader) DownloadCoordinator(ctx context.Context, ip string) error {
|
||||
func (s *stubDownloader) DownloadBootstrapper(ctx context.Context, ip string) error {
|
||||
s.ips = append(s.ips, ip)
|
||||
return s.err
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/edgelesssys/constellation/debugd/coordinator"
|
||||
"github.com/edgelesssys/constellation/debugd/bootstrapper"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd/deploy"
|
||||
pb "github.com/edgelesssys/constellation/debugd/service"
|
||||
|
@ -52,46 +52,46 @@ func (s *debugdServer) UploadAuthorizedKeys(ctx context.Context, in *pb.UploadAu
|
|||
}, nil
|
||||
}
|
||||
|
||||
// UploadCoordinator receives a coordinator binary in a stream of chunks and writes to a file.
|
||||
func (s *debugdServer) UploadCoordinator(stream pb.Debugd_UploadCoordinatorServer) error {
|
||||
// UploadBootstrapper receives a bootstrapper binary in a stream of chunks and writes to a file.
|
||||
func (s *debugdServer) UploadBootstrapper(stream pb.Debugd_UploadBootstrapperServer) error {
|
||||
startAction := deploy.ServiceManagerRequest{
|
||||
Unit: debugd.CoordinatorSystemdUnitName,
|
||||
Unit: debugd.BootstrapperSystemdUnitName,
|
||||
Action: deploy.Start,
|
||||
}
|
||||
var responseStatus pb.UploadCoordinatorStatus
|
||||
var responseStatus pb.UploadBootstrapperStatus
|
||||
defer func() {
|
||||
if err := s.serviceManager.SystemdAction(stream.Context(), startAction); err != nil {
|
||||
s.log.With(zap.Error(err)).Errorf("Starting uploaded coordinator failed")
|
||||
if responseStatus == pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS {
|
||||
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_START_FAILED
|
||||
s.log.With(zap.Error(err)).Errorf("Starting uploaded bootstrapper failed")
|
||||
if responseStatus == pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_SUCCESS {
|
||||
responseStatus = pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_START_FAILED
|
||||
}
|
||||
}
|
||||
stream.SendAndClose(&pb.UploadCoordinatorResponse{
|
||||
stream.SendAndClose(&pb.UploadBootstrapperResponse{
|
||||
Status: responseStatus,
|
||||
})
|
||||
}()
|
||||
s.log.Infof("Starting coordinator upload")
|
||||
if err := s.streamer.WriteStream(debugd.CoordinatorDeployFilename, stream, true); err != nil {
|
||||
s.log.Infof("Starting bootstrapper upload")
|
||||
if err := s.streamer.WriteStream(debugd.BootstrapperDeployFilename, stream, true); err != nil {
|
||||
if errors.Is(err, fs.ErrExist) {
|
||||
// coordinator was already uploaded
|
||||
s.log.Warnf("Coordinator already uploaded")
|
||||
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_FILE_EXISTS
|
||||
// bootstrapper was already uploaded
|
||||
s.log.Warnf("Bootstrapper already uploaded")
|
||||
responseStatus = pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_FILE_EXISTS
|
||||
return nil
|
||||
}
|
||||
s.log.With(zap.Error(err)).Errorf("Uploading coordinator failed")
|
||||
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_UPLOAD_FAILED
|
||||
return fmt.Errorf("uploading coordinator: %w", err)
|
||||
s.log.With(zap.Error(err)).Errorf("Uploading bootstrapper failed")
|
||||
responseStatus = pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_UPLOAD_FAILED
|
||||
return fmt.Errorf("uploading bootstrapper: %w", err)
|
||||
}
|
||||
|
||||
s.log.Infof("Successfully uploaded coordinator")
|
||||
responseStatus = pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS
|
||||
s.log.Infof("Successfully uploaded bootstrapper")
|
||||
responseStatus = pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_SUCCESS
|
||||
return nil
|
||||
}
|
||||
|
||||
// DownloadCoordinator streams the local coordinator binary to other instances.
|
||||
func (s *debugdServer) DownloadCoordinator(request *pb.DownloadCoordinatorRequest, stream pb.Debugd_DownloadCoordinatorServer) error {
|
||||
s.log.Infof("Sending coordinator to other instance")
|
||||
return s.streamer.ReadStream(debugd.CoordinatorDeployFilename, stream, debugd.Chunksize, true)
|
||||
// DownloadBootstrapper streams the local bootstrapper binary to other instances.
|
||||
func (s *debugdServer) DownloadBootstrapper(request *pb.DownloadBootstrapperRequest, stream pb.Debugd_DownloadBootstrapperServer) error {
|
||||
s.log.Infof("Sending bootstrapper to other instance")
|
||||
return s.streamer.ReadStream(debugd.BootstrapperDeployFilename, stream, debugd.Chunksize, true)
|
||||
}
|
||||
|
||||
// UploadSystemServiceUnits receives systemd service units, writes them to a service file and schedules a daemon-reload.
|
||||
|
@ -133,6 +133,6 @@ type serviceManager interface {
|
|||
}
|
||||
|
||||
type streamer interface {
|
||||
WriteStream(filename string, stream coordinator.ReadChunkStream, showProgress bool) error
|
||||
ReadStream(filename string, stream coordinator.WriteChunkStream, chunksize uint, showProgress bool) error
|
||||
WriteStream(filename string, stream bootstrapper.ReadChunkStream, showProgress bool) error
|
||||
ReadStream(filename string, stream bootstrapper.WriteChunkStream, chunksize uint, showProgress bool) error
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/debugd/coordinator"
|
||||
"github.com/edgelesssys/constellation/debugd/bootstrapper"
|
||||
"github.com/edgelesssys/constellation/debugd/debugd/deploy"
|
||||
pb "github.com/edgelesssys/constellation/debugd/service"
|
||||
"github.com/edgelesssys/constellation/internal/deploy/ssh"
|
||||
|
@ -104,7 +104,7 @@ func TestUploadAuthorizedKeys(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestUploadCoordinator(t *testing.T) {
|
||||
func TestUploadBootstrapper(t *testing.T) {
|
||||
endpoint := "192.0.2.1:4000"
|
||||
|
||||
testCases := map[string]struct {
|
||||
|
@ -113,7 +113,7 @@ func TestUploadCoordinator(t *testing.T) {
|
|||
streamer fakeStreamer
|
||||
uploadChunks [][]byte
|
||||
wantErr bool
|
||||
wantResponseStatus pb.UploadCoordinatorStatus
|
||||
wantResponseStatus pb.UploadBootstrapperStatus
|
||||
wantFile bool
|
||||
wantChunks [][]byte
|
||||
}{
|
||||
|
@ -125,27 +125,27 @@ func TestUploadCoordinator(t *testing.T) {
|
|||
wantChunks: [][]byte{
|
||||
[]byte("test"),
|
||||
},
|
||||
wantResponseStatus: pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS,
|
||||
wantResponseStatus: pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_SUCCESS,
|
||||
},
|
||||
"recv fails": {
|
||||
streamer: fakeStreamer{
|
||||
writeStreamErr: errors.New("recv error"),
|
||||
},
|
||||
wantResponseStatus: pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_UPLOAD_FAILED,
|
||||
wantResponseStatus: pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_UPLOAD_FAILED,
|
||||
wantErr: true,
|
||||
},
|
||||
"starting coordinator fails": {
|
||||
"starting bootstrapper fails": {
|
||||
uploadChunks: [][]byte{
|
||||
[]byte("test"),
|
||||
},
|
||||
serviceManager: stubServiceManager{
|
||||
systemdActionErr: errors.New("starting coordinator error"),
|
||||
systemdActionErr: errors.New("starting bootstrapper error"),
|
||||
},
|
||||
wantFile: true,
|
||||
wantChunks: [][]byte{
|
||||
[]byte("test"),
|
||||
},
|
||||
wantResponseStatus: pb.UploadCoordinatorStatus_UPLOAD_COORDINATOR_START_FAILED,
|
||||
wantResponseStatus: pb.UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_START_FAILED,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ func TestUploadCoordinator(t *testing.T) {
|
|||
require.NoError(err)
|
||||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
stream, err := client.UploadCoordinator(context.Background())
|
||||
stream, err := client.UploadBootstrapper(context.Background())
|
||||
require.NoError(err)
|
||||
require.NoError(fakeWrite(stream, tc.uploadChunks))
|
||||
resp, err := stream.CloseAndRecv()
|
||||
|
@ -180,7 +180,7 @@ func TestUploadCoordinator(t *testing.T) {
|
|||
assert.Equal(tc.wantResponseStatus, resp.Status)
|
||||
if tc.wantFile {
|
||||
assert.Equal(tc.wantChunks, tc.streamer.writeStreamChunks)
|
||||
assert.Equal("/opt/coordinator", tc.streamer.writeStreamFilename)
|
||||
assert.Equal("/opt/bootstrapper", tc.streamer.writeStreamFilename)
|
||||
} else {
|
||||
assert.Empty(tc.streamer.writeStreamChunks)
|
||||
assert.Empty(tc.streamer.writeStreamFilename)
|
||||
|
@ -189,18 +189,18 @@ func TestUploadCoordinator(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestDownloadCoordinator(t *testing.T) {
|
||||
func TestDownloadBootstrapper(t *testing.T) {
|
||||
endpoint := "192.0.2.1:4000"
|
||||
testCases := map[string]struct {
|
||||
ssh stubSSHDeployer
|
||||
serviceManager stubServiceManager
|
||||
request *pb.DownloadCoordinatorRequest
|
||||
request *pb.DownloadBootstrapperRequest
|
||||
streamer fakeStreamer
|
||||
wantErr bool
|
||||
wantChunks [][]byte
|
||||
}{
|
||||
"download works": {
|
||||
request: &pb.DownloadCoordinatorRequest{},
|
||||
request: &pb.DownloadBootstrapperRequest{},
|
||||
streamer: fakeStreamer{
|
||||
readStreamChunks: [][]byte{
|
||||
[]byte("test"),
|
||||
|
@ -212,9 +212,9 @@ func TestDownloadCoordinator(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"download fails": {
|
||||
request: &pb.DownloadCoordinatorRequest{},
|
||||
request: &pb.DownloadBootstrapperRequest{},
|
||||
streamer: fakeStreamer{
|
||||
readStreamErr: errors.New("read coordinator fails"),
|
||||
readStreamErr: errors.New("read bootstrapper fails"),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
|
@ -236,7 +236,7 @@ func TestDownloadCoordinator(t *testing.T) {
|
|||
require.NoError(err)
|
||||
defer conn.Close()
|
||||
client := pb.NewDebugdClient(conn)
|
||||
stream, err := client.DownloadCoordinator(context.Background(), tc.request)
|
||||
stream, err := client.DownloadBootstrapper(context.Background(), tc.request)
|
||||
require.NoError(err)
|
||||
chunks, err := fakeRead(stream)
|
||||
grpcServ.GracefulStop()
|
||||
|
@ -247,7 +247,7 @@ func TestDownloadCoordinator(t *testing.T) {
|
|||
}
|
||||
require.NoError(err)
|
||||
assert.Equal(tc.wantChunks, chunks)
|
||||
assert.Equal("/opt/coordinator", tc.streamer.readStreamFilename)
|
||||
assert.Equal("/opt/bootstrapper", tc.streamer.readStreamFilename)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ type fakeStreamer struct {
|
|||
readStreamErr error
|
||||
}
|
||||
|
||||
func (f *fakeStreamer) WriteStream(filename string, stream coordinator.ReadChunkStream, showProgress bool) error {
|
||||
func (f *fakeStreamer) WriteStream(filename string, stream bootstrapper.ReadChunkStream, showProgress bool) error {
|
||||
f.writeStreamFilename = filename
|
||||
for {
|
||||
chunk, err := stream.Recv()
|
||||
|
@ -397,7 +397,7 @@ func (f *fakeStreamer) WriteStream(filename string, stream coordinator.ReadChunk
|
|||
}
|
||||
}
|
||||
|
||||
func (f *fakeStreamer) ReadStream(filename string, stream coordinator.WriteChunkStream, chunksize uint, showProgress bool) error {
|
||||
func (f *fakeStreamer) ReadStream(filename string, stream bootstrapper.WriteChunkStream, chunksize uint, showProgress bool) error {
|
||||
f.readStreamFilename = filename
|
||||
for _, chunk := range f.readStreamChunks {
|
||||
if err := stream.Send(&pb.Chunk{Content: chunk}); err != nil {
|
||||
|
@ -422,7 +422,7 @@ func setupServerWithConn(endpoint string, serv *debugdServer) (*grpc.Server, *gr
|
|||
return grpcServ, conn, nil
|
||||
}
|
||||
|
||||
func fakeWrite(stream coordinator.WriteChunkStream, chunks [][]byte) error {
|
||||
func fakeWrite(stream bootstrapper.WriteChunkStream, chunks [][]byte) error {
|
||||
for _, chunk := range chunks {
|
||||
err := stream.Send(&pb.Chunk{
|
||||
Content: chunk,
|
||||
|
@ -434,7 +434,7 @@ func fakeWrite(stream coordinator.WriteChunkStream, chunks [][]byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func fakeRead(stream coordinator.ReadChunkStream) ([][]byte, error) {
|
||||
func fakeRead(stream bootstrapper.ReadChunkStream) ([][]byte, error) {
|
||||
var chunks [][]byte
|
||||
for {
|
||||
chunk, err := stream.Recv()
|
||||
|
|
|
@ -66,55 +66,55 @@ func (UploadAuthorizedKeysStatus) EnumDescriptor() ([]byte, []int) {
|
|||
return file_debugd_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type UploadCoordinatorStatus int32
|
||||
type UploadBootstrapperStatus int32
|
||||
|
||||
const (
|
||||
UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS UploadCoordinatorStatus = 0
|
||||
UploadCoordinatorStatus_UPLOAD_COORDINATOR_UPLOAD_FAILED UploadCoordinatorStatus = 1
|
||||
UploadCoordinatorStatus_UPLOAD_COORDINATOR_START_FAILED UploadCoordinatorStatus = 2
|
||||
UploadCoordinatorStatus_UPLOAD_COORDINATOR_FILE_EXISTS UploadCoordinatorStatus = 3
|
||||
UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_SUCCESS UploadBootstrapperStatus = 0
|
||||
UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_UPLOAD_FAILED UploadBootstrapperStatus = 1
|
||||
UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_START_FAILED UploadBootstrapperStatus = 2
|
||||
UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_FILE_EXISTS UploadBootstrapperStatus = 3
|
||||
)
|
||||
|
||||
// Enum value maps for UploadCoordinatorStatus.
|
||||
// Enum value maps for UploadBootstrapperStatus.
|
||||
var (
|
||||
UploadCoordinatorStatus_name = map[int32]string{
|
||||
0: "UPLOAD_COORDINATOR_SUCCESS",
|
||||
1: "UPLOAD_COORDINATOR_UPLOAD_FAILED",
|
||||
2: "UPLOAD_COORDINATOR_START_FAILED",
|
||||
3: "UPLOAD_COORDINATOR_FILE_EXISTS",
|
||||
UploadBootstrapperStatus_name = map[int32]string{
|
||||
0: "UPLOAD_BOOTSTRAPPER_SUCCESS",
|
||||
1: "UPLOAD_BOOTSTRAPPER_UPLOAD_FAILED",
|
||||
2: "UPLOAD_BOOTSTRAPPER_START_FAILED",
|
||||
3: "UPLOAD_BOOTSTRAPPER_FILE_EXISTS",
|
||||
}
|
||||
UploadCoordinatorStatus_value = map[string]int32{
|
||||
"UPLOAD_COORDINATOR_SUCCESS": 0,
|
||||
"UPLOAD_COORDINATOR_UPLOAD_FAILED": 1,
|
||||
"UPLOAD_COORDINATOR_START_FAILED": 2,
|
||||
"UPLOAD_COORDINATOR_FILE_EXISTS": 3,
|
||||
UploadBootstrapperStatus_value = map[string]int32{
|
||||
"UPLOAD_BOOTSTRAPPER_SUCCESS": 0,
|
||||
"UPLOAD_BOOTSTRAPPER_UPLOAD_FAILED": 1,
|
||||
"UPLOAD_BOOTSTRAPPER_START_FAILED": 2,
|
||||
"UPLOAD_BOOTSTRAPPER_FILE_EXISTS": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x UploadCoordinatorStatus) Enum() *UploadCoordinatorStatus {
|
||||
p := new(UploadCoordinatorStatus)
|
||||
func (x UploadBootstrapperStatus) Enum() *UploadBootstrapperStatus {
|
||||
p := new(UploadBootstrapperStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x UploadCoordinatorStatus) String() string {
|
||||
func (x UploadBootstrapperStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (UploadCoordinatorStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
func (UploadBootstrapperStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_debugd_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (UploadCoordinatorStatus) Type() protoreflect.EnumType {
|
||||
func (UploadBootstrapperStatus) Type() protoreflect.EnumType {
|
||||
return &file_debugd_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x UploadCoordinatorStatus) Number() protoreflect.EnumNumber {
|
||||
func (x UploadBootstrapperStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UploadCoordinatorStatus.Descriptor instead.
|
||||
func (UploadCoordinatorStatus) EnumDescriptor() ([]byte, []int) {
|
||||
// Deprecated: Use UploadBootstrapperStatus.Descriptor instead.
|
||||
func (UploadBootstrapperStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_debugd_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
|
@ -164,14 +164,14 @@ func (UploadSystemdServiceUnitsStatus) EnumDescriptor() ([]byte, []int) {
|
|||
return file_debugd_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type DownloadCoordinatorRequest struct {
|
||||
type DownloadBootstrapperRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *DownloadCoordinatorRequest) Reset() {
|
||||
*x = DownloadCoordinatorRequest{}
|
||||
func (x *DownloadBootstrapperRequest) Reset() {
|
||||
*x = DownloadBootstrapperRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_debugd_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
|
@ -179,13 +179,13 @@ func (x *DownloadCoordinatorRequest) Reset() {
|
|||
}
|
||||
}
|
||||
|
||||
func (x *DownloadCoordinatorRequest) String() string {
|
||||
func (x *DownloadBootstrapperRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DownloadCoordinatorRequest) ProtoMessage() {}
|
||||
func (*DownloadBootstrapperRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DownloadCoordinatorRequest) ProtoReflect() protoreflect.Message {
|
||||
func (x *DownloadBootstrapperRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_debugd_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
|
@ -197,8 +197,8 @@ func (x *DownloadCoordinatorRequest) ProtoReflect() protoreflect.Message {
|
|||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DownloadCoordinatorRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DownloadCoordinatorRequest) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use DownloadBootstrapperRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DownloadBootstrapperRequest) Descriptor() ([]byte, []int) {
|
||||
return file_debugd_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
|
@ -398,16 +398,16 @@ func (x *Chunk) GetContent() []byte {
|
|||
return nil
|
||||
}
|
||||
|
||||
type UploadCoordinatorResponse struct {
|
||||
type UploadBootstrapperResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Status UploadCoordinatorStatus `protobuf:"varint,1,opt,name=status,proto3,enum=debugd.UploadCoordinatorStatus" json:"status,omitempty"`
|
||||
Status UploadBootstrapperStatus `protobuf:"varint,1,opt,name=status,proto3,enum=debugd.UploadBootstrapperStatus" json:"status,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UploadCoordinatorResponse) Reset() {
|
||||
*x = UploadCoordinatorResponse{}
|
||||
func (x *UploadBootstrapperResponse) Reset() {
|
||||
*x = UploadBootstrapperResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_debugd_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
|
@ -415,13 +415,13 @@ func (x *UploadCoordinatorResponse) Reset() {
|
|||
}
|
||||
}
|
||||
|
||||
func (x *UploadCoordinatorResponse) String() string {
|
||||
func (x *UploadBootstrapperResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UploadCoordinatorResponse) ProtoMessage() {}
|
||||
func (*UploadBootstrapperResponse) ProtoMessage() {}
|
||||
|
||||
func (x *UploadCoordinatorResponse) ProtoReflect() protoreflect.Message {
|
||||
func (x *UploadBootstrapperResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_debugd_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
|
@ -433,16 +433,16 @@ func (x *UploadCoordinatorResponse) ProtoReflect() protoreflect.Message {
|
|||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use UploadCoordinatorResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UploadCoordinatorResponse) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use UploadBootstrapperResponse.ProtoReflect.Descriptor instead.
|
||||
func (*UploadBootstrapperResponse) Descriptor() ([]byte, []int) {
|
||||
return file_debugd_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *UploadCoordinatorResponse) GetStatus() UploadCoordinatorStatus {
|
||||
func (x *UploadBootstrapperResponse) GetStatus() UploadBootstrapperStatus {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return UploadCoordinatorStatus_UPLOAD_COORDINATOR_SUCCESS
|
||||
return UploadBootstrapperStatus_UPLOAD_BOOTSTRAPPER_SUCCESS
|
||||
}
|
||||
|
||||
type ServiceUnit struct {
|
||||
|
@ -598,99 +598,99 @@ var File_debugd_proto protoreflect.FileDescriptor
|
|||
|
||||
var file_debugd_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
|
||||
0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
|
||||
0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x48,
|
||||
0x0a, 0x1b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
|
||||
0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a,
|
||||
0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x65,
|
||||
0x62, 0x75, 0x67, 0x64, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b,
|
||||
0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5a, 0x0a, 0x1c, 0x55, 0x70, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67,
|
||||
0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
|
||||
0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74,
|
||||
0x61, 0x74, 0x75, 0x73, 0x22, 0x21, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x54, 0x0a, 0x19, 0x55, 0x70, 0x6c, 0x6f, 0x61,
|
||||
0x64, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3d, 0x0a,
|
||||
0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x4d, 0x0a, 0x20,
|
||||
0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x12, 0x29, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x13, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x55, 0x6e, 0x69, 0x74, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x22, 0x64, 0x0a, 0x21, 0x55,
|
||||
0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
||||
0x32, 0x27, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64,
|
||||
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e,
|
||||
0x69, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
|
||||
0x73, 0x2a, 0x64, 0x0a, 0x1a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f,
|
||||
0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
|
||||
0x22, 0x0a, 0x1e, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52,
|
||||
0x49, 0x5a, 0x45, 0x44, 0x5f, 0x4b, 0x45, 0x59, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53,
|
||||
0x53, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x41, 0x55,
|
||||
0x54, 0x48, 0x4f, 0x52, 0x49, 0x5a, 0x45, 0x44, 0x5f, 0x4b, 0x45, 0x59, 0x53, 0x5f, 0x46, 0x41,
|
||||
0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x01, 0x2a, 0xa8, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x4f,
|
||||
0x4f, 0x52, 0x44, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53,
|
||||
0x53, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x4f,
|
||||
0x4f, 0x52, 0x44, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44,
|
||||
0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x23, 0x0a, 0x1f, 0x55, 0x50, 0x4c,
|
||||
0x4f, 0x41, 0x44, 0x5f, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f,
|
||||
0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x22,
|
||||
0x0a, 0x1e, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x49, 0x4e,
|
||||
0x41, 0x54, 0x4f, 0x52, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53,
|
||||
0x10, 0x03, 0x2a, 0x75, 0x0a, 0x1f, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x28, 0x0a, 0x24, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f,
|
||||
0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f,
|
||||
0x55, 0x4e, 0x49, 0x54, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12,
|
||||
0x28, 0x0a, 0x24, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d,
|
||||
0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x53, 0x5f,
|
||||
0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x01, 0x32, 0xf9, 0x02, 0x0a, 0x06, 0x44, 0x65,
|
||||
0x62, 0x75, 0x67, 0x64, 0x12, 0x63, 0x0a, 0x14, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75,
|
||||
0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x23, 0x2e, 0x64,
|
||||
0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x24, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61,
|
||||
0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x11, 0x55, 0x70, 0x6c,
|
||||
0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x0d,
|
||||
0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x21, 0x2e,
|
||||
0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6f,
|
||||
0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x28, 0x01, 0x12, 0x4c, 0x0a, 0x13, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
|
||||
0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x22, 0x2e, 0x64, 0x65,
|
||||
0x62, 0x75, 0x67, 0x64, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6f,
|
||||
0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x0d, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x00,
|
||||
0x30, 0x01, 0x12, 0x71, 0x0a, 0x18, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x28,
|
||||
0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74,
|
||||
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67,
|
||||
0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53,
|
||||
0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22,
|
||||
0x48, 0x0a, 0x1b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29,
|
||||
0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64,
|
||||
0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
|
||||
0x4b, 0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5a, 0x0a, 0x1c, 0x55, 0x70, 0x6c,
|
||||
0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79,
|
||||
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x64, 0x65, 0x62, 0x75,
|
||||
0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x21, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x18,
|
||||
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
||||
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x56, 0x0a, 0x1a, 0x55, 0x70, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e,
|
||||
0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70,
|
||||
0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x22, 0x3d, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22,
|
||||
0x4d, 0x0a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x05, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x22, 0x64,
|
||||
0x0a, 0x21, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x64, 0x67, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x73, 0x79, 0x73, 0x2f,
|
||||
0x63, 0x6f, 0x6e, 0x73, 0x74, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x65,
|
||||
0x62, 0x75, 0x67, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c,
|
||||
0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74,
|
||||
0x61, 0x74, 0x75, 0x73, 0x2a, 0x64, 0x0a, 0x1a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75,
|
||||
0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x12, 0x22, 0x0a, 0x1e, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x41, 0x55, 0x54,
|
||||
0x48, 0x4f, 0x52, 0x49, 0x5a, 0x45, 0x44, 0x5f, 0x4b, 0x45, 0x59, 0x53, 0x5f, 0x53, 0x55, 0x43,
|
||||
0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44,
|
||||
0x5f, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x49, 0x5a, 0x45, 0x44, 0x5f, 0x4b, 0x45, 0x59, 0x53,
|
||||
0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x01, 0x2a, 0xad, 0x01, 0x0a, 0x18, 0x55,
|
||||
0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x65,
|
||||
0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x55, 0x50, 0x4c, 0x4f, 0x41,
|
||||
0x44, 0x5f, 0x42, 0x4f, 0x4f, 0x54, 0x53, 0x54, 0x52, 0x41, 0x50, 0x50, 0x45, 0x52, 0x5f, 0x53,
|
||||
0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x55, 0x50, 0x4c, 0x4f,
|
||||
0x41, 0x44, 0x5f, 0x42, 0x4f, 0x4f, 0x54, 0x53, 0x54, 0x52, 0x41, 0x50, 0x50, 0x45, 0x52, 0x5f,
|
||||
0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12,
|
||||
0x24, 0x0a, 0x20, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x42, 0x4f, 0x4f, 0x54, 0x53, 0x54,
|
||||
0x52, 0x41, 0x50, 0x50, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x46, 0x41, 0x49,
|
||||
0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x23, 0x0a, 0x1f, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f,
|
||||
0x42, 0x4f, 0x4f, 0x54, 0x53, 0x54, 0x52, 0x41, 0x50, 0x50, 0x45, 0x52, 0x5f, 0x46, 0x49, 0x4c,
|
||||
0x45, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x03, 0x2a, 0x75, 0x0a, 0x1f, 0x55, 0x70,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x28, 0x0a,
|
||||
0x24, 0x55, 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x44, 0x5f,
|
||||
0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x53, 0x5f, 0x53, 0x55,
|
||||
0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x28, 0x0a, 0x24, 0x55, 0x50, 0x4c, 0x4f, 0x41,
|
||||
0x44, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43,
|
||||
0x45, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10,
|
||||
0x01, 0x32, 0xfd, 0x02, 0x0a, 0x06, 0x44, 0x65, 0x62, 0x75, 0x67, 0x64, 0x12, 0x63, 0x0a, 0x14,
|
||||
0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
|
||||
0x4b, 0x65, 0x79, 0x73, 0x12, 0x23, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x4b, 0x65,
|
||||
0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x64, 0x65, 0x62, 0x75,
|
||||
0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x4b, 0x0a, 0x12, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73,
|
||||
0x74, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64,
|
||||
0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x22, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e,
|
||||
0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70,
|
||||
0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x4e,
|
||||
0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74,
|
||||
0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e,
|
||||
0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
|
||||
0x70, 0x70, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x64, 0x65,
|
||||
0x62, 0x75, 0x67, 0x64, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x00, 0x30, 0x01, 0x12, 0x71,
|
||||
0x0a, 0x18, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x28, 0x2e, 0x64, 0x65, 0x62,
|
||||
0x75, 0x67, 0x64, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
|
||||
0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64, 0x2e, 0x55, 0x70,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x65, 0x64, 0x67, 0x65, 0x6c, 0x65, 0x73, 0x73, 0x73, 0x79, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73,
|
||||
0x74, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x64,
|
||||
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -709,14 +709,14 @@ var file_debugd_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
|
|||
var file_debugd_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_debugd_proto_goTypes = []interface{}{
|
||||
(UploadAuthorizedKeysStatus)(0), // 0: debugd.UploadAuthorizedKeysStatus
|
||||
(UploadCoordinatorStatus)(0), // 1: debugd.UploadCoordinatorStatus
|
||||
(UploadBootstrapperStatus)(0), // 1: debugd.UploadBootstrapperStatus
|
||||
(UploadSystemdServiceUnitsStatus)(0), // 2: debugd.UploadSystemdServiceUnitsStatus
|
||||
(*DownloadCoordinatorRequest)(nil), // 3: debugd.DownloadCoordinatorRequest
|
||||
(*DownloadBootstrapperRequest)(nil), // 3: debugd.DownloadBootstrapperRequest
|
||||
(*AuthorizedKey)(nil), // 4: debugd.AuthorizedKey
|
||||
(*UploadAuthorizedKeysRequest)(nil), // 5: debugd.UploadAuthorizedKeysRequest
|
||||
(*UploadAuthorizedKeysResponse)(nil), // 6: debugd.UploadAuthorizedKeysResponse
|
||||
(*Chunk)(nil), // 7: debugd.Chunk
|
||||
(*UploadCoordinatorResponse)(nil), // 8: debugd.UploadCoordinatorResponse
|
||||
(*UploadBootstrapperResponse)(nil), // 8: debugd.UploadBootstrapperResponse
|
||||
(*ServiceUnit)(nil), // 9: debugd.ServiceUnit
|
||||
(*UploadSystemdServiceUnitsRequest)(nil), // 10: debugd.UploadSystemdServiceUnitsRequest
|
||||
(*UploadSystemdServiceUnitsResponse)(nil), // 11: debugd.UploadSystemdServiceUnitsResponse
|
||||
|
@ -724,16 +724,16 @@ var file_debugd_proto_goTypes = []interface{}{
|
|||
var file_debugd_proto_depIdxs = []int32{
|
||||
4, // 0: debugd.UploadAuthorizedKeysRequest.keys:type_name -> debugd.AuthorizedKey
|
||||
0, // 1: debugd.UploadAuthorizedKeysResponse.status:type_name -> debugd.UploadAuthorizedKeysStatus
|
||||
1, // 2: debugd.UploadCoordinatorResponse.status:type_name -> debugd.UploadCoordinatorStatus
|
||||
1, // 2: debugd.UploadBootstrapperResponse.status:type_name -> debugd.UploadBootstrapperStatus
|
||||
9, // 3: debugd.UploadSystemdServiceUnitsRequest.units:type_name -> debugd.ServiceUnit
|
||||
2, // 4: debugd.UploadSystemdServiceUnitsResponse.status:type_name -> debugd.UploadSystemdServiceUnitsStatus
|
||||
5, // 5: debugd.Debugd.UploadAuthorizedKeys:input_type -> debugd.UploadAuthorizedKeysRequest
|
||||
7, // 6: debugd.Debugd.UploadCoordinator:input_type -> debugd.Chunk
|
||||
3, // 7: debugd.Debugd.DownloadCoordinator:input_type -> debugd.DownloadCoordinatorRequest
|
||||
7, // 6: debugd.Debugd.UploadBootstrapper:input_type -> debugd.Chunk
|
||||
3, // 7: debugd.Debugd.DownloadBootstrapper:input_type -> debugd.DownloadBootstrapperRequest
|
||||
10, // 8: debugd.Debugd.UploadSystemServiceUnits:input_type -> debugd.UploadSystemdServiceUnitsRequest
|
||||
6, // 9: debugd.Debugd.UploadAuthorizedKeys:output_type -> debugd.UploadAuthorizedKeysResponse
|
||||
8, // 10: debugd.Debugd.UploadCoordinator:output_type -> debugd.UploadCoordinatorResponse
|
||||
7, // 11: debugd.Debugd.DownloadCoordinator:output_type -> debugd.Chunk
|
||||
8, // 10: debugd.Debugd.UploadBootstrapper:output_type -> debugd.UploadBootstrapperResponse
|
||||
7, // 11: debugd.Debugd.DownloadBootstrapper:output_type -> debugd.Chunk
|
||||
11, // 12: debugd.Debugd.UploadSystemServiceUnits:output_type -> debugd.UploadSystemdServiceUnitsResponse
|
||||
9, // [9:13] is the sub-list for method output_type
|
||||
5, // [5:9] is the sub-list for method input_type
|
||||
|
@ -749,7 +749,7 @@ func file_debugd_proto_init() {
|
|||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_debugd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DownloadCoordinatorRequest); i {
|
||||
switch v := v.(*DownloadBootstrapperRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
|
@ -809,7 +809,7 @@ func file_debugd_proto_init() {
|
|||
}
|
||||
}
|
||||
file_debugd_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UploadCoordinatorResponse); i {
|
||||
switch v := v.(*UploadBootstrapperResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
|
|
|
@ -6,12 +6,12 @@ package debugd;
|
|||
|
||||
service Debugd {
|
||||
rpc UploadAuthorizedKeys(UploadAuthorizedKeysRequest) returns (UploadAuthorizedKeysResponse) {}
|
||||
rpc UploadCoordinator(stream Chunk) returns (UploadCoordinatorResponse) {}
|
||||
rpc DownloadCoordinator(DownloadCoordinatorRequest) returns (stream Chunk) {}
|
||||
rpc UploadBootstrapper(stream Chunk) returns (UploadBootstrapperResponse) {}
|
||||
rpc DownloadBootstrapper(DownloadBootstrapperRequest) returns (stream Chunk) {}
|
||||
rpc UploadSystemServiceUnits(UploadSystemdServiceUnitsRequest) returns (UploadSystemdServiceUnitsResponse) {}
|
||||
}
|
||||
|
||||
message DownloadCoordinatorRequest {}
|
||||
message DownloadBootstrapperRequest {}
|
||||
|
||||
message AuthorizedKey {
|
||||
string username = 1;
|
||||
|
@ -35,15 +35,15 @@ message Chunk {
|
|||
bytes content = 1;
|
||||
}
|
||||
|
||||
message UploadCoordinatorResponse {
|
||||
UploadCoordinatorStatus status = 1;
|
||||
message UploadBootstrapperResponse {
|
||||
UploadBootstrapperStatus status = 1;
|
||||
}
|
||||
|
||||
enum UploadCoordinatorStatus {
|
||||
UPLOAD_COORDINATOR_SUCCESS = 0;
|
||||
UPLOAD_COORDINATOR_UPLOAD_FAILED = 1;
|
||||
UPLOAD_COORDINATOR_START_FAILED = 2;
|
||||
UPLOAD_COORDINATOR_FILE_EXISTS = 3;
|
||||
enum UploadBootstrapperStatus {
|
||||
UPLOAD_BOOTSTRAPPER_SUCCESS = 0;
|
||||
UPLOAD_BOOTSTRAPPER_UPLOAD_FAILED = 1;
|
||||
UPLOAD_BOOTSTRAPPER_START_FAILED = 2;
|
||||
UPLOAD_BOOTSTRAPPER_FILE_EXISTS = 3;
|
||||
}
|
||||
|
||||
message ServiceUnit {
|
||||
|
|
|
@ -23,8 +23,8 @@ const _ = grpc.SupportPackageIsVersion7
|
|||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type DebugdClient interface {
|
||||
UploadAuthorizedKeys(ctx context.Context, in *UploadAuthorizedKeysRequest, opts ...grpc.CallOption) (*UploadAuthorizedKeysResponse, error)
|
||||
UploadCoordinator(ctx context.Context, opts ...grpc.CallOption) (Debugd_UploadCoordinatorClient, error)
|
||||
DownloadCoordinator(ctx context.Context, in *DownloadCoordinatorRequest, opts ...grpc.CallOption) (Debugd_DownloadCoordinatorClient, error)
|
||||
UploadBootstrapper(ctx context.Context, opts ...grpc.CallOption) (Debugd_UploadBootstrapperClient, error)
|
||||
DownloadBootstrapper(ctx context.Context, in *DownloadBootstrapperRequest, opts ...grpc.CallOption) (Debugd_DownloadBootstrapperClient, error)
|
||||
UploadSystemServiceUnits(ctx context.Context, in *UploadSystemdServiceUnitsRequest, opts ...grpc.CallOption) (*UploadSystemdServiceUnitsResponse, error)
|
||||
}
|
||||
|
||||
|
@ -45,46 +45,46 @@ func (c *debugdClient) UploadAuthorizedKeys(ctx context.Context, in *UploadAutho
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *debugdClient) UploadCoordinator(ctx context.Context, opts ...grpc.CallOption) (Debugd_UploadCoordinatorClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Debugd_ServiceDesc.Streams[0], "/debugd.Debugd/UploadCoordinator", opts...)
|
||||
func (c *debugdClient) UploadBootstrapper(ctx context.Context, opts ...grpc.CallOption) (Debugd_UploadBootstrapperClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Debugd_ServiceDesc.Streams[0], "/debugd.Debugd/UploadBootstrapper", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &debugdUploadCoordinatorClient{stream}
|
||||
x := &debugdUploadBootstrapperClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Debugd_UploadCoordinatorClient interface {
|
||||
type Debugd_UploadBootstrapperClient interface {
|
||||
Send(*Chunk) error
|
||||
CloseAndRecv() (*UploadCoordinatorResponse, error)
|
||||
CloseAndRecv() (*UploadBootstrapperResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type debugdUploadCoordinatorClient struct {
|
||||
type debugdUploadBootstrapperClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *debugdUploadCoordinatorClient) Send(m *Chunk) error {
|
||||
func (x *debugdUploadBootstrapperClient) Send(m *Chunk) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *debugdUploadCoordinatorClient) CloseAndRecv() (*UploadCoordinatorResponse, error) {
|
||||
func (x *debugdUploadBootstrapperClient) CloseAndRecv() (*UploadBootstrapperResponse, error) {
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := new(UploadCoordinatorResponse)
|
||||
m := new(UploadBootstrapperResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *debugdClient) DownloadCoordinator(ctx context.Context, in *DownloadCoordinatorRequest, opts ...grpc.CallOption) (Debugd_DownloadCoordinatorClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Debugd_ServiceDesc.Streams[1], "/debugd.Debugd/DownloadCoordinator", opts...)
|
||||
func (c *debugdClient) DownloadBootstrapper(ctx context.Context, in *DownloadBootstrapperRequest, opts ...grpc.CallOption) (Debugd_DownloadBootstrapperClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Debugd_ServiceDesc.Streams[1], "/debugd.Debugd/DownloadBootstrapper", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &debugdDownloadCoordinatorClient{stream}
|
||||
x := &debugdDownloadBootstrapperClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -94,16 +94,16 @@ func (c *debugdClient) DownloadCoordinator(ctx context.Context, in *DownloadCoor
|
|||
return x, nil
|
||||
}
|
||||
|
||||
type Debugd_DownloadCoordinatorClient interface {
|
||||
type Debugd_DownloadBootstrapperClient interface {
|
||||
Recv() (*Chunk, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type debugdDownloadCoordinatorClient struct {
|
||||
type debugdDownloadBootstrapperClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *debugdDownloadCoordinatorClient) Recv() (*Chunk, error) {
|
||||
func (x *debugdDownloadBootstrapperClient) Recv() (*Chunk, error) {
|
||||
m := new(Chunk)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
|
@ -125,8 +125,8 @@ func (c *debugdClient) UploadSystemServiceUnits(ctx context.Context, in *UploadS
|
|||
// for forward compatibility
|
||||
type DebugdServer interface {
|
||||
UploadAuthorizedKeys(context.Context, *UploadAuthorizedKeysRequest) (*UploadAuthorizedKeysResponse, error)
|
||||
UploadCoordinator(Debugd_UploadCoordinatorServer) error
|
||||
DownloadCoordinator(*DownloadCoordinatorRequest, Debugd_DownloadCoordinatorServer) error
|
||||
UploadBootstrapper(Debugd_UploadBootstrapperServer) error
|
||||
DownloadBootstrapper(*DownloadBootstrapperRequest, Debugd_DownloadBootstrapperServer) error
|
||||
UploadSystemServiceUnits(context.Context, *UploadSystemdServiceUnitsRequest) (*UploadSystemdServiceUnitsResponse, error)
|
||||
mustEmbedUnimplementedDebugdServer()
|
||||
}
|
||||
|
@ -138,11 +138,11 @@ type UnimplementedDebugdServer struct {
|
|||
func (UnimplementedDebugdServer) UploadAuthorizedKeys(context.Context, *UploadAuthorizedKeysRequest) (*UploadAuthorizedKeysResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UploadAuthorizedKeys not implemented")
|
||||
}
|
||||
func (UnimplementedDebugdServer) UploadCoordinator(Debugd_UploadCoordinatorServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method UploadCoordinator not implemented")
|
||||
func (UnimplementedDebugdServer) UploadBootstrapper(Debugd_UploadBootstrapperServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method UploadBootstrapper not implemented")
|
||||
}
|
||||
func (UnimplementedDebugdServer) DownloadCoordinator(*DownloadCoordinatorRequest, Debugd_DownloadCoordinatorServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method DownloadCoordinator not implemented")
|
||||
func (UnimplementedDebugdServer) DownloadBootstrapper(*DownloadBootstrapperRequest, Debugd_DownloadBootstrapperServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method DownloadBootstrapper not implemented")
|
||||
}
|
||||
func (UnimplementedDebugdServer) UploadSystemServiceUnits(context.Context, *UploadSystemdServiceUnitsRequest) (*UploadSystemdServiceUnitsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UploadSystemServiceUnits not implemented")
|
||||
|
@ -178,25 +178,25 @@ func _Debugd_UploadAuthorizedKeys_Handler(srv interface{}, ctx context.Context,
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Debugd_UploadCoordinator_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(DebugdServer).UploadCoordinator(&debugdUploadCoordinatorServer{stream})
|
||||
func _Debugd_UploadBootstrapper_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(DebugdServer).UploadBootstrapper(&debugdUploadBootstrapperServer{stream})
|
||||
}
|
||||
|
||||
type Debugd_UploadCoordinatorServer interface {
|
||||
SendAndClose(*UploadCoordinatorResponse) error
|
||||
type Debugd_UploadBootstrapperServer interface {
|
||||
SendAndClose(*UploadBootstrapperResponse) error
|
||||
Recv() (*Chunk, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type debugdUploadCoordinatorServer struct {
|
||||
type debugdUploadBootstrapperServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *debugdUploadCoordinatorServer) SendAndClose(m *UploadCoordinatorResponse) error {
|
||||
func (x *debugdUploadBootstrapperServer) SendAndClose(m *UploadBootstrapperResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *debugdUploadCoordinatorServer) Recv() (*Chunk, error) {
|
||||
func (x *debugdUploadBootstrapperServer) Recv() (*Chunk, error) {
|
||||
m := new(Chunk)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
|
@ -204,24 +204,24 @@ func (x *debugdUploadCoordinatorServer) Recv() (*Chunk, error) {
|
|||
return m, nil
|
||||
}
|
||||
|
||||
func _Debugd_DownloadCoordinator_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(DownloadCoordinatorRequest)
|
||||
func _Debugd_DownloadBootstrapper_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(DownloadBootstrapperRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(DebugdServer).DownloadCoordinator(m, &debugdDownloadCoordinatorServer{stream})
|
||||
return srv.(DebugdServer).DownloadBootstrapper(m, &debugdDownloadBootstrapperServer{stream})
|
||||
}
|
||||
|
||||
type Debugd_DownloadCoordinatorServer interface {
|
||||
type Debugd_DownloadBootstrapperServer interface {
|
||||
Send(*Chunk) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type debugdDownloadCoordinatorServer struct {
|
||||
type debugdDownloadBootstrapperServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *debugdDownloadCoordinatorServer) Send(m *Chunk) error {
|
||||
func (x *debugdDownloadBootstrapperServer) Send(m *Chunk) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
|
@ -261,13 +261,13 @@ var Debugd_ServiceDesc = grpc.ServiceDesc{
|
|||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "UploadCoordinator",
|
||||
Handler: _Debugd_UploadCoordinator_Handler,
|
||||
StreamName: "UploadBootstrapper",
|
||||
Handler: _Debugd_UploadBootstrapper_Handler,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "DownloadCoordinator",
|
||||
Handler: _Debugd_DownloadCoordinator_Handler,
|
||||
StreamName: "DownloadBootstrapper",
|
||||
Handler: _Debugd_DownloadBootstrapper_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue