mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
Update vendor dir for rebasing kubernetes to 1.7.6.
This commit is contained in:
3286
vendor/k8s.io/apiserver/Godeps/Godeps.json
generated
vendored
3286
vendor/k8s.io/apiserver/Godeps/Godeps.json
generated
vendored
File diff suppressed because it is too large
Load Diff
5
vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go
generated
vendored
5
vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission.go
generated
vendored
@@ -105,6 +105,11 @@ func (l *lifecycle) Admit(a admission.Attributes) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// always allow deletion of other resources
|
||||
if a.GetOperation() == admission.Delete {
|
||||
return nil
|
||||
}
|
||||
|
||||
// always allow access review checks. Returning status about the namespace would be leaking information
|
||||
if isAccessReview(a) {
|
||||
return nil
|
||||
|
||||
18
vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission_test.go
generated
vendored
18
vendor/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission_test.go
generated
vendored
@@ -135,6 +135,24 @@ func TestAdmissionNamespaceDoesNotExist(t *testing.T) {
|
||||
}
|
||||
t.Errorf("expected error returned from admission handler: %v", actions)
|
||||
}
|
||||
|
||||
// verify create operations in the namespace cause an error
|
||||
err = handler.Admit(admission.NewAttributesRecord(&pod, nil, v1.SchemeGroupVersion.WithKind("Pod").GroupKind().WithVersion("version"), pod.Namespace, pod.Name, v1.Resource("pods").WithVersion("version"), "", admission.Create, nil))
|
||||
if err == nil {
|
||||
t.Errorf("Expected error rejecting creates in a namespace when it is missing")
|
||||
}
|
||||
|
||||
// verify update operations in the namespace cause an error
|
||||
err = handler.Admit(admission.NewAttributesRecord(&pod, nil, v1.SchemeGroupVersion.WithKind("Pod").GroupKind().WithVersion("version"), pod.Namespace, pod.Name, v1.Resource("pods").WithVersion("version"), "", admission.Update, nil))
|
||||
if err == nil {
|
||||
t.Errorf("Expected error rejecting updates in a namespace when it is missing")
|
||||
}
|
||||
|
||||
// verify delete operations in the namespace can proceed
|
||||
err = handler.Admit(admission.NewAttributesRecord(nil, nil, v1.SchemeGroupVersion.WithKind("Pod").GroupKind().WithVersion("version"), pod.Namespace, pod.Name, v1.Resource("pods").WithVersion("version"), "", admission.Delete, nil))
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error returned from admission handler: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// TestAdmissionNamespaceActive verifies a resource is admitted when the namespace is active.
|
||||
|
||||
6
vendor/k8s.io/apiserver/pkg/audit/metrics.go
generated
vendored
6
vendor/k8s.io/apiserver/pkg/audit/metrics.go
generated
vendored
@@ -32,13 +32,13 @@ var (
|
||||
eventCounter = prometheus.NewCounter(
|
||||
prometheus.CounterOpts{
|
||||
Subsystem: subsystem,
|
||||
Name: "event_count",
|
||||
Name: "event_total",
|
||||
Help: "Counter of audit events generated and sent to the audit backend.",
|
||||
})
|
||||
errorCounter = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Subsystem: subsystem,
|
||||
Name: "error_count",
|
||||
Name: "error_total",
|
||||
Help: "Counter of audit events that failed to be audited properly. " +
|
||||
"Plugin identifies the plugin affected by the error.",
|
||||
},
|
||||
@@ -47,7 +47,7 @@ var (
|
||||
levelCounter = prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Subsystem: subsystem,
|
||||
Name: "level_count",
|
||||
Name: "level_total",
|
||||
Help: "Counter of policy levels for audit events (1 per request).",
|
||||
},
|
||||
[]string{"level"},
|
||||
|
||||
8
vendor/k8s.io/apiserver/pkg/endpoints/installer.go
generated
vendored
8
vendor/k8s.io/apiserver/pkg/endpoints/installer.go
generated
vendored
@@ -575,6 +575,14 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag
|
||||
|
||||
routes := []*restful.RouteBuilder{}
|
||||
|
||||
// If there is a subresource, kind should be the parent's kind.
|
||||
if hasSubresource {
|
||||
fqParentKind, err := a.getResourceKind(resource, a.group.Storage[resource])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
kind = fqParentKind.Kind
|
||||
}
|
||||
switch action.Verb {
|
||||
case "GET": // Get a resource.
|
||||
var handler restful.RouteFunction
|
||||
|
||||
4
vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
generated
vendored
4
vendor/k8s.io/apiserver/pkg/endpoints/openapi/openapi.go
generated
vendored
@@ -63,10 +63,6 @@ func GetOperationIDAndTags(r *restful.Route) (string, []string, error) {
|
||||
op := r.Operation
|
||||
path := r.Path
|
||||
var tags []string
|
||||
// TODO: This is hacky, figure out where this name conflict is created and fix it at the root.
|
||||
if strings.HasPrefix(path, "/apis/extensions/v1beta1/namespaces/{namespace}/") && strings.HasSuffix(op, "ScaleScale") {
|
||||
op = op[:len(op)-10] + strings.Title(strings.Split(path[48:], "/")[0]) + "Scale"
|
||||
}
|
||||
prefix, exists := verbs.GetPrefix(op)
|
||||
if !exists {
|
||||
return op, tags, fmt.Errorf("operation names should start with a verb. Cannot determine operation verb from %v", op)
|
||||
|
||||
64
vendor/k8s.io/apiserver/pkg/storage/tests/cacher_test.go
generated
vendored
64
vendor/k8s.io/apiserver/pkg/storage/tests/cacher_test.go
generated
vendored
@@ -537,6 +537,70 @@ func TestStartingResourceVersion(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmptyWatchEventCache(t *testing.T) {
|
||||
server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix())
|
||||
defer server.Terminate(t)
|
||||
|
||||
// add a few objects
|
||||
updatePod(t, etcdStorage, makeTestPod("pod1"), nil)
|
||||
updatePod(t, etcdStorage, makeTestPod("pod2"), nil)
|
||||
updatePod(t, etcdStorage, makeTestPod("pod3"), nil)
|
||||
updatePod(t, etcdStorage, makeTestPod("pod4"), nil)
|
||||
updatePod(t, etcdStorage, makeTestPod("pod5"), nil)
|
||||
|
||||
fooCreated := updatePod(t, etcdStorage, makeTestPod("foo"), nil)
|
||||
|
||||
// get rv of last pod created
|
||||
rv, err := storage.ParseWatchResourceVersion(fooCreated.ResourceVersion)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
cacher := newTestCacher(etcdStorage, 10)
|
||||
defer cacher.Stop()
|
||||
|
||||
// We now have a cacher with an empty cache of watch events and a resourceVersion of rv.
|
||||
// It should support establishing watches from rv and higher, but not older.
|
||||
|
||||
{
|
||||
watcher, err := cacher.Watch(context.TODO(), "pods/ns", strconv.Itoa(int(rv-1)), storage.Everything)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
defer watcher.Stop()
|
||||
expectedGoneError := errors.NewGone("").ErrStatus
|
||||
verifyWatchEvent(t, watcher, watch.Error, &expectedGoneError)
|
||||
}
|
||||
|
||||
{
|
||||
watcher, err := cacher.Watch(context.TODO(), "pods/ns", strconv.Itoa(int(rv+1)), storage.Everything)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
defer watcher.Stop()
|
||||
select {
|
||||
case e := <-watcher.ResultChan():
|
||||
t.Errorf("unexpected event %#v", e)
|
||||
case <-time.After(3 * time.Second):
|
||||
// watch from rv+1 remained established successfully
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
watcher, err := cacher.Watch(context.TODO(), "pods/ns", strconv.Itoa(int(rv)), storage.Everything)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
defer watcher.Stop()
|
||||
select {
|
||||
case e := <-watcher.ResultChan():
|
||||
t.Errorf("unexpected event %#v", e)
|
||||
case <-time.After(3 * time.Second):
|
||||
// watch from rv remained established successfully
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRandomWatchDeliver(t *testing.T) {
|
||||
server, etcdStorage := newEtcdTestStorage(t, etcdtest.PathPrefix())
|
||||
defer server.Terminate(t)
|
||||
|
||||
4
vendor/k8s.io/apiserver/pkg/storage/watch_cache.go
generated
vendored
4
vendor/k8s.io/apiserver/pkg/storage/watch_cache.go
generated
vendored
@@ -412,7 +412,9 @@ func (w *watchCache) SetOnEvent(onEvent func(*watchCacheEvent)) {
|
||||
|
||||
func (w *watchCache) GetAllEventsSinceThreadUnsafe(resourceVersion uint64) ([]*watchCacheEvent, error) {
|
||||
size := w.endIndex - w.startIndex
|
||||
oldest := w.resourceVersion
|
||||
// if we have no watch events in our cache, the oldest one we can successfully deliver to a watcher
|
||||
// is the *next* event we'll receive, which will be at least one greater than our current resourceVersion
|
||||
oldest := w.resourceVersion + 1
|
||||
if size > 0 {
|
||||
oldest = w.cache[w.startIndex%w.capacity].resourceVersion
|
||||
}
|
||||
|
||||
2
vendor/k8s.io/apiserver/pkg/util/flag/flags.go
generated
vendored
2
vendor/k8s.io/apiserver/pkg/util/flag/flags.go
generated
vendored
@@ -49,6 +49,6 @@ func InitFlags() {
|
||||
pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
|
||||
pflag.Parse()
|
||||
pflag.VisitAll(func(flag *pflag.Flag) {
|
||||
glog.Infof("FLAG: --%s=%q", flag.Name, flag.Value)
|
||||
glog.V(4).Infof("FLAG: --%s=%q", flag.Name, flag.Value)
|
||||
})
|
||||
}
|
||||
|
||||
3
vendor/k8s.io/apiserver/pkg/util/proxy/dial.go
generated
vendored
3
vendor/k8s.io/apiserver/pkg/util/proxy/dial.go
generated
vendored
@@ -94,6 +94,9 @@ func DialURL(url *url.URL, transport http.RoundTripper) (net.Conn, error) {
|
||||
|
||||
// Verify
|
||||
host, _, _ := net.SplitHostPort(dialAddr)
|
||||
if tlsConfig != nil && len(tlsConfig.ServerName) > 0 {
|
||||
host = tlsConfig.ServerName
|
||||
}
|
||||
if err := tlsConn.VerifyHostname(host); err != nil {
|
||||
tlsConn.Close()
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user