@@ -31,40 +31,16 @@ import (
31
31
)
32
32
33
33
func addConversionFuncs (scheme * runtime.Scheme ) error {
34
- // Add non-generated conversion functions to handle the *int32 -> int32
35
- // conversion. A pointer is useful in the versioned type so we can default
36
- // it, but a plain int32 is more convenient in the internal type. These
37
- // functions are the same as the autogenerated ones in every other way.
38
- err := scheme .AddConversionFuncs (
39
- Convert_v1beta2_Deployment_To_apps_Deployment ,
40
- Convert_apps_Deployment_To_v1beta2_Deployment ,
41
- Convert_apps_DaemonSet_To_v1beta2_DaemonSet ,
42
- Convert_v1beta2_DaemonSet_To_apps_DaemonSet ,
43
- Convert_apps_DaemonSetSpec_To_v1beta2_DaemonSetSpec ,
44
- Convert_v1beta2_DaemonSetSpec_To_apps_DaemonSetSpec ,
45
- // extensions
46
- // TODO: below conversions should be dropped in favor of auto-generated
47
- // ones, see https://github.com/kubernetes/kubernetes/issues/39865
48
- Convert_v1beta2_ScaleStatus_To_autoscaling_ScaleStatus ,
49
- Convert_autoscaling_ScaleStatus_To_v1beta2_ScaleStatus ,
50
- Convert_v1beta2_DeploymentSpec_To_apps_DeploymentSpec ,
51
- Convert_apps_DeploymentSpec_To_v1beta2_DeploymentSpec ,
52
- )
53
- if err != nil {
54
- return err
55
- }
56
-
57
34
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
58
- err = scheme .AddFieldLabelConversionFunc (SchemeGroupVersion .WithKind ("StatefulSet" ),
35
+ if err : = scheme .AddFieldLabelConversionFunc (SchemeGroupVersion .WithKind ("StatefulSet" ),
59
36
func (label , value string ) (string , string , error ) {
60
37
switch label {
61
38
case "metadata.name" , "metadata.namespace" , "status.successful" :
62
39
return label , value , nil
63
40
default :
64
41
return "" , "" , fmt .Errorf ("field label not supported for appsv1beta2.StatefulSet: %s" , label )
65
42
}
66
- })
67
- if err != nil {
43
+ }); err != nil {
68
44
return err
69
45
}
70
46
0 commit comments