secretsstore

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceConfig = `` /* 292-byte string literal not displayed */

ServiceConfig is used when building CSIDriverProvider clients. The configured retry parameters ensures that RPCs will be retried if the underlying connection is not ready.

For more details see: https://github.com/grpc/grpc/blob/master/doc/service_config.md

Variables

View Source
var (
	// PluginNameRe is the regular expression used to validate plugin names.
	PluginNameRe        = regexp.MustCompile(`^[a-zA-Z0-9_-]{0,30}$`)
	ErrInvalidProvider  = errors.New("invalid provider")
	ErrProviderNotFound = errors.New("provider not found")
)

Functions

func MountContent added in v0.0.21

func MountContent(ctx context.Context, client v1alpha1.CSIDriverProviderClient, attributes, secrets, targetPath, permission string, oldObjectVersions map[string]string) (map[string]string, string, error)

MountContent calls the client's Mount() RPC with helpers to format the request and interpret the response.

func Version added in v0.0.22

Version calls the client's Version() RPC returns provider runtime version and error.

Types

type NonBlockingGRPCServer added in v0.3.0

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(ctx context.Context, endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer)
	// Waits for the service to stop
	Wait()
	// Stops the service gracefully
	Stop()
	// Stops the service forcefully
	ForceStop()
}

Defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer added in v0.3.0

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

NewNonBlockingGRPCServer returns a new non blocking grpc server

type PluginClientBuilder added in v0.0.21

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

PluginClientBuilder builds and stores grpc clients for communicating with provider plugins.

func NewPluginClientBuilder added in v0.0.21

func NewPluginClientBuilder(path string, opts ...grpc.DialOption) *PluginClientBuilder

NewPluginClientBuilder creates a PluginClientBuilder that will connect to plugins in the provided absolute path to a folder. Plugin servers must listen to the unix domain socket at:

<path>/<plugin_name>.sock

where <plugin_name> must match the PluginNameRe regular expression.

Additional grpc dial options can also be set through opts and will be used when creating all clients.

func (*PluginClientBuilder) Cleanup added in v0.0.21

func (p *PluginClientBuilder) Cleanup()

Cleanup closes all underlying connections and removes all clients.

func (*PluginClientBuilder) Get added in v0.0.21

Get returns a CSIDriverProviderClient for the provider. If an existing client is not found a new one will be created and added to the PluginClientBuilder.

func (*PluginClientBuilder) HealthCheck added in v0.0.22

func (p *PluginClientBuilder) HealthCheck(ctx context.Context, interval time.Duration)

HealthCheck enables periodic healthcheck for configured provider clients by making a Version() RPC call. If the provider healthcheck fails, we log an error.

This method blocks until the parent context is cancelled during termination.

type SecretsStore

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

SecretsStore implements the IdentityServer, ControllerServer and NodeServer CSI interfaces.

func NewSecretsStoreDriver added in v0.3.0

func NewSecretsStoreDriver(driverName, nodeID, endpoint, providerVolumePath string, providerClients *PluginClientBuilder, client client.Client, reader client.Reader) *SecretsStore

func (*SecretsStore) Run

func (s *SecretsStore) Run(ctx context.Context)

Run starts the CSI plugin

type StatsReporter added in v0.0.11

type StatsReporter interface {
	ReportNodePublishCtMetric(provider string)
	ReportNodeUnPublishCtMetric()
	ReportNodePublishErrorCtMetric(provider, errType string)
	ReportNodeUnPublishErrorCtMetric()
	ReportSyncK8SecretCtMetric(provider string, count int)
	ReportSyncK8SecretDuration(duration float64)
}

func NewStatsReporter added in v0.0.15

func NewStatsReporter() StatsReporter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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