Skip to content

Commit

Permalink
Add explicit warning for deprecation of Cinder and ScaleIO volume pro…
Browse files Browse the repository at this point in the history
…viders

We have had a warning for OpenStack in-tree cloud provider, Here we are
adding more fine grained WARNING for OpenStack cinder volume provider in
addition to that.

Also identified ScaleIO as something that has not had activity or
updates for a while, So we should deprecate that as well
  • Loading branch information
dims committed Jul 12, 2019
1 parent aaad86c commit 7fa6fc7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/volume/plugins.go
Expand Up @@ -66,6 +66,13 @@ const (
CSIVolumePublished CSIVolumePhaseType = "published"
)

var (
deprecatedVolumeProviders = map[string]string{
"kubernetes.io/cinder": "The Cinder volume provider is deprecated and will be removed in a future release",
"kubernetes.io/scaleio": "The ScaleIO volume provider is deprecated and will be removed in a future release",
}
)

// VolumeOptions contains option information about a volume.
type VolumeOptions struct {
// The attributes below are required by volume.Provisioner
Expand Down Expand Up @@ -674,6 +681,11 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) {
}
return nil, fmt.Errorf("multiple volume plugins matched: %s", strings.Join(matchedPluginNames, ","))
}

// Issue warning if the matched provider is deprecated
if detail, ok := deprecatedVolumeProviders[matches[0].GetPluginName()]; ok {
klog.Warningf("WARNING: %s built-in volume provider is now deprecated. %s", matches[0].GetPluginName(), detail)
}
return matches[0], nil
}

Expand Down Expand Up @@ -737,6 +749,11 @@ func (pm *VolumePluginMgr) FindPluginByName(name string) (VolumePlugin, error) {
}
return nil, fmt.Errorf("multiple volume plugins matched: %s", strings.Join(matchedPluginNames, ","))
}

// Issue warning if the matched provider is deprecated
if detail, ok := deprecatedVolumeProviders[matches[0].GetPluginName()]; ok {
klog.Warningf("WARNING: %s built-in volume provider is now deprecated. %s", matches[0].GetPluginName(), detail)
}
return matches[0], nil
}

Expand Down

0 comments on commit 7fa6fc7

Please sign in to comment.