Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMigrationFeatureFlags ¶
func CheckMigrationFeatureFlags(f featuregate.FeatureGate, pluginMigration, pluginUnregister featuregate.Feature) (migrationComplete bool, err error)
CheckMigrationFeatureFlags checks the configuration of feature flags related to CSI Migration is valid. It will return whether the migration is complete by looking up the pluginUnregister flag
func TranslateInTreeSpecToCSI ¶
func TranslateInTreeSpecToCSI(spec *volume.Spec, podNamespace string, translator InTreeToCSITranslator) (*volume.Spec, error)
TranslateInTreeSpecToCSI translates a volume spec (either PV or inline volume) supported by an in-tree plugin to CSI
Types ¶
type InTreeToCSITranslator ¶
type InTreeToCSITranslator interface { TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) }
InTreeToCSITranslator performs translation of Volume sources for PV and Volume objects from references to in-tree plugins to migrated CSI plugins
type PluginManager ¶
type PluginManager struct { PluginNameMapper // contains filtered or unexported fields }
PluginManager keeps track of migrated state of in-tree plugins
func NewPluginManager ¶
func NewPluginManager(m PluginNameMapper, featureGate featuregate.FeatureGate) PluginManager
NewPluginManager returns a new PluginManager instance
func (PluginManager) IsMigratable ¶
func (pm PluginManager) IsMigratable(spec *volume.Spec) (bool, error)
IsMigratable indicates whether CSI migration has been enabled for a volume plugin that the spec refers to
func (PluginManager) IsMigrationCompleteForPlugin ¶
func (pm PluginManager) IsMigrationCompleteForPlugin(pluginName string) bool
IsMigrationCompleteForPlugin indicates whether CSI migration has been completed for a particular storage plugin. A complete migration will need to: 1. Enable CSIMigrationXX for the plugin 2. Unregister the in-tree plugin by setting the InTreePluginXXUnregister feature gate
func (PluginManager) IsMigrationEnabledForPlugin ¶
func (pm PluginManager) IsMigrationEnabledForPlugin(pluginName string) bool
IsMigrationEnabledForPlugin indicates whether CSI migration has been enabled for a particular storage plugin
type PluginNameMapper ¶
type PluginNameMapper interface { GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (string, error) GetCSINameFromInTreeName(pluginName string) (string, error) }
PluginNameMapper contains utility methods to retrieve names of plugins that support a spec, map intree <=> migrated CSI plugin names, etc