2015-05-12 00:04:36 +00:00
|
|
|
/*
|
2016-06-03 00:25:58 +00:00
|
|
|
Copyright 2015 The Kubernetes Authors.
|
2015-05-12 00:04:36 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2015-10-10 00:09:53 +00:00
|
|
|
package cm
|
2015-05-12 00:04:36 +00:00
|
|
|
|
2015-05-30 00:32:34 +00:00
|
|
|
import (
|
2015-10-10 00:09:53 +00:00
|
|
|
"github.com/golang/glog"
|
2017-06-22 17:25:57 +00:00
|
|
|
"k8s.io/api/core/v1"
|
2017-08-22 22:03:47 +00:00
|
|
|
|
2017-09-01 17:46:39 +00:00
|
|
|
internalapi "k8s.io/kubernetes/pkg/kubelet/apis/cri"
|
2017-09-01 17:27:51 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
|
2017-08-22 22:03:47 +00:00
|
|
|
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
2017-09-01 17:46:39 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/status"
|
2015-05-30 00:32:34 +00:00
|
|
|
)
|
|
|
|
|
2015-10-10 00:09:53 +00:00
|
|
|
type containerManagerStub struct{}
|
2015-05-30 00:32:34 +00:00
|
|
|
|
2015-10-10 00:09:53 +00:00
|
|
|
var _ ContainerManager = &containerManagerStub{}
|
|
|
|
|
2017-09-01 17:46:39 +00:00
|
|
|
func (cm *containerManagerStub) Start(_ *v1.Node, _ ActivePodsFunc, _ status.PodStatusProvider, _ internalapi.RuntimeService) error {
|
2015-10-10 00:09:53 +00:00
|
|
|
glog.V(2).Infof("Starting stub container manager")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-11-18 20:50:58 +00:00
|
|
|
func (cm *containerManagerStub) SystemCgroupsLimit() v1.ResourceList {
|
|
|
|
return v1.ResourceList{}
|
2015-10-10 00:09:53 +00:00
|
|
|
}
|
|
|
|
|
2016-02-05 01:49:17 +00:00
|
|
|
func (cm *containerManagerStub) GetNodeConfig() NodeConfig {
|
|
|
|
return NodeConfig{}
|
|
|
|
}
|
|
|
|
|
2016-07-13 04:39:22 +00:00
|
|
|
func (cm *containerManagerStub) GetMountedSubsystems() *CgroupSubsystems {
|
|
|
|
return &CgroupSubsystems{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cm *containerManagerStub) GetQOSContainersInfo() QOSContainersInfo {
|
|
|
|
return QOSContainersInfo{}
|
|
|
|
}
|
|
|
|
|
2017-02-21 20:10:45 +00:00
|
|
|
func (cm *containerManagerStub) UpdateQOSCgroups() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-03-04 00:37:09 +00:00
|
|
|
func (cm *containerManagerStub) Status() Status {
|
|
|
|
return Status{}
|
|
|
|
}
|
|
|
|
|
2017-02-10 05:14:10 +00:00
|
|
|
func (cm *containerManagerStub) GetNodeAllocatableReservation() v1.ResourceList {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-06-26 19:49:00 +00:00
|
|
|
func (cm *containerManagerStub) GetCapacity() v1.ResourceList {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-07-13 04:39:22 +00:00
|
|
|
func (cm *containerManagerStub) NewPodContainerManager() PodContainerManager {
|
|
|
|
return &podContainerManagerStub{}
|
|
|
|
}
|
|
|
|
|
2017-08-22 22:03:47 +00:00
|
|
|
func (cm *containerManagerStub) GetResources(pod *v1.Pod, container *v1.Container, activePods []*v1.Pod) (*kubecontainer.RunContainerOptions, error) {
|
|
|
|
return &kubecontainer.RunContainerOptions{}, nil
|
|
|
|
}
|
|
|
|
|
2017-09-01 17:46:39 +00:00
|
|
|
func (cm *containerManagerStub) InternalContainerLifecycle() InternalContainerLifecycle {
|
2017-09-01 17:27:51 +00:00
|
|
|
return &internalContainerLifecycleImpl{cpumanager.NewFakeManager()}
|
2017-09-01 17:46:39 +00:00
|
|
|
}
|
|
|
|
|
2015-10-10 00:09:53 +00:00
|
|
|
func NewStubContainerManager() ContainerManager {
|
|
|
|
return &containerManagerStub{}
|
2015-05-12 00:04:36 +00:00
|
|
|
}
|