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 (
|
2017-06-22 17:25:57 +00:00
|
|
|
"k8s.io/api/core/v1"
|
2018-11-09 18:49:10 +00:00
|
|
|
"k8s.io/klog"
|
2017-08-22 22:03:47 +00:00
|
|
|
|
2018-02-02 20:04:45 +00:00
|
|
|
"k8s.io/apimachinery/pkg/api/resource"
|
2017-09-01 17:46:39 +00:00
|
|
|
internalapi "k8s.io/kubernetes/pkg/kubelet/apis/cri"
|
2018-11-14 03:25:56 +00:00
|
|
|
podresourcesapi "k8s.io/kubernetes/pkg/kubelet/apis/podresources/v1alpha1"
|
2017-09-01 17:27:51 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
|
2017-10-23 23:18:49 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/config"
|
2017-08-22 22:03:47 +00:00
|
|
|
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
2017-11-02 01:17:48 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
|
2017-09-01 17:46:39 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/status"
|
2018-01-24 17:06:07 +00:00
|
|
|
"k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher"
|
2018-05-15 02:49:54 +00:00
|
|
|
schedulercache "k8s.io/kubernetes/pkg/scheduler/cache"
|
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-10-23 23:18:49 +00:00
|
|
|
func (cm *containerManagerStub) Start(_ *v1.Node, _ ActivePodsFunc, _ config.SourcesReady, _ status.PodStatusProvider, _ internalapi.RuntimeService) error {
|
2018-11-09 18:49:10 +00:00
|
|
|
klog.V(2).Infof("Starting stub container manager")
|
2015-10-10 00:09:53 +00:00
|
|
|
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 {
|
2018-02-02 20:04:45 +00:00
|
|
|
c := v1.ResourceList{
|
|
|
|
v1.ResourceEphemeralStorage: *resource.NewQuantity(
|
|
|
|
int64(0),
|
|
|
|
resource.BinarySI),
|
|
|
|
}
|
|
|
|
return c
|
2017-06-26 19:49:00 +00:00
|
|
|
}
|
|
|
|
|
2018-08-11 23:59:39 +00:00
|
|
|
func (cm *containerManagerStub) GetPluginRegistrationHandler() pluginwatcher.PluginHandler {
|
|
|
|
return nil
|
2018-01-24 17:06:07 +00:00
|
|
|
}
|
|
|
|
|
2017-12-16 06:38:46 +00:00
|
|
|
func (cm *containerManagerStub) GetDevicePluginResourceCapacity() (v1.ResourceList, v1.ResourceList, []string) {
|
|
|
|
return nil, nil, []string{}
|
2017-10-23 23:18:49 +00:00
|
|
|
}
|
|
|
|
|
2016-07-13 04:39:22 +00:00
|
|
|
func (cm *containerManagerStub) NewPodContainerManager() PodContainerManager {
|
|
|
|
return &podContainerManagerStub{}
|
|
|
|
}
|
|
|
|
|
2017-11-02 01:17:48 +00:00
|
|
|
func (cm *containerManagerStub) GetResources(pod *v1.Pod, container *v1.Container) (*kubecontainer.RunContainerOptions, error) {
|
2017-08-22 22:03:47 +00:00
|
|
|
return &kubecontainer.RunContainerOptions{}, nil
|
|
|
|
}
|
|
|
|
|
2017-11-02 01:17:48 +00:00
|
|
|
func (cm *containerManagerStub) UpdatePluginResources(*schedulercache.NodeInfo, *lifecycle.PodAdmitAttributes) error {
|
|
|
|
return 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
|
|
|
}
|
|
|
|
|
2018-02-16 22:53:44 +00:00
|
|
|
func (cm *containerManagerStub) GetPodCgroupRoot() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2018-11-14 03:25:56 +00:00
|
|
|
func (cm *containerManagerStub) GetDevices(_, _ string) []*podresourcesapi.ContainerDevices {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-10-10 00:09:53 +00:00
|
|
|
func NewStubContainerManager() ContainerManager {
|
|
|
|
return &containerManagerStub{}
|
2015-05-12 00:04:36 +00:00
|
|
|
}
|