fix add code style
This commit is contained in:
parent
e1a5e8537a
commit
bf9c829e34
@ -43,13 +43,13 @@ type awsElasticBlockStoreAttacher struct {
|
|||||||
awsVolumes aws.Volumes
|
awsVolumes aws.Volumes
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Attacher = &awsElasticBlockStoreAttacher{}
|
var _ volume.Attacher = (*awsElasticBlockStoreAttacher)(nil)
|
||||||
|
|
||||||
var _ volume.DeviceMounter = &awsElasticBlockStoreAttacher{}
|
var _ volume.DeviceMounter = (*awsElasticBlockStoreAttacher)(nil)
|
||||||
|
|
||||||
var _ volume.AttachableVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.AttachableVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
|
|
||||||
var _ volume.DeviceMountableVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.DeviceMountableVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
|
|
||||||
func (plugin *awsElasticBlockStorePlugin) NewAttacher() (volume.Attacher, error) {
|
func (plugin *awsElasticBlockStorePlugin) NewAttacher() (volume.Attacher, error) {
|
||||||
awsCloud, err := getCloudProvider(plugin.host.GetCloudProvider())
|
awsCloud, err := getCloudProvider(plugin.host.GetCloudProvider())
|
||||||
@ -234,7 +234,7 @@ func (attacher *awsElasticBlockStoreAttacher) MountDevice(spec *volume.Spec, dev
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
options := []string{}
|
var options []string
|
||||||
if readOnly {
|
if readOnly {
|
||||||
options = append(options, "ro")
|
options = append(options, "ro")
|
||||||
}
|
}
|
||||||
@ -255,9 +255,9 @@ type awsElasticBlockStoreDetacher struct {
|
|||||||
awsVolumes aws.Volumes
|
awsVolumes aws.Volumes
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Detacher = &awsElasticBlockStoreDetacher{}
|
var _ volume.Detacher = (*awsElasticBlockStoreDetacher)(nil)
|
||||||
|
|
||||||
var _ volume.DeviceUnmounter = &awsElasticBlockStoreDetacher{}
|
var _ volume.DeviceUnmounter = (*awsElasticBlockStoreDetacher)(nil)
|
||||||
|
|
||||||
func (plugin *awsElasticBlockStorePlugin) NewDetacher() (volume.Detacher, error) {
|
func (plugin *awsElasticBlockStorePlugin) NewDetacher() (volume.Detacher, error) {
|
||||||
awsCloud, err := getCloudProvider(plugin.host.GetCloudProvider())
|
awsCloud, err := getCloudProvider(plugin.host.GetCloudProvider())
|
||||||
|
@ -51,10 +51,10 @@ type awsElasticBlockStorePlugin struct {
|
|||||||
host volume.VolumeHost
|
host volume.VolumeHost
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.VolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.VolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
var _ volume.PersistentVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.PersistentVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
var _ volume.DeletableVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.DeletableVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
var _ volume.ProvisionableVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.ProvisionableVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
awsElasticBlockStorePluginName = "kubernetes.io/aws-ebs"
|
awsElasticBlockStorePluginName = "kubernetes.io/aws-ebs"
|
||||||
@ -311,9 +311,9 @@ func (plugin *awsElasticBlockStorePlugin) NodeExpand(resizeOptions volume.NodeRe
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.NodeExpandableVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.NodeExpandableVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
var _ volume.ExpandableVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.ExpandableVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
var _ volume.VolumePluginWithAttachLimits = &awsElasticBlockStorePlugin{}
|
var _ volume.VolumePluginWithAttachLimits = (*awsElasticBlockStorePlugin)(nil)
|
||||||
|
|
||||||
// Abstract interface to PD operations.
|
// Abstract interface to PD operations.
|
||||||
type ebsManager interface {
|
type ebsManager interface {
|
||||||
@ -350,7 +350,7 @@ type awsElasticBlockStoreMounter struct {
|
|||||||
mountOptions []string
|
mountOptions []string
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Mounter = &awsElasticBlockStoreMounter{}
|
var _ volume.Mounter = (*awsElasticBlockStoreMounter)(nil)
|
||||||
|
|
||||||
func (b *awsElasticBlockStoreMounter) GetAttributes() volume.Attributes {
|
func (b *awsElasticBlockStoreMounter) GetAttributes() volume.Attributes {
|
||||||
return volume.Attributes{
|
return volume.Attributes{
|
||||||
@ -448,7 +448,7 @@ type awsElasticBlockStoreUnmounter struct {
|
|||||||
*awsElasticBlockStore
|
*awsElasticBlockStore
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Unmounter = &awsElasticBlockStoreUnmounter{}
|
var _ volume.Unmounter = (*awsElasticBlockStoreUnmounter)(nil)
|
||||||
|
|
||||||
// Unmounts the bind mount, and detaches the disk only if the PD
|
// Unmounts the bind mount, and detaches the disk only if the PD
|
||||||
// resource was the last reference to that disk on the kubelet.
|
// resource was the last reference to that disk on the kubelet.
|
||||||
@ -465,7 +465,7 @@ type awsElasticBlockStoreDeleter struct {
|
|||||||
*awsElasticBlockStore
|
*awsElasticBlockStore
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Deleter = &awsElasticBlockStoreDeleter{}
|
var _ volume.Deleter = (*awsElasticBlockStoreDeleter)(nil)
|
||||||
|
|
||||||
func (d *awsElasticBlockStoreDeleter) GetPath() string {
|
func (d *awsElasticBlockStoreDeleter) GetPath() string {
|
||||||
return getPath(d.podUID, d.volName, d.plugin.host)
|
return getPath(d.podUID, d.volName, d.plugin.host)
|
||||||
@ -480,7 +480,7 @@ type awsElasticBlockStoreProvisioner struct {
|
|||||||
options volume.VolumeOptions
|
options volume.VolumeOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Provisioner = &awsElasticBlockStoreProvisioner{}
|
var _ volume.Provisioner = (*awsElasticBlockStoreProvisioner)(nil)
|
||||||
|
|
||||||
func (c *awsElasticBlockStoreProvisioner) Provision(selectedNode *v1.Node, allowedTopologies []v1.TopologySelectorTerm) (*v1.PersistentVolume, error) {
|
func (c *awsElasticBlockStoreProvisioner) Provision(selectedNode *v1.Node, allowedTopologies []v1.TopologySelectorTerm) (*v1.PersistentVolume, error) {
|
||||||
if !util.ContainsAllAccessModes(c.plugin.GetAccessModes(), c.options.PVC.Spec.AccessModes) {
|
if !util.ContainsAllAccessModes(c.plugin.GetAccessModes(), c.options.PVC.Spec.AccessModes) {
|
||||||
|
@ -37,7 +37,7 @@ import (
|
|||||||
"k8s.io/legacy-cloud-providers/aws"
|
"k8s.io/legacy-cloud-providers/aws"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ volume.BlockVolumePlugin = &awsElasticBlockStorePlugin{}
|
var _ volume.BlockVolumePlugin = (*awsElasticBlockStorePlugin)(nil)
|
||||||
|
|
||||||
func (plugin *awsElasticBlockStorePlugin) ConstructBlockVolumeSpec(podUID types.UID, volumeName, mapPath string) (*volume.Spec, error) {
|
func (plugin *awsElasticBlockStorePlugin) ConstructBlockVolumeSpec(podUID types.UID, volumeName, mapPath string) (*volume.Spec, error) {
|
||||||
pluginDir := plugin.host.GetVolumeDevicePluginDir(awsElasticBlockStorePluginName)
|
pluginDir := plugin.host.GetVolumeDevicePluginDir(awsElasticBlockStorePluginName)
|
||||||
@ -145,14 +145,14 @@ type awsElasticBlockStoreUnmapper struct {
|
|||||||
*awsElasticBlockStore
|
*awsElasticBlockStore
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.BlockVolumeUnmapper = &awsElasticBlockStoreUnmapper{}
|
var _ volume.BlockVolumeUnmapper = (*awsElasticBlockStoreUnmapper)(nil)
|
||||||
|
|
||||||
type awsElasticBlockStoreMapper struct {
|
type awsElasticBlockStoreMapper struct {
|
||||||
*awsElasticBlockStore
|
*awsElasticBlockStore
|
||||||
readOnly bool
|
readOnly bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.BlockVolumeMapper = &awsElasticBlockStoreMapper{}
|
var _ volume.BlockVolumeMapper = (*awsElasticBlockStoreMapper)(nil)
|
||||||
|
|
||||||
// GetGlobalMapPath returns global map path and error
|
// GetGlobalMapPath returns global map path and error
|
||||||
// path: plugins/kubernetes.io/{PluginName}/volumeDevices/volumeID
|
// path: plugins/kubernetes.io/{PluginName}/volumeDevices/volumeID
|
||||||
|
@ -218,7 +218,7 @@ func verifyDevicePath(devicePaths []string) (string, error) {
|
|||||||
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
|
// This is more interesting on GCE (where we are able to identify volumes under /dev/disk-by-id)
|
||||||
// Here it is mostly about applying the partition path
|
// Here it is mostly about applying the partition path
|
||||||
func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, devicePath string) []string {
|
func getDiskByIDPaths(volumeID aws.KubernetesVolumeID, partition string, devicePath string) []string {
|
||||||
devicePaths := []string{}
|
var devicePaths []string
|
||||||
if devicePath != "" {
|
if devicePath != "" {
|
||||||
devicePaths = append(devicePaths, devicePath)
|
devicePaths = append(devicePaths, devicePath)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user