k8s.io/kubernetes@v1.29.3/pkg/kubelet/cm/pod_container_manager_stub.go (about) 1 /* 2 Copyright 2016 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package cm 18 19 import ( 20 "k8s.io/api/core/v1" 21 "k8s.io/apimachinery/pkg/types" 22 ) 23 24 type podContainerManagerStub struct { 25 } 26 27 var _ PodContainerManager = &podContainerManagerStub{} 28 29 func (m *podContainerManagerStub) Exists(_ *v1.Pod) bool { 30 return true 31 } 32 33 func (m *podContainerManagerStub) EnsureExists(_ *v1.Pod) error { 34 return nil 35 } 36 37 func (m *podContainerManagerStub) GetPodContainerName(_ *v1.Pod) (CgroupName, string) { 38 return nil, "" 39 } 40 41 func (m *podContainerManagerStub) Destroy(_ CgroupName) error { 42 return nil 43 } 44 45 func (m *podContainerManagerStub) ReduceCPULimits(_ CgroupName) error { 46 return nil 47 } 48 49 func (m *podContainerManagerStub) GetAllPodsFromCgroups() (map[types.UID]CgroupName, error) { 50 return nil, nil 51 } 52 53 func (m *podContainerManagerStub) IsPodCgroup(cgroupfs string) (bool, types.UID) { 54 return false, types.UID("") 55 } 56 57 func (m *podContainerManagerStub) GetPodCgroupMemoryUsage(_ *v1.Pod) (uint64, error) { 58 return 0, nil 59 } 60 61 func (m *podContainerManagerStub) GetPodCgroupMemoryLimit(_ *v1.Pod) (uint64, error) { 62 return 0, nil 63 } 64 65 func (m *podContainerManagerStub) GetPodCgroupCpuLimit(_ *v1.Pod) (int64, uint64, uint64, error) { 66 return 0, 0, 0, nil 67 } 68 69 func (m *podContainerManagerStub) SetPodCgroupMemoryLimit(_ *v1.Pod, _ int64) error { 70 return nil 71 } 72 73 func (m *podContainerManagerStub) SetPodCgroupCpuLimit(_ *v1.Pod, _ *int64, _, _ *uint64) error { 74 return nil 75 }