mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-03 15:25:19 +00:00
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog - klog as explicit InitFlags() so we add them as necessary - we update the other repositories that we vendor that made a similar change from glog to klog * github.com/kubernetes/repo-infra * k8s.io/gengo/ * k8s.io/kube-openapi/ * github.com/google/cadvisor - Entirely remove all references to glog - Fix some tests by explicit InitFlags in their init() methods Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -257,7 +257,7 @@ func (plugin *localVolumePlugin) NewDeviceMounter() (volume.DeviceMounter, error
|
||||
}
|
||||
|
||||
func (dm *deviceMounter) mountLocalBlockDevice(spec *volume.Spec, devicePath string, deviceMountPath string) error {
|
||||
glog.V(4).Infof("local: mounting device %s to %s", devicePath, deviceMountPath)
|
||||
klog.V(4).Infof("local: mounting device %s to %s", devicePath, deviceMountPath)
|
||||
notMnt, err := dm.mounter.IsLikelyNotMountPoint(deviceMountPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
@@ -291,7 +291,7 @@ func (dm *deviceMounter) mountLocalBlockDevice(spec *volume.Spec, devicePath str
|
||||
os.Remove(deviceMountPath)
|
||||
return fmt.Errorf("local: failed to mount device %s at %s (fstype: %s), error %v", devicePath, deviceMountPath, fstype, err)
|
||||
}
|
||||
glog.V(3).Infof("local: successfully mount device %s at %s (fstype: %s)", devicePath, deviceMountPath, fstype)
|
||||
klog.V(3).Infof("local: successfully mount device %s at %s (fstype: %s)", devicePath, deviceMountPath, fstype)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -434,9 +434,9 @@ func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
}
|
||||
|
||||
notMnt, err := m.mounter.IsNotMountPoint(dir)
|
||||
glog.V(4).Infof("LocalVolume mount setup: PodDir(%s) VolDir(%s) Mounted(%t) Error(%v), ReadOnly(%t)", dir, m.globalPath, !notMnt, err, m.readOnly)
|
||||
klog.V(4).Infof("LocalVolume mount setup: PodDir(%s) VolDir(%s) Mounted(%t) Error(%v), ReadOnly(%t)", dir, m.globalPath, !notMnt, err, m.readOnly)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
glog.Errorf("cannot validate mount point: %s %v", dir, err)
|
||||
klog.Errorf("cannot validate mount point: %s %v", dir, err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
refs, err := m.mounter.GetMountRefs(m.globalPath)
|
||||
if fsGroup != nil {
|
||||
if err != nil {
|
||||
glog.Errorf("cannot collect mounting information: %s %v", m.globalPath, err)
|
||||
klog.Errorf("cannot collect mounting information: %s %v", m.globalPath, err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
if runtime.GOOS != "windows" {
|
||||
// skip below MkdirAll for windows since the "bind mount" logic is implemented differently in mount_wiondows.go
|
||||
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||
glog.Errorf("mkdir failed on disk %s (%v)", dir, err)
|
||||
klog.Errorf("mkdir failed on disk %s (%v)", dir, err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -479,29 +479,29 @@ func (m *localVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
|
||||
}
|
||||
mountOptions := util.JoinMountOptions(options, m.mountOptions)
|
||||
|
||||
glog.V(4).Infof("attempting to mount %s", dir)
|
||||
klog.V(4).Infof("attempting to mount %s", dir)
|
||||
globalPath := util.MakeAbsolutePath(runtime.GOOS, m.globalPath)
|
||||
err = m.mounter.Mount(globalPath, dir, "", mountOptions)
|
||||
if err != nil {
|
||||
glog.Errorf("Mount of volume %s failed: %v", dir, err)
|
||||
klog.Errorf("Mount of volume %s failed: %v", dir, err)
|
||||
notMnt, mntErr := m.mounter.IsNotMountPoint(dir)
|
||||
if mntErr != nil {
|
||||
glog.Errorf("IsNotMountPoint check failed: %v", mntErr)
|
||||
klog.Errorf("IsNotMountPoint check failed: %v", mntErr)
|
||||
return err
|
||||
}
|
||||
if !notMnt {
|
||||
if mntErr = m.mounter.Unmount(dir); mntErr != nil {
|
||||
glog.Errorf("Failed to unmount: %v", mntErr)
|
||||
klog.Errorf("Failed to unmount: %v", mntErr)
|
||||
return err
|
||||
}
|
||||
notMnt, mntErr = m.mounter.IsNotMountPoint(dir)
|
||||
if mntErr != nil {
|
||||
glog.Errorf("IsNotMountPoint check failed: %v", mntErr)
|
||||
klog.Errorf("IsNotMountPoint check failed: %v", mntErr)
|
||||
return err
|
||||
}
|
||||
if !notMnt {
|
||||
// This is very odd, we don't expect it. We'll try again next sync loop.
|
||||
glog.Errorf("%s is still mounted, despite call to unmount(). Will try again next sync loop.", dir)
|
||||
klog.Errorf("%s is still mounted, despite call to unmount(). Will try again next sync loop.", dir)
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -541,7 +541,7 @@ func (u *localVolumeUnmounter) TearDown() error {
|
||||
|
||||
// TearDownAt unmounts the bind mount
|
||||
func (u *localVolumeUnmounter) TearDownAt(dir string) error {
|
||||
glog.V(4).Infof("Unmounting volume %q at path %q\n", u.volName, dir)
|
||||
klog.V(4).Infof("Unmounting volume %q at path %q\n", u.volName, dir)
|
||||
return util.UnmountMountPoint(dir, u.mounter, true) /* extensiveMountPointCheck = true */
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ var _ volume.BlockVolumeMapper = &localVolumeMapper{}
|
||||
// SetUpDevice provides physical device path for the local PV.
|
||||
func (m *localVolumeMapper) SetUpDevice() (string, error) {
|
||||
globalPath := util.MakeAbsolutePath(runtime.GOOS, m.globalPath)
|
||||
glog.V(4).Infof("SetupDevice returning path %s", globalPath)
|
||||
klog.V(4).Infof("SetupDevice returning path %s", globalPath)
|
||||
return globalPath, nil
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ var _ volume.BlockVolumeUnmapper = &localVolumeUnmapper{}
|
||||
|
||||
// TearDownDevice will undo SetUpDevice procedure. In local PV, all of this already handled by operation_generator.
|
||||
func (u *localVolumeUnmapper) TearDownDevice(mapPath, _ string) error {
|
||||
glog.V(4).Infof("local: TearDownDevice completed for: %s", mapPath)
|
||||
klog.V(4).Infof("local: TearDownDevice completed for: %s", mapPath)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user