Documentation ¶
Index ¶
Constants ¶
View Source
const ( OptionFSType = "kubernetes.io/fsType" OptionReadWrite = "kubernetes.io/readwrite" OptionKeySecret = "kubernetes.io/secret" OptionFSGroup = "kubernetes.io/fsGroup" OptionMountsDir = "kubernetes.io/mountsDir" OptionKeyPodName = "kubernetes.io/pod.name" OptionKeyPodNamespace = "kubernetes.io/pod.namespace" OptionKeyPodUID = "kubernetes.io/pod.uid" OptionKeyServiceAccountName = "kubernetes.io/serviceAccount.name" )
Option keys
Variables ¶
This section is empty.
Functions ¶
func ExecDriver ¶
ExecDriver executes the appropriate FlexvolumeDriver command based on recieved call-out.
func ExitWithResult ¶
func ExitWithResult(result DriverStatus)
ExitWithResult outputs the given Result and exits with the appropriate exit code.
Types ¶
type Driver ¶
type Driver interface { Init() DriverStatus Attach(opts Options, nodeName string) DriverStatus Detach(mountDevice, nodeName string) DriverStatus WaitForAttach(mountDevice string, opts Options) DriverStatus IsAttached(opts Options, nodeName string) DriverStatus MountDevice(mountDir, mountDevice string, opts Options) DriverStatus UnmountDevice(mountDevice string) DriverStatus Mount(mountDir string, opts Options) DriverStatus Unmount(mountDir string) DriverStatus }
Driver is the main Flexvolume interface.
type DriverStatus ¶
type DriverStatus struct { // Status of the callout. One of "Success", "Failure" or "Not supported". Status Status `json:"status"` // Reason for success/failure. Message string `json:"message,omitempty"` // Path to the device attached. This field is valid only for attach calls. // e.g: /dev/sdx Device string `json:"device,omitempty"` // Represents volume is attached on the node. Attached bool `json:"attached,omitempty"` }
DriverStatus of a Flexvolume driver call.
func Fail ¶
func Fail(a ...interface{}) DriverStatus
Fail creates a StatusFailure Result with a given message.
func NotSupported ¶
func NotSupported(a ...interface{}) DriverStatus
NotSupported creates a StatusNotSupported Result with a given message.
func Succeed ¶
func Succeed(a ...interface{}) DriverStatus
Succeed creates a StatusSuccess Result with a given message.
type Options ¶
Options is the map (passed as JSON) to some Flexvolume calls.
func DecodeKubeSecrets ¶
DecodeKubeSecrets takes the options passed to the driver and decodes any secrets.
type Status ¶
type Status string
Status denotes the state of a Flexvolume call.
const ( // StatusSuccess indicates that the driver call has succeeded. StatusSuccess Status = "Success" // StatusFailure indicates that the driver call has failed. StatusFailure Status = "Failure" // StatusNotSupported indicates that the driver call is not supported. StatusNotSupported Status = "Not supported" )
Click to show internal directories.
Click to hide internal directories.