Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gcepd support for VolumeInspectByName #579

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion drivers/storage/gcepd/storage/gce_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (d *driver) Volumes(
return vols, nil
}

// VolumeInspect inspects a single volume.
// VolumeInspect inspects a single volume by ID.
func (d *driver) VolumeInspect(
ctx types.Context,
volumeID string,
Expand Down Expand Up @@ -335,6 +335,20 @@ func (d *driver) VolumeInspect(
return vols[0], nil
}

// VolumeInspectByName inspects a single volume by name.
func (d *driver) VolumeInspectByName(
ctx types.Context,
volumeName string,
opts *types.VolumeInspectOpts) (*types.Volume, error) {

// For GCE, name and ID are the same
return d.VolumeInspect(
ctx,
volumeName,
opts,
)
}

// VolumeCreate creates a new volume.
func (d *driver) VolumeCreate(
ctx types.Context,
Expand Down