mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Refactor ConstructVolumeSpec
Return a struct from ConstructVolumeSpec to be able to add more fields to it later.
This commit is contained in:
@@ -166,7 +166,7 @@ type VolumePlugin interface {
|
||||
// and volumePath. The spec may have incomplete information due to limited
|
||||
// information from input. This function is used by volume manager to reconstruct
|
||||
// volume spec by reading the volume directories from disk
|
||||
ConstructVolumeSpec(volumeName, volumePath string) (*Spec, error)
|
||||
ConstructVolumeSpec(volumeName, volumePath string) (ReconstructedVolume, error)
|
||||
|
||||
// SupportsMountOption returns true if volume plugins supports Mount options
|
||||
// Specifying mount options in a volume plugin that doesn't support
|
||||
@@ -570,6 +570,12 @@ type VolumeConfig struct {
|
||||
ProvisioningEnabled bool
|
||||
}
|
||||
|
||||
// ReconstructedVolume contains information about a volume reconstructed by
|
||||
// ConstructVolumeSpec().
|
||||
type ReconstructedVolume struct {
|
||||
Spec *Spec
|
||||
}
|
||||
|
||||
// NewSpecFromVolume creates an Spec from an v1.Volume
|
||||
func NewSpecFromVolume(vs *v1.Volume) *Spec {
|
||||
return &Spec{
|
||||
|
||||
Reference in New Issue
Block a user