provisionerd

package
v2.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateProvisioner

func AuthenticateProvisioner(conn io.ReadWriter, token, jobID string) error

AuthenticateProvisioner performs the provisioner's side of the authentication protocol.

func DialTLS

func DialTLS(ctx context.Context, cert, addr string) (*tls.Conn, error)

DialTLS establishes a TLS connection to the given addr using the given cert as the root CA

func EphemeralEcho

func EphemeralEcho(
	ctx context.Context,
	logger slog.Logger,
	cacheDir, jobID, token, daemonCert, daemonAddress string,
) error

EphemeralEcho starts an Echo provisioner that connects to provisioner daemon, handles one job, then exits.

func GenCert

func GenCert() (*ecdsa.PrivateKey, []byte, error)

GenCert is a helper function that generates a private key and certificate. It is exported so that we can test a certificate generated in exactly the same way, but with a different private key.

func NewRemoteConnector

func NewRemoteConnector(ctx context.Context, logger slog.Logger, exec Executor) (agpl.Connector, error)

Types

type Executor

type Executor interface {
	// Execute a provisioner that connects back to the remoteConnector.  errCh
	// allows signaling of errors asynchronously and is closed on completion
	// with no error.
	Execute(
		ctx context.Context,
		provisionerType database.ProvisionerType,
		jobID, token, daemonCert, daemonAddress string) (errCh <-chan error)
}

Executor is responsible for executing the remote provisioners.

TODO: this interface is where we will run Kubernetes Jobs in a future version; right now, only the unit tests implement this interface.

Jump to

Keyboard shortcuts

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