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

fix some typos and var style #41778

Merged
merged 1 commit into from
Feb 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 17 additions & 17 deletions pkg/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ type Metrics struct {
// InodesUsed represents the total inodes used by the Volume.
InodesUsed *resource.Quantity

// Inodes represents the total number of inodes availible in the volume.
// Inodes represents the total number of inodes available in the volume.
// For volumes that share a filesystem with the host (e.g. emptydir, hostpath),
// this is the inodes available in the underlying storage,
// and will not equal InodesUsed + InodesFree as the fs is shared.
Inodes *resource.Quantity

// InodesFree represent the inodes available for the volume. For Volues that share
// InodesFree represent the inodes available for the volume. For Volumes that share
// a filesystem with the host (e.g. emptydir, hostpath), this is the free inodes
// on the underlying sporage, and is shared with host processes and other volumes
// on the underlying storage, and is shared with host processes and other volumes
InodesFree *resource.Quantity
}

Expand Down Expand Up @@ -163,7 +163,7 @@ type Deleter interface {
// as error and it will be sent as "Info" event to the PV being deleted. The
// volume controller will retry deleting the volume in the next periodic
// sync. This can be used to postpone deletion of a volume that is being
// dettached from a node. Deletion of such volume would fail anyway and such
// detached from a node. Deletion of such volume would fail anyway and such
// error would confuse users.
Delete() error
}
Expand All @@ -176,8 +176,8 @@ type Attacher interface {
Attach(spec *Spec, nodeName types.NodeName) (string, error)

// VolumesAreAttached checks whether the list of volumes still attached to the specified
// the node. It returns a map which maps from the volume spec to the checking result.
// If an error is occured during checking, the error will be returned
// node. It returns a map which maps from the volume spec to the checking result.
// If an error is occurred during checking, the error will be returned
VolumesAreAttached(specs []*Spec, nodeName types.NodeName) (map[*Spec]bool, error)

// WaitForAttach blocks until the device is attached to this
Expand Down Expand Up @@ -280,16 +280,16 @@ func copyFolder(source string, dest string) (err error) {
continue
}

sourcefilepointer := source + "\\" + obj.Name()
destinationfilepointer := dest + "\\" + obj.Name()
sourceFilePointer := source + "\\" + obj.Name()
destinationFilePointer := dest + "\\" + obj.Name()

if obj.IsDir() {
err = copyFolder(sourcefilepointer, destinationfilepointer)
err = copyFolder(sourceFilePointer, destinationFilePointer)
if err != nil {
return err
}
} else {
err = copyFile(sourcefilepointer, destinationfilepointer)
err = copyFile(sourceFilePointer, destinationFilePointer)
if err != nil {
return err
}
Expand All @@ -300,25 +300,25 @@ func copyFolder(source string, dest string) (err error) {
}

func copyFile(source string, dest string) (err error) {
sourcefile, err := os.Open(source)
sourceFile, err := os.Open(source)
if err != nil {
return err
}

defer sourcefile.Close()
defer sourceFile.Close()

destfile, err := os.Create(dest)
destFile, err := os.Create(dest)
if err != nil {
return err
}

defer destfile.Close()
defer destFile.Close()

_, err = io.Copy(destfile, sourcefile)
_, err = io.Copy(destFile, sourceFile)
if err == nil {
sourceinfo, err := os.Stat(source)
sourceInfo, err := os.Stat(source)
if err != nil {
err = os.Chmod(dest, sourceinfo.Mode())
err = os.Chmod(dest, sourceInfo.Mode())
}

}
Expand Down