csitranslation

package module
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 55

README

Purpose

This repository contains functions to be consumed by various Kubernetes and out-of-tree CSI components like external provisioner to facilitate migration of code from Kubernetes In-tree plugin code to CSI plugin repositories.

Consumers of this repository can make use of functions like TranslateToCSI and TranslateToInTree functions to translate PV sources.

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this repository at:

Code of Conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

Contibution Guidelines

See CONTRIBUTING.md for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSITranslator added in v0.17.0

type CSITranslator struct{}

CSITranslator translates in-tree storage API objects to their equivalent CSI API objects. It also provides many helper functions to determine whether translation logic exists and the mappings between "in-tree plugin <-> csi driver"

func New added in v0.17.0

func New() CSITranslator

New creates a new CSITranslator which does real translation for "in-tree plugins <-> csi drivers"

func (CSITranslator) GetCSINameFromInTreeName added in v0.17.0

func (CSITranslator) GetCSINameFromInTreeName(pluginName string) (string, error)

GetCSINameFromInTreeName returns the name of a CSI driver that supersedes the in-tree plugin with the given name

func (CSITranslator) GetInTreeNameFromCSIName added in v0.17.0

func (CSITranslator) GetInTreeNameFromCSIName(pluginName string) (string, error)

GetInTreeNameFromCSIName returns the name of the in-tree plugin superseded by a CSI driver with the given name

func (CSITranslator) GetInTreePluginNameFromSpec added in v0.17.0

func (CSITranslator) GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (string, error)

GetInTreePluginNameFromSpec returns the plugin name

func (CSITranslator) IsInlineMigratable added in v0.17.0

func (CSITranslator) IsInlineMigratable(vol *v1.Volume) bool

IsInlineMigratable tests whether there is Migration logic for the given Inline Volume

func (CSITranslator) IsMigratableIntreePluginByName added in v0.17.0

func (CSITranslator) IsMigratableIntreePluginByName(inTreePluginName string) bool

IsMigratableIntreePluginByName tests whether there is migration logic for the in-tree plugin whose name matches the given name

func (CSITranslator) IsMigratedCSIDriverByName added in v0.17.0

func (CSITranslator) IsMigratedCSIDriverByName(csiPluginName string) bool

IsMigratedCSIDriverByName tests whether there exists an in-tree plugin with logic to migrate to the CSI driver with given name

func (CSITranslator) IsPVMigratable added in v0.17.0

func (CSITranslator) IsPVMigratable(pv *v1.PersistentVolume) bool

IsPVMigratable tests whether there is migration logic for the given Persistent Volume

func (CSITranslator) RepairVolumeHandle added in v0.17.0

func (CSITranslator) RepairVolumeHandle(driverName, volumeHandle, nodeID string) (string, error)

RepairVolumeHandle generates a correct volume handle based on node ID information.

func (CSITranslator) TranslateCSIPVToInTree added in v0.17.0

func (CSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)

TranslateCSIPVToInTree takes a PV with a CSI PersistentVolume Source and will translate it to a in-tree Persistent Volume Source for the specific in-tree volume specified by the `Driver` field in the CSI Source. The input PV object will not be modified.

func (CSITranslator) TranslateInTreeInlineVolumeToCSI added in v0.17.0

func (CSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error)

TranslateInTreeInlineVolumeToCSI takes a inline volume and will translate the in-tree volume source to a CSIPersistentVolumeSource (wrapped in a PV) if the translation logic has been implemented.

func (CSITranslator) TranslateInTreePVToCSI added in v0.17.0

func (CSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)

TranslateInTreePVToCSI takes a persistent volume and will translate the in-tree source to a CSI Source if the translation logic has been implemented. The input persistent volume will not be modified

func (CSITranslator) TranslateInTreeStorageClassToCSI added in v0.17.0

func (CSITranslator) TranslateInTreeStorageClassToCSI(inTreePluginName string, sc *storage.StorageClass) (*storage.StorageClass, error)

TranslateInTreeStorageClassToCSI takes in-tree Storage Class and translates it to a set of parameters consumable by CSI plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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