mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: bump k8s.io/klog/v2 from 2.30.0 to 2.40.1
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.30.0 to 2.40.1. - [Release notes](https://github.com/kubernetes/klog/releases) - [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes/klog/compare/v2.30.0...v2.40.1) --- updated-dependencies: - dependency-name: k8s.io/klog/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
bbce265ead
commit
c313fcd69d
34
vendor/k8s.io/klog/v2/klog_file.go
generated
vendored
34
vendor/k8s.io/klog/v2/klog_file.go
generated
vendored
@ -22,9 +22,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@ -57,38 +55,6 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
func getUserName() string {
|
||||
userNameOnce.Do(func() {
|
||||
// On Windows, the Go 'user' package requires netapi32.dll.
|
||||
// This affects Windows Nano Server:
|
||||
// https://github.com/golang/go/issues/21867
|
||||
// Fallback to using environment variables.
|
||||
if runtime.GOOS == "windows" {
|
||||
u := os.Getenv("USERNAME")
|
||||
if len(u) == 0 {
|
||||
return
|
||||
}
|
||||
// Sanitize the USERNAME since it may contain filepath separators.
|
||||
u = strings.Replace(u, `\`, "_", -1)
|
||||
|
||||
// user.Current().Username normally produces something like 'USERDOMAIN\USERNAME'
|
||||
d := os.Getenv("USERDOMAIN")
|
||||
if len(d) != 0 {
|
||||
userName = d + "_" + u
|
||||
} else {
|
||||
userName = u
|
||||
}
|
||||
} else {
|
||||
current, err := user.Current()
|
||||
if err == nil {
|
||||
userName = current.Username
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return userName
|
||||
}
|
||||
|
||||
// shortHostname returns its argument, truncating at the first period.
|
||||
// For instance, given "www.google.com" it returns "www".
|
||||
func shortHostname(hostname string) string {
|
||||
|
Reference in New Issue
Block a user