From 9c7c2dcd208981d38e4618204ba509191f6b17e7 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 31 Jan 2017 14:31:55 +0530 Subject: [PATCH] Renames provisioner config struct Signed-off-by: Humble Chirammal --- pkg/volume/glusterfs/glusterfs.go | 22 +++++++++++----------- pkg/volume/glusterfs/glusterfs_test.go | 18 +++++++++--------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index eb7a72fca4a..016a8f257d9 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -368,7 +368,7 @@ func (plugin *glusterfsPlugin) newProvisionerInternal(options volume.VolumeOptio }, nil } -type provisioningConfig struct { +type provisionerConfig struct { url string user string userKey string @@ -383,7 +383,7 @@ type provisioningConfig struct { type glusterfsVolumeProvisioner struct { *glusterfsMounter - provisioningConfig + provisionerConfig options volume.VolumeOptions } @@ -438,7 +438,7 @@ func (plugin *glusterfsPlugin) newDeleterInternal(spec *volume.Spec) (volume.Del type glusterfsVolumeDeleter struct { *glusterfsMounter - provisioningConfig + provisionerConfig spec *v1.PersistentVolume } @@ -579,9 +579,9 @@ func (d *glusterfsVolumeDeleter) Delete() error { if err != nil { return err } - d.provisioningConfig = *cfg + d.provisionerConfig = *cfg - glog.V(4).Infof("glusterfs: deleting volume %q with configuration %+v", volumeId, d.provisioningConfig) + glog.V(4).Infof("glusterfs: deleting volume %q with configuration %+v", volumeId, d.provisionerConfig) gid, exists, err := d.getGid() if err != nil { @@ -647,9 +647,9 @@ func (r *glusterfsVolumeProvisioner) Provision() (*v1.PersistentVolume, error) { if err != nil { return nil, err } - r.provisioningConfig = *cfg + r.provisionerConfig = *cfg - glog.V(4).Infof("glusterfs: creating volume with configuration %+v", r.provisioningConfig) + glog.V(4).Infof("glusterfs: creating volume with configuration %+v", r.provisionerConfig) gidTable, err := r.plugin.getGidTable(scName, cfg.gidMin, cfg.gidMax) if err != nil { @@ -695,7 +695,7 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum capacity := p.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] volSizeBytes := capacity.Value() sz := int(volume.RoundUpSize(volSizeBytes, 1024*1024*1024)) - glog.V(2).Infof("glusterfs: create volume of size: %d bytes and configuration %+v", volSizeBytes, p.provisioningConfig) + glog.V(2).Infof("glusterfs: create volume of size: %d bytes and configuration %+v", volSizeBytes, p.provisionerConfig) if p.url == "" { glog.Errorf("glusterfs : rest server endpoint is empty") return nil, 0, fmt.Errorf("failed to create glusterfs REST client, REST URL is empty") @@ -705,7 +705,7 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum glog.Errorf("glusterfs: failed to create glusterfs rest client") return nil, 0, fmt.Errorf("failed to create glusterfs REST client, REST server authentication failed") } - if p.provisioningConfig.clusterId != "" { + if p.provisionerConfig.clusterId != "" { clusterIds = dstrings.Split(p.clusterId, ",") glog.V(4).Infof("glusterfs: provided clusterids: %v", clusterIds) } @@ -855,8 +855,8 @@ func parseSecret(namespace, secretName string, kubeClient clientset.Interface) ( } // parseClassParameters parses StorageClass.Parameters -func parseClassParameters(params map[string]string, kubeClient clientset.Interface) (*provisioningConfig, error) { - var cfg provisioningConfig +func parseClassParameters(params map[string]string, kubeClient clientset.Interface) (*provisionerConfig, error) { + var cfg provisionerConfig var err error cfg.gidMin = defaultGidMin diff --git a/pkg/volume/glusterfs/glusterfs_test.go b/pkg/volume/glusterfs/glusterfs_test.go index 18eb03b6692..9a0bcf8ed14 100644 --- a/pkg/volume/glusterfs/glusterfs_test.go +++ b/pkg/volume/glusterfs/glusterfs_test.go @@ -254,7 +254,7 @@ func TestParseClassParameters(t *testing.T) { parameters map[string]string secret *v1.Secret expectError bool - expectConfig *provisioningConfig + expectConfig *provisionerConfig }{ { "password", @@ -265,7 +265,7 @@ func TestParseClassParameters(t *testing.T) { }, nil, // secret false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", user: "admin", userKey: "password", @@ -285,7 +285,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", user: "admin", secretName: "mysecret", @@ -304,7 +304,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", gidMin: 2000, gidMax: 2147483647, @@ -441,7 +441,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", gidMin: 4000, gidMax: 2147483647, @@ -457,7 +457,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", gidMin: 2000, gidMax: 5000, @@ -474,7 +474,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", gidMin: 4000, gidMax: 5000, @@ -493,7 +493,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", gidMin: 4000, gidMax: 5000, @@ -512,7 +512,7 @@ func TestParseClassParameters(t *testing.T) { }, &secret, false, // expect error - &provisioningConfig{ + &provisionerConfig{ url: "https://localhost:8080", gidMin: 4000, gidMax: 5000,