recoveryserver

package
v2.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package recoveryserver implements the gRPC endpoints for recovering a restarting node.

The endpoint is only available for control-plane nodes, worker nodes should only rejoin the cluster using Constellation's JoinService.

This endpoint can be used by an admin in case of a complete cluster shutdown, in which case a node is unable to rejoin the cluster automatically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecoveryServer

type RecoveryServer struct {
	recoverproto.UnimplementedAPIServer
	// contains filtered or unexported fields
}

RecoveryServer is a gRPC server that can be used by an admin to recover a restarting node.

func New

func New(issuer atls.Issuer, factory kmsFactory, log *logger.Logger) *RecoveryServer

New returns a new RecoveryServer.

func (*RecoveryServer) Recover

Recover is a bidirectional streaming RPC that is used to send recovery keys to a restarting node.

func (*RecoveryServer) Serve

func (s *RecoveryServer) Serve(ctx context.Context, listener net.Listener, diskUUID string) (diskKey, measurementSecret []byte, err error)

Serve starts the recovery server. It blocks until a recover request call is successful. The server will shut down when the call is successful and the keys are returned. Additionally, the server can be shutdown by canceling the context.

type StubServer

type StubServer struct {
	// contains filtered or unexported fields
}

StubServer implements the RecoveryServer interface but does not actually start a server.

func NewStub

func NewStub(log *logger.Logger) *StubServer

NewStub returns a new stubbed RecoveryServer. We use this to avoid having to start a server for worker nodes, since they don't require manual recovery.

func (*StubServer) Serve

func (s *StubServer) Serve(ctx context.Context, _ net.Listener, _ string) ([]byte, []byte, error)

Serve waits until the context is canceled and returns nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL