stop duplicating preferred version order

This commit is contained in:
David Eads
2018-04-26 09:38:43 -04:00
parent b8ab2891b3
commit a89291a5de
65 changed files with 178 additions and 222 deletions

View File

@@ -53,7 +53,7 @@ func TestCodec(t *testing.T) {
pod := internal.Pod{}
// We do want to use package registered rather than testapi here, because we
// want to test if the package install and package registered work as expected.
data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.GroupOrDie(internal.GroupName).GroupVersion), &pod)
data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.GroupOrDie(internal.GroupName).GroupVersions[0]), &pod)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
@@ -61,7 +61,7 @@ func TestCodec(t *testing.T) {
if err := json.Unmarshal(data, &other); err != nil {
t.Fatalf("unexpected error: %v", err)
}
if other.APIVersion != legacyscheme.Registry.GroupOrDie(internal.GroupName).GroupVersion.Version || other.Kind != "Pod" {
if other.APIVersion != legacyscheme.Registry.GroupOrDie(internal.GroupName).GroupVersions[0].Version || other.Kind != "Pod" {
t.Errorf("unexpected unmarshalled object %#v", other)
}
}