diff --git a/pkg/kubelet/cm/helpers.go b/pkg/kubelet/cm/helpers.go index d1c0beabf74..1de4f7d5284 100644 --- a/pkg/kubelet/cm/helpers.go +++ b/pkg/kubelet/cm/helpers.go @@ -20,6 +20,7 @@ import ( "context" "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" internalapi "k8s.io/cri-api/pkg/apis" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" @@ -28,6 +29,16 @@ import ( evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api" ) +// for typecheck across platforms +var _ func(int64, int64) int64 = MilliCPUToQuota +var _ func(int64) uint64 = MilliCPUToShares +var _ func(*v1.Pod, bool, uint64, bool) *ResourceConfig = ResourceConfigForPod +var _ func() (*CgroupSubsystems, error) = GetCgroupSubsystems +var _ func(string) ([]int, error) = getCgroupProcs +var _ func(types.UID) string = GetPodCgroupNameSuffix +var _ func(string, bool, string) string = NodeAllocatableRoot +var _ func(string) (string, error) = GetKubeletContainer + // hardEvictionReservation returns a resourcelist that includes reservation of resources based on hard eviction thresholds. func hardEvictionReservation(thresholds []evictionapi.Threshold, capacity v1.ResourceList) v1.ResourceList { if len(thresholds) == 0 { diff --git a/pkg/kubelet/cm/helpers_unsupported.go b/pkg/kubelet/cm/helpers_unsupported.go index 187cae59883..e739e3db408 100644 --- a/pkg/kubelet/cm/helpers_unsupported.go +++ b/pkg/kubelet/cm/helpers_unsupported.go @@ -41,7 +41,7 @@ func MilliCPUToQuota(milliCPU, period int64) int64 { } // MilliCPUToShares converts the milliCPU to CFS shares. -func MilliCPUToShares(milliCPU int64) int64 { +func MilliCPUToShares(milliCPU int64) uint64 { return 0 }