Set up new "metrics" API group.

This commit only adds 2 placeholder structs to the API, for the purposes
of separating the API group setup from the API discussion.
This commit is contained in:
Tim St. Clair
2015-10-30 14:23:53 -07:00
parent 17e36b02f4
commit 5cd5b80f9e
21 changed files with 1384 additions and 23 deletions

View File

@@ -25,6 +25,7 @@ import (
"k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
_ "k8s.io/kubernetes/pkg/apis/metrics/install"
"k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/meta"
@@ -90,21 +91,11 @@ func (g TestGroup) GroupAndVersion() string {
// KUBE_TEST_API env var.
func (g TestGroup) Codec() runtime.Codec {
// TODO: caesarxuchao: Restructure the body once we have a central `latest`.
if g.Group == "" {
interfaces, err := latest.GroupOrDie("").InterfacesFor(g.GroupVersionUnderTest)
if err != nil {
panic(err)
}
return interfaces.Codec
interfaces, err := latest.GroupOrDie(g.Group).InterfacesFor(g.GroupVersionUnderTest)
if err != nil {
panic(err)
}
if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.GroupVersionUnderTest)
if err != nil {
panic(err)
}
return interfaces.Codec
}
panic(fmt.Errorf("cannot test group %s", g.Group))
return interfaces.Codec
}
// Converter returns the api.Scheme for the API version to test against, as set by the