secretsstore

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FilePermission is the permission to be used for the staging target path
	FilePermission os.FileMode = 0644

	// CSIPodName is the name of the pod that the mount is created for
	CSIPodName = "csi.storage.k8s.io/pod.name"
	// CSIPodNamespace is the namespace of the pod that the mount is created for
	CSIPodNamespace = "csi.storage.k8s.io/pod.namespace"
	// CSIPodUID is the UID of the pod that the mount is created for
	CSIPodUID = "csi.storage.k8s.io/pod.uid"
	// CSIPodServiceAccountName is the name of the pod service account that the mount is created for
	CSIPodServiceAccountName = "csi.storage.k8s.io/serviceAccount.name"
	// CSIPodServiceAccountTokens is the service account tokens of the pod that the mount is created for
	CSIPodServiceAccountTokens = "csi.storage.k8s.io/serviceAccount.tokens" //nolint

)
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

This section is empty.

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(paths []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 canceled 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 string,
	providerClients *PluginClientBuilder,
	client client.Client,
	reader client.Reader,
	tokenClient *k8s.TokenClient) *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(ctx context.Context, provider string)
	ReportNodeUnPublishCtMetric(ctx context.Context)
	ReportNodePublishErrorCtMetric(ctx context.Context, provider, errType string)
	ReportNodeUnPublishErrorCtMetric(ctx context.Context)
	ReportSyncK8SecretCtMetric(ctx context.Context, provider string, count int)
	ReportSyncK8SecretDuration(ctx context.Context, duration float64)
}

func NewStatsReporter added in v0.0.15

func NewStatsReporter() (StatsReporter, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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