Code change:
<ins> /* Copyright 2019 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 runtime import ( "testing" "k8s.io/apimachinery/pkg/runtime/schema" ) func gv(group, version string) schema.GroupVersion { return schema.GroupVersion{Group: group, Version: version} } func gvk(group, version, kind string) schema.GroupVersionKind { return schema.GroupVersionKind{Group: group, Version: version, Kind: kind} } func gk(group, kind string) schema.GroupKind { return schema.GroupKind{Group: group, Kind: kind} } func TestCoercingMultiGroupVersioner(t *testing.T) { testcases := []struct { name           string target         schema.GroupVersion preferredKinds []schema.GroupKind kinds          []schema.GroupVersionKind expectKind     schema.GroupVersionKind }{ { name:           "matched preferred group/kind", target:         gv("mygroup", "__internal"), preferredKinds: []schema.GroupKind{gk("mygroup", "Foo"), gk("anothergroup", "Bar")}, kinds:          []schema.GroupVersionKind{gvk("yetanother", "v1", "Baz"), gvk("anothergroup", "v1", "Bar")}, expectKind:     gvk("mygroup", "__internal", "Bar"), }, { name:           "matched preferred group", target:         gv("mygroup", "__internal"), preferredKinds: []schema.GroupKind{gk("mygroup", ""), gk("anothergroup", "")}, kinds:          []schema.GroupVersionKind{gvk("yetanother", "v1", "Baz"), gvk("anothergroup", "v1", "Bar")}, expectKind:     gvk("mygroup", "__internal", "Bar"), }, { name:           "no preferred group/kind match, uses first kind in list", target:         gv("mygroup", "__internal"), preferredKinds: []schema.GroupKind{gk("mygroup", ""), gk("anothergroup", "")}, kinds:          []schema.GroupVersionKind{gvk("yetanother", "v1", "Baz"), gvk("yetanother", "v1", "Bar")}, expectKind:     gvk("mygroup", "__internal", "Baz"), }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { v := NewCoercingMultiGroupVersioner(tc.target, tc.preferredKinds...) kind, ok := v.KindForGroupVersionKinds(tc.kinds) if !ok { t.Error("got no kind") } if kind != tc.expectKind { t.Errorf("expected %#v, got %#v", tc.expectKind, kind) } }) } } </ins>

Related discussion:
text: What happened: Set up a HA cluster with 1.9 and 1.10 API servers (occurs on any apiserver skew boundary where a cohabitating resource's storage version changed groups) Observed errors when modifying workload objects: when modified via the 1.10 server, saw this error in the 1.9 server: when modified via the 1.9 server, saw this error in the 1.10 server: When this error was encountered, all watchers for the resource in question would be dropped and have to re-establish, and the internal watchers feeding the watch cache would drop and re-establish What you expected to happen: Watch events from all supported storage versions are processed correctly How to reproduce it (as minimally and precisely as possible): Start a server from master (for inspectability, store in json). With Create a deployment (e.g. kube-dns in kube-system) Establish a watch via extensions (kubectl get deployments.extensions --all-namespaces -w) Establish a watch via apps (kubectl get --all-namespaces -w) Tail the kube-apiserver log Change the apps/v1 deployment in etcd to extensions/v1beta1: Observer client watches drop and server log errors: Anything else we need to know?: Environment: Kubernetes version (use ): Cloud provider or hardware configuration: OS (e.g. from /etc/os-release): Kernel (e.g. ): Install tools: Others: /sig api-machinery /cc /priority critical-urgent
error is triggered by this returning false: constructed here: the info about expected cohabitating groups is not included in the list of acceptable inputs