workload

package
v0.0.0-...-0000b31 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretFile propages the key/cert to the workload through file.
	SecretFile int = iota // 0
	// WorkloadAPI propages the key/cert to the workload through API.
	WorkloadAPI // 1, unimplemented.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Mode specifies how the node agent communications to workload.
	Mode int

	// FileUtil is valid in FILE mode. It supports file I/O in a FS.
	FileUtil util.FileUtil

	// ServiceIdentityCertFile is valid in FILE mode. It specifies the file path for service identity certificate.
	ServiceIdentityCertFile string

	// ServiceIdentityPrivateKeyFile is valid in FILE mode. It specifies the file path for service identity private key.
	ServiceIdentityPrivateKeyFile string
}

Config is the configuration for node agent to workload communication.

func NewSecretFileServerConfig

func NewSecretFileServerConfig(certFile string, keyFile string) Config

NewSecretFileServerConfig creates a Config for propogating key/cert to workload through file.

type SecretFileServer

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

SecretFileServer is an implementation of SecretServer that writes the key/cert into file system.

func (*SecretFileServer) SetServiceIdentityCert

func (sf *SecretFileServer) SetServiceIdentityCert(content []byte) error

SetServiceIdentityCert sets the service identity certificate into the file system.

func (*SecretFileServer) SetServiceIdentityPrivateKey

func (sf *SecretFileServer) SetServiceIdentityPrivateKey(content []byte) error

SetServiceIdentityPrivateKey sets the service identity private key into the file system.

type SecretServer

type SecretServer interface {
	// SetServiceIdentityPrivateKey sets the service identity private key to the channel accessible to the workload.
	SetServiceIdentityPrivateKey([]byte) error
	// SetServiceIdentityCert sets the service identity cert to the channel accessible to the workload.
	SetServiceIdentityCert([]byte) error
}

SecretServer is for implementing the communication from the node agent to the workload.

func NewSecretServer

func NewSecretServer(cfg Config) (SecretServer, error)

NewSecretServer instantiates a SecretServer according to the configuration.

Jump to

Keyboard shortcuts

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