driver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The KubeVault Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	KB = 1 << (10 * iota)
	MB
	GB
	TB
)
View Source
const (
	PublishInfoVolumeName = driverName + "/volume-name"

	RetryInterval = 5 * time.Second
	RetryTimeout  = 10 * time.Minute
)

Variables

View Source
var (
	InstanceNotFound = errors.New("instance not found")
	SecretEngineKey  = "engine"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientConfig *rest.Config
	KubeClient   kubernetes.Interface
	AppClient    appcat_cs.AppcatalogV1alpha1Interface
	CRDClient    crd_cs.ApiextensionsV1beta1Interface
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(clientConfig *rest.Config) *Config

func (*Config) EnsureCRDs

func (c *Config) EnsureCRDs() error

func (*Config) New

func (c *Config) New() (*Driver, error)

type Driver

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

Driver implements the following CSI interfaces:

csi.IdentityServer
csi.ControllerServer
csi.NodeServer

func (*Driver) ControllerGetCapabilities

ControllerGetCapabilities returns the capabilities of the controller service.

func (*Driver) ControllerPublishVolume

ControllerPublishVolume attaches the given volume to the node

func (*Driver) ControllerUnpublishVolume

ControllerUnpublishVolume deattaches the given volume from the node

func (*Driver) CreateSnapshot

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)

CreateVolume creates a new volume from the given request. The function is idempotent.

func (*Driver) DeleteSnapshot

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)

DeleteVolume deletes the given volume. The function is idempotent.

func (*Driver) GetCapacity

func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)

GetCapacity returns the capacity of the storage pool

func (*Driver) GetPluginCapabilities

GetPluginCapabilities returns available capabilities of the plugin

func (*Driver) GetPluginInfo

func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)

GetPluginInfo returns metadata of the plugin

func (*Driver) ListSnapshots

func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)

func (*Driver) ListVolumes

func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)

ListVolumes returns a list of all requested volumes

func (*Driver) NodeExpandVolume

func (*Driver) NodeGetCapabilities

NodeGetCapabilities returns the supported capabilities of the node server

func (*Driver) NodeGetInfo

func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

func (*Driver) NodeGetVolumeStats

func (*Driver) NodePublishVolume

NodePublishVolume mounts the volume mounted to the staging path to the target path

func (*Driver) NodeStageVolume

NodeStageVolume mounts the volume to a staging path on the node. This is called by the CO before NodePublishVolume and is used to temporary mount the volume to a staging path. Once mounted, NodePublishVolume will make sure to mount it to the appropriate path

func (*Driver) NodeUnpublishVolume

NodeUnpublishVolume unmounts the volume from the target path

func (*Driver) NodeUnstageVolume

NodeUnstageVolume unstages the volume from the staging path

func (*Driver) Probe

func (d *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)

Probe returns the health and readiness of the plugin

func (*Driver) Run

func (d *Driver) Run() error

Run starts the CSI plugin by communication over the given CSIAddress

func (*Driver) Stop

func (d *Driver) Stop()

Stop stops the plugin

func (*Driver) ValidateVolumeCapabilities

ValidateVolumeCapabilities checks whether the volume capabilities requested are supported.

type Mounter

type Mounter interface {
	// Format formats the source with the given filesystem type
	Format(source, fsType string) error

	//VaultMount(target, fsType string, options map[string]string ) error
	// Mount mounts source to target with the given fstype and options.
	Mount(source, target, fsType string, options ...string) error

	// Unmount unmounts the given target
	Unmount(target string) error
	VaultUnmount(target string) error

	// IsFormatted checks whether the source device is formatted or not. It
	// returns true if the source device is already formatted.
	IsFormatted(source string) (bool, error)

	// IsMounted checks whether the source device is mounted to the target
	// path. Source can be empty. In that case it only checks whether the
	// device is mounted or not.
	// It returns true if it's mounted.
	IsMounted(source, target string) (bool, error)
}

Mounter is responsible for formatting and mounting volumes

Jump to

Keyboard shortcuts

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