@@ -209,7 +209,7 @@ func (os *OpenStack) OperationPending(diskName string) (bool, string, error) {
209209 return true , volumeStatus , nil
210210}
211211
212- // Attaches given cinder volume to the compute running kubelet
212+ // AttachDisk attaches given cinder volume to the compute running kubelet
213213func (os * OpenStack ) AttachDisk (instanceID , volumeID string ) (string , error ) {
214214 volume , err := os .getVolume (volumeID )
215215 if err != nil {
@@ -288,7 +288,7 @@ func (os *OpenStack) DetachDisk(instanceID, volumeID string) error {
288288 return nil
289289}
290290
291- // Retrieves Volume by its ID.
291+ // getVolume retrieves Volume by its ID.
292292func (os * OpenStack ) getVolume (volumeID string ) (Volume , error ) {
293293 volumes , err := os .volumeService ("" )
294294 if err != nil || volumes == nil {
@@ -298,7 +298,7 @@ func (os *OpenStack) getVolume(volumeID string) (Volume, error) {
298298 return volumes .getVolume (volumeID )
299299}
300300
301- // Create a volume of given size (in GiB)
301+ // CreateVolume creates a volume of given size (in GiB)
302302func (os * OpenStack ) CreateVolume (name string , size int , vtype , availability string , tags * map [string ]string ) (string , string , error ) {
303303 volumes , err := os .volumeService ("" )
304304 if err != nil || volumes == nil {
@@ -378,7 +378,7 @@ func (os *OpenStack) DeleteVolume(volumeID string) error {
378378
379379}
380380
381- // Get device path of attached volume to the compute running kubelet, as known by cinder
381+ // GetAttachmentDiskPath gets device path of attached volume to the compute running kubelet, as known by cinder
382382func (os * OpenStack ) GetAttachmentDiskPath (instanceID , volumeID string ) (string , error ) {
383383 // See issue #33128 - Cinder does not always tell you the right device path, as such
384384 // we must only use this value as a last resort.
@@ -405,7 +405,7 @@ func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string,
405405 return "" , fmt .Errorf ("volume %s has no ServerId." , volumeID )
406406}
407407
408- // query if a volume is attached to a compute instance
408+ // DiskIsAttached queries if a volume is attached to a compute instance
409409func (os * OpenStack ) DiskIsAttached (instanceID , volumeID string ) (bool , error ) {
410410 volume , err := os .getVolume (volumeID )
411411 if err != nil {
@@ -415,7 +415,7 @@ func (os *OpenStack) DiskIsAttached(instanceID, volumeID string) (bool, error) {
415415 return instanceID == volume .AttachedServerId , nil
416416}
417417
418- // query if a list of volumes are attached to a compute instance
418+ // DisksAreAttached queries if a list of volumes are attached to a compute instance
419419func (os * OpenStack ) DisksAreAttached (instanceID string , volumeIDs []string ) (map [string ]bool , error ) {
420420 attached := make (map [string ]bool )
421421 for _ , volumeID := range volumeIDs {
@@ -434,7 +434,7 @@ func (os *OpenStack) diskIsUsed(volumeID string) (bool, error) {
434434 return volume .AttachedServerId != "" , nil
435435}
436436
437- // query if we should trust the cinder provide deviceName, See issue #33128
437+ // ShouldTrustDevicePath queries if we should trust the cinder provide deviceName, See issue #33128
438438func (os * OpenStack ) ShouldTrustDevicePath () bool {
439439 return os .bsOpts .TrustDevicePath
440440}
0 commit comments