fix register.go files up + add test import

This commit is contained in:
Daniel Smith
2016-05-12 17:07:50 -07:00
parent caed8d85f4
commit f1fd638962
81 changed files with 714 additions and 483 deletions

View File

@@ -27,18 +27,17 @@ import (
"k8s.io/kubernetes/pkg/runtime"
)
func addConversionFuncs(scheme *runtime.Scheme) {
func addConversionFuncs(scheme *runtime.Scheme) error {
// Add non-generated conversion functions
err := scheme.AddConversionFuncs(
Convert_batch_JobSpec_To_v1_JobSpec,
Convert_v1_JobSpec_To_batch_JobSpec,
)
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
return err
}
err = api.Scheme.AddFieldLabelConversionFunc("batch/v1", "Job",
return api.Scheme.AddFieldLabelConversionFunc("batch/v1", "Job",
func(label, value string) (string, string, error) {
switch label {
case "metadata.name", "metadata.namespace", "status.successful":
@@ -46,11 +45,8 @@ func addConversionFuncs(scheme *runtime.Scheme) {
default:
return "", "", fmt.Errorf("field label not supported: %s", label)
}
})
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
},
)
}
func Convert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error {