mirror of https://github.com/k3s-io/k3s
fix some typos and var style
parent
6a65964d0e
commit
6899dd85d4
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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())
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue