Skip to content

Commit

Permalink
rebased commit for investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
clintkitson committed Dec 3, 2015
1 parent e2b2ff3 commit c800216
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/storage/gce/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const providerName = "gce"

// The GCE storage driver.
type driver struct {
currentInstanceId string
currentInstanceID string
client *compute.Service
r *core.RexRay
zone string
Expand Down Expand Up @@ -91,12 +91,12 @@ func (d *driver) Init(r *core.RexRay) error {
}

d.client = client
instanceId, err := getCurrentInstanceID()
instanceID, err := getCurrentInstanceID()
if err != nil {
log.WithField("provider", providerName).Fatalf("Could not get current instance => {%s}", err)
return err
}
d.currentInstanceId = instanceId
d.currentInstanceID = instanceID
log.WithField("provider", providerName).Info("storage driver initialized")
return nil
}
Expand Down Expand Up @@ -186,7 +186,7 @@ func (d *driver) GetInstance() (*core.Instance, error) {
return nil, err
}
for _, instance := range instances.Items {
if strconv.FormatUint(instance.Id, 10) == d.currentInstanceId {
if strconv.FormatUint(instance.Id, 10) == d.currentInstanceID {
return &core.Instance{
ProviderName: "gce",
InstanceID: instance.Name,
Expand Down Expand Up @@ -458,7 +458,7 @@ func (d *driver) AttachVolume(
runAsync bool,
volumeID, instanceID string) ([]*core.VolumeAttachment, error) {
if instanceID == "" {
instanceID = d.currentInstanceId
instanceID = d.currentInstanceID
}
instance, err := d.GetInstance()
if err != nil {
Expand Down Expand Up @@ -516,11 +516,11 @@ func (d *driver) DetachVolume(
}
attachements, err := d.GetVolumeAttach(volumeID, instanceID)
for _, attachement := range attachements {
targetVolumeId := strings.Replace(attachement.VolumeID,
targetVolumeID := strings.Replace(attachement.VolumeID,
fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/%s/zones/%s/disks/", d.project, d.zone),
"",
-1)
if targetVolumeId == volumeID {
if targetVolumeID == volumeID {
diskName := strings.Replace(attachement.DeviceName, "/dev/disk/by-id/google-", "", -1)
operation, err := d.client.Instances.DetachDisk(d.project, d.zone, instanceID, diskName).Do()
if err != nil {
Expand Down

0 comments on commit c800216

Please sign in to comment.