Commit 896c670f authored by Mike Danese's avatar Mike Danese

conversion: add default conversion for {string,bool} ptr to {string,bool}

This is useful because it allows defaulting to infer wheter a string,bool value was provided by the user while still having the field represented as a non pointer type in the internal representation.
parent 5275c942
...@@ -43,12 +43,54 @@ func init() { ...@@ -43,12 +43,54 @@ func init() {
Convert_unversioned_Time_To_unversioned_Time, Convert_unversioned_Time_To_unversioned_Time,
Convert_string_To_labels_Selector, Convert_string_To_labels_Selector,
Convert_string_To_fields_Selector, Convert_string_To_fields_Selector,
Convert_bool_ref_To_bool,
Convert_bool_To_bool_ref,
Convert_string_ref_To_string,
Convert_string_To_string_ref,
Convert_labels_Selector_To_string, Convert_labels_Selector_To_string,
Convert_fields_Selector_To_string, Convert_fields_Selector_To_string,
Convert_resource_Quantity_To_resource_Quantity, Convert_resource_Quantity_To_resource_Quantity,
) )
} }
func Convert_string_ref_To_string(in **string, out *string, s conversion.Scope) error {
if *in == nil {
*out = ""
return nil
}
*out = **in
return nil
}
func Convert_string_To_string_ref(in *string, out **string, s conversion.Scope) error {
if in == nil {
stringVar := ""
*out = &stringVar
return nil
}
*out = in
return nil
}
func Convert_bool_ref_To_bool(in **bool, out *bool, s conversion.Scope) error {
if *in == nil {
*out = false
return nil
}
*out = **in
return nil
}
func Convert_bool_To_bool_ref(in *bool, out **bool, s conversion.Scope) error {
if in == nil {
boolVar := false
*out = &boolVar
return nil
}
*out = in
return nil
}
func Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(in, out *unversioned.TypeMeta, s conversion.Scope) error { func Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(in, out *unversioned.TypeMeta, s conversion.Scope) error {
// These values are explicitly not copied // These values are explicitly not copied
//out.APIVersion = in.APIVersion //out.APIVersion = in.APIVersion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment