mirror of https://github.com/k3s-io/k3s
Merge pull request #41778 from NickrenREN/volume-typo
Automatic merge from submit-queue (batch tested with PRs 38702, 41810, 41778, 41858, 41872) fix some typos and var style **Release note**: ```NONE ```pull/6/head
commit
e373b5981a
|
@ -71,15 +71,15 @@ type Metrics struct {
|
||||||
// InodesUsed represents the total inodes used by the Volume.
|
// InodesUsed represents the total inodes used by the Volume.
|
||||||
InodesUsed *resource.Quantity
|
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),
|
// For volumes that share a filesystem with the host (e.g. emptydir, hostpath),
|
||||||
// this is the inodes available in the underlying storage,
|
// this is the inodes available in the underlying storage,
|
||||||
// and will not equal InodesUsed + InodesFree as the fs is shared.
|
// and will not equal InodesUsed + InodesFree as the fs is shared.
|
||||||
Inodes *resource.Quantity
|
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
|
// 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
|
InodesFree *resource.Quantity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ type Deleter interface {
|
||||||
// as error and it will be sent as "Info" event to the PV being deleted. The
|
// 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
|
// 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
|
// 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.
|
// error would confuse users.
|
||||||
Delete() error
|
Delete() error
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,8 @@ type Attacher interface {
|
||||||
Attach(spec *Spec, nodeName types.NodeName) (string, error)
|
Attach(spec *Spec, nodeName types.NodeName) (string, error)
|
||||||
|
|
||||||
// VolumesAreAttached checks whether the list of volumes still attached to the specified
|
// 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.
|
// 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
|
// If an error is occurred during checking, the error will be returned
|
||||||
VolumesAreAttached(specs []*Spec, nodeName types.NodeName) (map[*Spec]bool, error)
|
VolumesAreAttached(specs []*Spec, nodeName types.NodeName) (map[*Spec]bool, error)
|
||||||
|
|
||||||
// WaitForAttach blocks until the device is attached to this
|
// WaitForAttach blocks until the device is attached to this
|
||||||
|
@ -271,16 +271,16 @@ func copyFolder(source string, dest string) (err error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcefilepointer := source + "\\" + obj.Name()
|
sourceFilePointer := source + "\\" + obj.Name()
|
||||||
destinationfilepointer := dest + "\\" + obj.Name()
|
destinationFilePointer := dest + "\\" + obj.Name()
|
||||||
|
|
||||||
if obj.IsDir() {
|
if obj.IsDir() {
|
||||||
err = copyFolder(sourcefilepointer, destinationfilepointer)
|
err = copyFolder(sourceFilePointer, destinationFilePointer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err = copyFile(sourcefilepointer, destinationfilepointer)
|
err = copyFile(sourceFilePointer, destinationFilePointer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -291,25 +291,25 @@ func copyFolder(source string, dest string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyFile(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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer sourcefile.Close()
|
defer sourceFile.Close()
|
||||||
|
|
||||||
destfile, err := os.Create(dest)
|
destFile, err := os.Create(dest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer destfile.Close()
|
defer destFile.Close()
|
||||||
|
|
||||||
_, err = io.Copy(destfile, sourcefile)
|
_, err = io.Copy(destFile, sourceFile)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
sourceinfo, err := os.Stat(source)
|
sourceInfo, err := os.Stat(source)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = os.Chmod(dest, sourceinfo.Mode())
|
err = os.Chmod(dest, sourceInfo.Mode())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue