mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
util: Rename KernelVersion to GetKernelVersion
Renames KernelVersion to GetKernelVersion for more readibility. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
12c3be9974
commit
567b2ab280
@ -111,7 +111,7 @@ func main() {
|
|||||||
fmt.Println("Go Version:", runtime.Version())
|
fmt.Println("Go Version:", runtime.Version())
|
||||||
fmt.Println("Compiler:", runtime.Compiler)
|
fmt.Println("Compiler:", runtime.Compiler)
|
||||||
fmt.Printf("Platform: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
fmt.Printf("Platform: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||||
if kv, err := util.KernelVersion(); err == nil {
|
if kv, err := util.GetKernelVersion(); err == nil {
|
||||||
fmt.Println("Kernel:", kv)
|
fmt.Println("Kernel:", kv)
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
@ -79,7 +79,7 @@ func loadAvailableMounters(conf *util.Config) error {
|
|||||||
klog.Errorf("failed to run mount.ceph %v", err)
|
klog.Errorf("failed to run mount.ceph %v", err)
|
||||||
} else {
|
} else {
|
||||||
// fetch the current running kernel info
|
// fetch the current running kernel info
|
||||||
release, kvErr := util.KernelVersion()
|
release, kvErr := util.GetKernelVersion()
|
||||||
if kvErr != nil {
|
if kvErr != nil {
|
||||||
return kvErr
|
return kvErr
|
||||||
}
|
}
|
||||||
|
@ -141,9 +141,9 @@ func ValidateDriverName(driverName string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// KernelVersion returns the version of the running Unix (like) system from the
|
// GetKernelVersion returns the version of the running Unix (like) system from the
|
||||||
// 'utsname' structs 'release' component.
|
// 'utsname' structs 'release' component.
|
||||||
func KernelVersion() (string, error) {
|
func GetKernelVersion() (string, error) {
|
||||||
utsname := unix.Utsname{}
|
utsname := unix.Utsname{}
|
||||||
err := unix.Uname(&utsname)
|
err := unix.Uname(&utsname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -144,8 +144,8 @@ func TestRoundOffVolSize(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestKernelVersion(t *testing.T) {
|
func TestGetKernelVersion(t *testing.T) {
|
||||||
version, err := KernelVersion()
|
version, err := GetKernelVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to get kernel version: %s", err)
|
t.Errorf("failed to get kernel version: %s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user