diff --git a/pkg/volume/storageos/storageos_util_test.go b/pkg/volume/storageos/storageos_util_test.go index bff34ca7d01..be912b64d72 100644 --- a/pkg/volume/storageos/storageos_util_test.go +++ b/pkg/volume/storageos/storageos_util_test.go @@ -184,9 +184,9 @@ func TestCreateVolume(t *testing.T) { if len(vol.Labels) == 0 { t.Error("CreateVolume() Labels are empty") } else { + var val string + var ok bool for k, v := range labels { - var val string - var ok bool if val, ok = vol.Labels[k]; !ok { t.Errorf("CreateVolume() Label %s not set", k) } @@ -194,8 +194,6 @@ func TestCreateVolume(t *testing.T) { t.Errorf("CreateVolume() returned unexpected Label value %s", val) } } - var val string - var ok bool if val, ok = vol.Labels["labelfromapi"]; !ok { t.Error("CreateVolume() Label from api not set") }