File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ import (
23
23
cadvisorapi2 "github.com/google/cadvisor/info/v2"
24
24
"k8s.io/api/core/v1"
25
25
"k8s.io/apimachinery/pkg/api/resource"
26
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
26
27
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
28
+ "k8s.io/kubernetes/pkg/features"
27
29
)
28
30
29
31
const (
@@ -73,5 +75,11 @@ func EphemeralStorageCapacityFromFsInfo(info cadvisorapi2.FsInfo) v1.ResourceLis
73
75
// be removed. Related issue:
74
76
// https://github.com/kubernetes/kubernetes/issues/51798
75
77
func UsingLegacyCadvisorStats (runtimeEndpoint string ) bool {
78
+ // If PodAndContainerStatsFromCRI feature is enabled, then assume the user
79
+ // wants to use CRI stats, as the aforementioned workaround isn't needed
80
+ // when this feature is enabled.
81
+ if utilfeature .DefaultFeatureGate .Enabled (features .PodAndContainerStatsFromCRI ) {
82
+ return false
83
+ }
76
84
return strings .HasSuffix (runtimeEndpoint , CrioSocketSuffix )
77
85
}
You can’t perform that action at this time.
0 commit comments