mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Merge pull request #92878 from jvanz/issue90293
cleanup: print warning message only if the function does not finish within 30 seconds
This commit is contained in:
commit
5760cef7a4
@ -23,6 +23,7 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
@ -46,7 +47,10 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64, fsGroupChangePolicy *v1
|
|||||||
|
|
||||||
fsGroupPolicyEnabled := utilfeature.DefaultFeatureGate.Enabled(features.ConfigurableFSGroupPolicy)
|
fsGroupPolicyEnabled := utilfeature.DefaultFeatureGate.Enabled(features.ConfigurableFSGroupPolicy)
|
||||||
|
|
||||||
klog.Warningf("Setting volume ownership for %s and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699", mounter.GetPath())
|
timer := time.AfterFunc(30*time.Second, func() {
|
||||||
|
klog.Warningf("Setting volume ownership for %s and fsGroup set. If the volume has a lot of files then setting volume ownership could be slow, see https://github.com/kubernetes/kubernetes/issues/69699", mounter.GetPath())
|
||||||
|
})
|
||||||
|
defer timer.Stop()
|
||||||
|
|
||||||
// This code exists for legacy purposes, so as old behaviour is entirely preserved when feature gate is disabled
|
// This code exists for legacy purposes, so as old behaviour is entirely preserved when feature gate is disabled
|
||||||
// TODO: remove this when ConfigurableFSGroupPolicy turns GA.
|
// TODO: remove this when ConfigurableFSGroupPolicy turns GA.
|
||||||
|
Loading…
Reference in New Issue
Block a user