Add glide.yaml and vendor deps

This commit is contained in:
Dalton Hubble 2016-12-03 22:43:32 -08:00
parent db918f12ad
commit 5b3d5e81bd
18880 changed files with 5166045 additions and 1 deletions

View file

@ -0,0 +1,25 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
"go_test",
"cgo_library",
)
go_library(
name = "go_default_library",
srcs = [
"fake_cache.go",
"pods_to_cache.go",
],
tags = ["automanaged"],
deps = [
"//pkg/api/v1:go_default_library",
"//pkg/labels:go_default_library",
"//plugin/pkg/scheduler/schedulercache:go_default_library",
],
)

View file

@ -0,0 +1,53 @@
/*
Copyright 2015 The Kubernetes Authors.
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.
*/
package schedulercache
import (
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
)
// FakeCache is used for testing
type FakeCache struct {
AssumeFunc func(*v1.Pod)
}
func (f *FakeCache) AssumePod(pod *v1.Pod) error {
f.AssumeFunc(pod)
return nil
}
func (f *FakeCache) ForgetPod(pod *v1.Pod) error { return nil }
func (f *FakeCache) AddPod(pod *v1.Pod) error { return nil }
func (f *FakeCache) UpdatePod(oldPod, newPod *v1.Pod) error { return nil }
func (f *FakeCache) RemovePod(pod *v1.Pod) error { return nil }
func (f *FakeCache) AddNode(node *v1.Node) error { return nil }
func (f *FakeCache) UpdateNode(oldNode, newNode *v1.Node) error { return nil }
func (f *FakeCache) RemoveNode(node *v1.Node) error { return nil }
func (f *FakeCache) UpdateNodeNameToInfoMap(infoMap map[string]*schedulercache.NodeInfo) error {
return nil
}
func (f *FakeCache) List(s labels.Selector) ([]*v1.Pod, error) { return nil, nil }

View file

@ -0,0 +1,55 @@
/*
Copyright 2015 The Kubernetes Authors.
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.
*/
package schedulercache
import (
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
)
// PodsToCache is used for testing
type PodsToCache []*v1.Pod
func (p PodsToCache) AssumePod(pod *v1.Pod) error { return nil }
func (p PodsToCache) ForgetPod(pod *v1.Pod) error { return nil }
func (p PodsToCache) AddPod(pod *v1.Pod) error { return nil }
func (p PodsToCache) UpdatePod(oldPod, newPod *v1.Pod) error { return nil }
func (p PodsToCache) RemovePod(pod *v1.Pod) error { return nil }
func (p PodsToCache) AddNode(node *v1.Node) error { return nil }
func (p PodsToCache) UpdateNode(oldNode, newNode *v1.Node) error { return nil }
func (p PodsToCache) RemoveNode(node *v1.Node) error { return nil }
func (p PodsToCache) UpdateNodeNameToInfoMap(infoMap map[string]*schedulercache.NodeInfo) error {
return nil
}
func (p PodsToCache) List(s labels.Selector) (selected []*v1.Pod, err error) {
for _, pod := range p {
if s.Matches(labels.Set(pod.Labels)) {
selected = append(selected, pod)
}
}
return selected, nil
}