Remove vestiges of defaulting from conversion path, switch to top-level default registration only

This commit is contained in:
Jordan Liggitt
2017-03-10 16:03:07 -05:00
parent 06cdb02fca
commit ad116026d9
72 changed files with 273 additions and 318 deletions

View File

@@ -207,12 +207,17 @@ func TestResourceListConversion(t *testing.T) {
for i, test := range tests {
output := api.ResourceList{}
// defaulting is a separate step from conversion that is applied when reading from the API or from etcd.
// perform that step explicitly.
v1.SetDefaults_ResourceList(&test.input)
err := api.Scheme.Convert(&test.input, &output, nil)
if err != nil {
t.Fatalf("unexpected error for case %d: %v", i, err)
}
if !apiequality.Semantic.DeepEqual(test.expected, output) {
t.Errorf("unexpected conversion for case %d: Expected %+v; Got %+v", i, test.expected, output)
t.Errorf("unexpected conversion for case %d: Expected\n%+v;\nGot\n%+v", i, test.expected, output)
}
}
}