Add new Event type

* replaces previous Event type, which is too limited.
* Remove writing of old event type.
* Fix serialiazation test to automatically test all types.
This commit is contained in:
Daniel Smith
2014-09-24 14:35:34 -07:00
parent 9564dacf6c
commit 283eaf3931
10 changed files with 204 additions and 129 deletions

View File

@@ -147,25 +147,14 @@ func runTest(t *testing.T, codec runtime.Codec, source runtime.Object) {
}
func TestTypes(t *testing.T) {
table := []runtime.Object{
&api.PodList{},
&api.Pod{},
&api.ServiceList{},
&api.Service{},
&api.ReplicationControllerList{},
&api.ReplicationController{},
&api.MinionList{},
&api.Minion{},
&api.Status{},
&api.ServerOpList{},
&api.ServerOp{},
&api.ContainerManifestList{},
&api.Endpoints{},
&api.Binding{},
}
for _, item := range table {
for kind := range api.Scheme.KnownTypes("") {
// Try a few times, since runTest uses random values.
for i := 0; i < *fuzzIters; i++ {
item, err := api.Scheme.New("", kind)
if err != nil {
t.Errorf("Couldn't make a %v? %v", kind, err)
continue
}
runTest(t, v1beta1.Codec, item)
runTest(t, v1beta2.Codec, item)
runTest(t, api.Codec, item)