cloud

package
v0.0.0-...-599403d Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialFileEnv         = "CRED_FILE_PATH"
	CredentialDefaultLocation = "/etc/kubernetes/cloud.json"
	SecretDefaultLocation     = "/var/run/secrets/pharmer/flexvolmues"
	RetryInterval             = 5 * time.Second
	RetryTimeout              = 10 * time.Minute
)

Variables

View Source
var ErrIncorrectArgNumber = errors.New("Incorrect number of args")
View Source
var ErrNotSupported = errors.New("Not Supported")
View Source
var ExecCommand = exec.Command
View Source
var UnixStat = unix.Stat

Functions

func CloudManagers

func CloudManagers() []string

CloudManagers returns the name of all registered cloud providers in a string slice

func IsCloudManager

func IsCloudManager(name string) bool

IsCloudManager returns true if name corresponds to an already registered cloud provider.

func Mount

func Mount(targetDir string, device string, opt DefaultOptions) error

func RegisterCloudManager

func RegisterCloudManager(name string, cloud Factory)

RegisterCloudManager registers a cloud.Factory by name. This is expected to happen during app startup.

func Unmount

func Unmount(targetDir string) error

Types

type DefaultOptions

type DefaultOptions struct {
	ApiKey         string `json:"kubernetes.io/secret/apiKey"`
	FsType         string `json:"kubernetes.io/fsType"`
	PVorVolumeName string `json:"kubernetes.io/pvOrVolumeName"`
	RW             string `json:"kubernetes.io/readwrite"`
	VolumeName     string `json:"volumeName,omitempty"`
	VolumeID       string `json:"volumeId,omitempty"`
}

type Factory

type Factory func(ctx context.Context) (Interface, error)

Factory is a function that returns a cloud.ClusterManager. The config parameter provides an io.Reader handler to the factory in order to load specific configurations. If no configuration is provided the parameter is nil.

type Interface

type Interface interface {
	NewOptions() interface{}
	Initialize() error

	Init() error
	Attach(options interface{}, nodeName string) (device string, err error)
	Detach(device, nodeName string) error
	MountDevice(mountDir string, device string, options interface{}) error
	Mount(mountDir string, options interface{}) error
	Unmount(mountDir string) error
}

func GetCloudManager

func GetCloudManager(name string, ctx context.Context) (Interface, error)

GetCloudManager creates an instance of the named cloud provider, or nil if the name is not known. The error return is only used if the named provider was known but failed to initialize. The config parameter specifies the io.Reader handler of the configuration file for the cloud provider, or nil for no configuation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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