mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
fix register.go files up + add test import
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user