Documentation ¶
Index ¶
- Constants
- Variables
- func CreateConfDirectory(confDir string) error
- func GetDriverScope() (scope string)
- func GetOrCreatePluginConfigDirectory() (string, error)
- func GetOrCreatePluginMountDirectory() (string, error)
- func GetUpdatedOptsFromConfig(reqOpts map[string]interface{}) (updatedOpts map[string]interface{}, err error)
- func InitializeDeleteConflictDelay()
- func InitializeMountConflictDelay()
- func IsLocalScopeDriver() bool
- func IsManagedPlugin() bool
- func LoadHPEVolConfig() (err error)
- func PreparePluginSocket() (listener net.Listener, err error)
- func UpdateVolumeDriverConfigCache(volumeDriverConfigFile string)
- type ConfigCache
- type PluginType
- type Section
Constants ¶
const ( // DriverConfigFile represents volume driver config file DriverConfigFile = "volume-driver.json" // EnvManagedPlugin represents if running as docker managed plugin EnvManagedPlugin = "MANAGED_PLUGIN" // EnvPluginType represents underlying storage platform type which plugin is servicing EnvPluginType = "PLUGIN_TYPE" // EnvScope represents plugin scope, i.e global or local EnvScope = "SCOPE" // DeleteConflictDelayKey represents key name for wait on conflicts during remove DeleteConflictDelayKey = "deleteConflictDelay" // DefaultDeleteConflictDelay represents delay to wait on conflicts during remove DefaultDeleteConflictDelay = 150 // MountConflictDelayKey represents the key name for wait on conflicts for mount MountConflictDelayKey = "mountConflictDelay" // DefaultMountConflictDelay represents the default delay to wait on conflicts during mount DefaultMountConflictDelay = 120 )
const ( // Global section type Global = iota + 1 // Defaults section type Defaults // Overrides section type Overrides )
const ( // PluginBaseDir represents base directory for plugin install PluginBaseDir = "/opt/hpe-storage/" // PluginSocketPath represents flexvolume plugin sockets directory PluginSocketPath = "/etc/hpe-storage/" // ManagedPluginSocketPath represents plugin socket path for docker managed plugins ManagedPluginSocketPath = "/run/docker/plugins/" // PluginSpecPath represents docker plugin spec directory PluginSpecPath = "/etc/docker/plugins/" // ConfigBaseDir represents user facing config directory for plugin ConfigBaseDir = "/etc/hpe-storage/" // MountBaseDir represents base directory for plugin volume mounts MountBaseDir = "/var/lib/kubelet/plugins/hpe.com/mounts/" // PluginLogFile represents plugin log location PluginLogFile = "/var/log/hpe-docker-plugin.log" // ManagedPluginSocketName represents plugin socket name for managed plugins ManagedPluginSocketName = "hpe-plugin.sock" )
Variables ¶
var ( // VolumeDriverConfig represent cache of volume-driver.json loaded VolumeDriverConfig *ConfigCache // Version of Plugin Version = "dev" // DeleteConflictDelay represent conflict delay to wait during remove DeleteConflictDelay = DefaultDeleteConflictDelay // MountConflictDelay represent conflict delay to wait during mount MountConflictDelay = DefaultMountConflictDelay )
var ( // PluginConfigDir represents config directory for plugin PluginConfigDir = "" // MountDir represents volume mount directory for the plugin MountDir = "" // SupportedFileSystems represent filesystem types supported for formatting with our plugin SupportedFileSystems = []string{"xfs", "btrfs", "ext2", "ext3", "ext4"} )
Functions ¶
func GetDriverScope ¶
func GetDriverScope() (scope string)
GetDriverScope returns plugin scope configured
func GetOrCreatePluginConfigDirectory ¶
GetOrCreatePluginConfigDirectory get or create plugin config directory
func GetOrCreatePluginMountDirectory ¶
GetOrCreatePluginConfigDirectory get or create plugin mount directory TODO: handle mountDir from volume-driver.json
func GetUpdatedOptsFromConfig ¶
func GetUpdatedOptsFromConfig(reqOpts map[string]interface{}) (updatedOpts map[string]interface{}, err error)
GetUpdatedOptsFromConfig returns updated options after combining options from config files
func InitializeDeleteConflictDelay ¶
func InitializeDeleteConflictDelay()
InitializeDeleteConflictDelay initializes deleteConflictDelay nolint : dupl
func InitializeMountConflictDelay ¶
func InitializeMountConflictDelay()
InitializeMountConflictDelay initializes mountConflictDelay nolint : dupl
func IsLocalScopeDriver ¶
func IsLocalScopeDriver() bool
IsLocalScopeDriver return true if its a local scoped driver, false otherwise
func IsManagedPlugin ¶
func IsManagedPlugin() bool
IsManagedPlugin returns true if the plugin is deployed as docker managed plugin
func LoadHPEVolConfig ¶
func LoadHPEVolConfig() (err error)
LoadHPEVolConfig loads the container config json file
func PreparePluginSocket ¶
PreparePluginSocket will setup socket path and listener
func UpdateVolumeDriverConfigCache ¶
func UpdateVolumeDriverConfigCache(volumeDriverConfigFile string)
UpdateVolumeDriverConfigCache updates the volume driver config cache
Types ¶
type ConfigCache ¶
type ConfigCache struct {
// contains filtered or unexported fields
}
ConfigCache to store config options
func (*ConfigCache) GetCache ¶
func (c *ConfigCache) GetCache() *jconfig.Config
GetCache returns volume-driver.json config
type PluginType ¶
type PluginType int
PluginType indicates the docker volume plugin type
const ( // nimble on-prem plugin type Nimble PluginType = 1 + iota // hpe cloud volumes plugin type Cv // simplivity plugin type Simplivity )
func GetPluginType ¶
func GetPluginType() (plugin PluginType)
func (PluginType) String ¶
func (plugin PluginType) String() string