driver

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Copyright 2019 The Kubernetes 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 2019 The Kubernetes 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 (
	AccessPointMode       = "efs-ap"
	AzName                = "az"
	BasePath              = "basePath"
	DefaultGidMin         = int64(50000)
	DefaultGidMax         = DefaultGidMin + cloud.AccessPointPerFsLimit
	DefaultTagKey         = "efs.csi.aws.com/cluster"
	DefaultTagValue       = "true"
	DirectoryPerms        = "directoryPerms"
	EnsureUniqueDirectory = "ensureUniqueDirectory"
	FsId                  = "fileSystemId"
	Gid                   = "gid"
	GidMin                = "gidRangeStart"
	GidMax                = "gidRangeEnd"
	MountTargetIp         = "mounttargetip"
	ProvisioningMode      = "provisioningMode"
	PvName                = "csi.storage.k8s.io/pv/name"
	PvcName               = "csi.storage.k8s.io/pvc/name"
	PvcNamespace          = "csi.storage.k8s.io/pvc/namespace"
	RoleArn               = "awsRoleArn"
	SubPathPattern        = "subPathPattern"
	TempMountPathPrefix   = "/var/lib/csi/pv"
	Uid                   = "uid"
	ReuseAccessPointKey   = "reuseAccessPoint"
	PvcNameKey            = "csi.storage.k8s.io/pvc/name"
)
View Source
const (

	// AgentNotReadyTaintKey contains the key of taints to be removed on driver startup
	AgentNotReadyNodeTaintKey = "efs.csi.aws.com/agent-not-ready"
)

Variables

This section is empty.

Functions

func GetVersionJSON added in v0.2.0

func GetVersionJSON() (string, error)

func InitConfigDir added in v1.1.0

func InitConfigDir(legacyDir, preferredDir, etcAmazonEfs string) error

InitConfigDir decides which of two mounted directories will be used to store driver config files. It creates a symlink at etcAmazonEfs to the chosen location (legacyDir or preferredDir). If neither of these locations is present (i.e. when the user does not need to durably store configs and thus does not mount host directories), an empty directory will be created at etcAmazonEfs.

  • legacyDir is the path to a config directory where previous versions of this driver may have written config files. In previous versions of this driver, a host path that was not writeable on Bottlerocket hosts was being used, so we introduce preferredDir.

- preferredDir is the path to config directory that we will use so long as we do not find files in legacyDir.

  • etcAmazonEfs is the path where the symlink will be written. In practice, this will always be /etc/amazon/efs, but we take it as an input so the function can be tested.

Examples: On a host that has EFS mounts created by an earlier version of this driver, InitConfigDir will detect a conf file in legacyDir and write a symlink at etcAmazonEfs pointing to legacyDir.

On a host that does not have pre-existing legacy EFS mount configs, InitConfigDir will detect no files in legacyDir and will create a symlink at etcAmazonEfs pointing to preferredDir.

For a use case in which durable storage of the configs is not required, and no host volumes are mounted, the function creates an empty directory at etcAmazonEfs.

If a symlink already existing at etcAmazonEfs, InitConfigDir does nothing. If something other than a symlink exists at etcAmazonEfs, InitConfigDir returns an error.

func SetNodeCapOptInFeatures added in v1.1.0

func SetNodeCapOptInFeatures(volMetricsOptIn bool) []csi.NodeServiceCapability_RPC_Type

Types

type Driver

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

func NewDriver

func NewDriver(endpoint, efsUtilsCfgPath, efsUtilsStaticFilesPath, tags string, volMetricsOptIn bool, volMetricsRefreshPeriod float64, volMetricsFsRateLimit int, deleteAccessPointRootDir bool) *Driver

func (*Driver) ControllerExpandVolume added in v1.2.0

func (*Driver) ControllerGetCapabilities added in v1.2.0

func (*Driver) ControllerGetVolume added in v1.3.8

func (*Driver) ControllerPublishVolume added in v1.2.0

func (*Driver) ControllerUnpublishVolume added in v1.2.0

func (*Driver) CreateSnapshot added in v1.2.0

func (*Driver) CreateVolume added in v1.2.0

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

func (*Driver) DeleteSnapshot added in v1.2.0

func (*Driver) DeleteVolume added in v1.2.0

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

func (*Driver) GetCapacity added in v1.2.0

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

func (*Driver) GetPluginInfo

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

func (*Driver) ListSnapshots added in v1.2.0

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

func (*Driver) ListVolumes added in v1.2.0

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

func (*Driver) NodeExpandVolume added in v0.2.0

func (*Driver) NodeGetCapabilities

func (*Driver) NodeGetInfo

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

func (*Driver) NodeGetVolumeStats added in v0.2.0

func (*Driver) NodePublishVolume

func (*Driver) NodeStageVolume

func (*Driver) NodeUnpublishVolume

func (*Driver) NodeUnstageVolume

func (*Driver) Probe

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

func (*Driver) Run

func (d *Driver) Run() error

func (*Driver) ValidateVolumeCapabilities added in v1.2.0

type FilesystemID added in v1.7.0

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

type GidAllocator added in v1.2.0

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

func NewGidAllocator added in v1.2.0

func NewGidAllocator() GidAllocator

type JSONPatch added in v1.7.2

type JSONPatch struct {
	OP    string      `json:"op,omitempty"`
	Path  string      `json:"path,omitempty"`
	Value interface{} `json:"value"`
}

Struct for JSON patch operations

type Mounter added in v0.3.0

type Mounter interface {
	mount_utils.Interface
	MakeDir(pathname string) error
	GetDeviceName(mountPath string) (string, int, error)
}

Mounter is an interface for mount operations

type NodeMounter added in v0.3.0

type NodeMounter struct {
	mount_utils.Interface
}

func (*NodeMounter) GetDeviceName added in v0.3.0

func (m *NodeMounter) GetDeviceName(mountPath string) (string, int, error)

func (*NodeMounter) MakeDir added in v0.3.0

func (m *NodeMounter) MakeDir(pathname string) error

type VersionInfo added in v0.2.0

type VersionInfo struct {
	DriverVersion   string `json:"driverVersion"`
	GitCommit       string `json:"gitCommit"`
	BuildDate       string `json:"buildDate"`
	EfsClientSource string `json:"efsClientSource"`
	GoVersion       string `json:"goVersion"`
	Compiler        string `json:"compiler"`
	Platform        string `json:"platform"`
}

func GetVersion added in v0.2.0

func GetVersion() VersionInfo

type VolStatter added in v1.1.0

type VolStatter interface {
	// contains filtered or unexported methods
}

func NewVolStatter added in v1.1.0

func NewVolStatter() VolStatter

type VolStatterImpl added in v1.1.0

type VolStatterImpl struct {
}

type Watchdog added in v0.3.0

type Watchdog interface {
	// contains filtered or unexported methods
}

Watchdog defines the interface for process monitoring and supervising

Directories

Path Synopsis
Package mock_cloud is a generated GoMock package.
Package mock_cloud is a generated GoMock package.

Jump to

Keyboard shortcuts

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