| 1 |
//go:build !ignore_autogenerated |
| 2 |
// +build !ignore_autogenerated |
| 3 |
|
| 4 |
/* |
| 5 |
Copyright The Kubernetes Authors. |
| 6 |
|
| 7 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 |
you may not use this file except in compliance with the License. |
| 9 |
You may obtain a copy of the License at |
| 10 |
|
| 11 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
|
| 13 |
Unless required by applicable law or agreed to in writing, software |
| 14 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
See the License for the specific language governing permissions and |
| 17 |
limitations under the License. |
| 18 |
*/ |
| 19 |
|
| 20 |
// Code generated by conversion-gen. DO NOT EDIT. |
| 21 |
|
| 22 |
package v1beta2 |
| 23 |
|
| 24 |
import ( |
| 25 |
unsafe "unsafe" |
| 26 |
|
| 27 |
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 28 |
conversion "k8s.io/apimachinery/pkg/conversion" |
| 29 |
runtime "k8s.io/apimachinery/pkg/runtime" |
| 30 |
custommetrics "k8s.io/metrics/pkg/apis/custom_metrics" |
| 31 |
) |
| 32 |
|
| 33 |
func init() { |
| 34 |
localSchemeBuilder.Register(RegisterConversions) |
| 35 |
} |
| 36 |
|
| 37 |
// RegisterConversions adds conversion functions to the given scheme. |
| 38 |
// Public to allow building arbitrary schemes. |
| 39 |
func RegisterConversions(s *runtime.Scheme) error { |
| 40 |
if err := s.AddGeneratedConversionFunc((*MetricIdentifier)(nil), (*custommetrics.MetricIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 41 |
return Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(a.(*MetricIdentifier), b.(*custommetrics.MetricIdentifier), scope) |
| 42 |
}); err != nil { |
| 43 |
return err |
| 44 |
} |
| 45 |
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricIdentifier)(nil), (*MetricIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 46 |
return Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(a.(*custommetrics.MetricIdentifier), b.(*MetricIdentifier), scope) |
| 47 |
}); err != nil { |
| 48 |
return err |
| 49 |
} |
| 50 |
if err := s.AddGeneratedConversionFunc((*MetricListOptions)(nil), (*custommetrics.MetricListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 51 |
return Convert_v1beta2_MetricListOptions_To_custom_metrics_MetricListOptions(a.(*MetricListOptions), b.(*custommetrics.MetricListOptions), scope) |
| 52 |
}); err != nil { |
| 53 |
return err |
| 54 |
} |
| 55 |
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricListOptions)(nil), (*MetricListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 56 |
return Convert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(a.(*custommetrics.MetricListOptions), b.(*MetricListOptions), scope) |
| 57 |
}); err != nil { |
| 58 |
return err |
| 59 |
} |
| 60 |
if err := s.AddGeneratedConversionFunc((*MetricValue)(nil), (*custommetrics.MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 61 |
return Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(a.(*MetricValue), b.(*custommetrics.MetricValue), scope) |
| 62 |
}); err != nil { |
| 63 |
return err |
| 64 |
} |
| 65 |
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricValue)(nil), (*MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 66 |
return Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(a.(*custommetrics.MetricValue), b.(*MetricValue), scope) |
| 67 |
}); err != nil { |
| 68 |
return err |
| 69 |
} |
| 70 |
if err := s.AddGeneratedConversionFunc((*MetricValueList)(nil), (*custommetrics.MetricValueList)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 71 |
return Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(a.(*MetricValueList), b.(*custommetrics.MetricValueList), scope) |
| 72 |
}); err != nil { |
| 73 |
return err |
| 74 |
} |
| 75 |
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricValueList)(nil), (*MetricValueList)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 76 |
return Convert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(a.(*custommetrics.MetricValueList), b.(*MetricValueList), scope) |
| 77 |
}); err != nil { |
| 78 |
return err |
| 79 |
} |
| 80 |
return nil |
| 81 |
} |
| 82 |
|
| 83 |
func autoConvert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(in *MetricIdentifier, out *custommetrics.MetricIdentifier, s conversion.Scope) error { |
| 84 |
out.Name = in.Name |
| 85 |
out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) |
| 86 |
return nil |
| 87 |
} |
| 88 |
|
| 89 |
// Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier is an autogenerated conversion function. |
| 90 |
func Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(in *MetricIdentifier, out *custommetrics.MetricIdentifier, s conversion.Scope) error { |
| 91 |
return autoConvert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(in, out, s) |
| 92 |
} |
| 93 |
|
| 94 |
func autoConvert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(in *custommetrics.MetricIdentifier, out *MetricIdentifier, s conversion.Scope) error { |
| 95 |
out.Name = in.Name |
| 96 |
out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) |
| 97 |
return nil |
| 98 |
} |
| 99 |
|
| 100 |
// Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier is an autogenerated conversion function. |
| 101 |
func Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(in *custommetrics.MetricIdentifier, out *MetricIdentifier, s conversion.Scope) error { |
| 102 |
return autoConvert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(in, out, s) |
| 103 |
} |
| 104 |
|
| 105 |
func autoConvert_v1beta2_MetricListOptions_To_custom_metrics_MetricListOptions(in *MetricListOptions, out *custommetrics.MetricListOptions, s conversion.Scope) error { |
| 106 |
out.LabelSelector = in.LabelSelector |
| 107 |
out.MetricLabelSelector = in.MetricLabelSelector |
| 108 |
return nil |
| 109 |
} |
| 110 |
|
| 111 |
// Convert_v1beta2_MetricListOptions_To_custom_metrics_MetricListOptions is an autogenerated conversion function. |
| 112 |
func Convert_v1beta2_MetricListOptions_To_custom_metrics_MetricListOptions(in *MetricListOptions, out *custommetrics.MetricListOptions, s conversion.Scope) error { |
| 113 |
return autoConvert_v1beta2_MetricListOptions_To_custom_metrics_MetricListOptions(in, out, s) |
| 114 |
} |
| 115 |
|
| 116 |
func autoConvert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in *custommetrics.MetricListOptions, out *MetricListOptions, s conversion.Scope) error { |
| 117 |
out.LabelSelector = in.LabelSelector |
| 118 |
out.MetricLabelSelector = in.MetricLabelSelector |
| 119 |
return nil |
| 120 |
} |
| 121 |
|
| 122 |
// Convert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions is an autogenerated conversion function. |
| 123 |
func Convert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in *custommetrics.MetricListOptions, out *MetricListOptions, s conversion.Scope) error { |
| 124 |
return autoConvert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in, out, s) |
| 125 |
} |
| 126 |
|
| 127 |
func autoConvert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error { |
| 128 |
if err := custommetrics.Convert_v1_ObjectReference_To_custom_metrics_ObjectReference(&in.DescribedObject, &out.DescribedObject, s); err != nil { |
| 129 |
return err |
| 130 |
} |
| 131 |
if err := Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil { |
| 132 |
return err |
| 133 |
} |
| 134 |
out.Timestamp = in.Timestamp |
| 135 |
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds)) |
| 136 |
out.Value = in.Value |
| 137 |
return nil |
| 138 |
} |
| 139 |
|
| 140 |
// Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue is an autogenerated conversion function. |
| 141 |
func Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error { |
| 142 |
return autoConvert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in, out, s) |
| 143 |
} |
| 144 |
|
| 145 |
func autoConvert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error { |
| 146 |
if err := custommetrics.Convert_custom_metrics_ObjectReference_To_v1_ObjectReference(&in.DescribedObject, &out.DescribedObject, s); err != nil { |
| 147 |
return err |
| 148 |
} |
| 149 |
if err := Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil { |
| 150 |
return err |
| 151 |
} |
| 152 |
out.Timestamp = in.Timestamp |
| 153 |
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds)) |
| 154 |
out.Value = in.Value |
| 155 |
return nil |
| 156 |
} |
| 157 |
|
| 158 |
// Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue is an autogenerated conversion function. |
| 159 |
func Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error { |
| 160 |
return autoConvert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in, out, s) |
| 161 |
} |
| 162 |
|
| 163 |
func autoConvert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error { |
| 164 |
out.ListMeta = in.ListMeta |
| 165 |
if in.Items != nil { |
| 166 |
in, out := &in.Items, &out.Items |
| 167 |
*out = make([]custommetrics.MetricValue, len(*in)) |
| 168 |
for i := range *in { |
| 169 |
if err := Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(&(*in)[i], &(*out)[i], s); err != nil { |
| 170 |
return err |
| 171 |
} |
| 172 |
} |
| 173 |
} else { |
| 174 |
out.Items = nil |
| 175 |
} |
| 176 |
return nil |
| 177 |
} |
| 178 |
|
| 179 |
// Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList is an autogenerated conversion function. |
| 180 |
func Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error { |
| 181 |
return autoConvert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in, out, s) |
| 182 |
} |
| 183 |
|
| 184 |
func autoConvert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error { |
| 185 |
out.ListMeta = in.ListMeta |
| 186 |
if in.Items != nil { |
| 187 |
in, out := &in.Items, &out.Items |
| 188 |
*out = make([]MetricValue, len(*in)) |
| 189 |
for i := range *in { |
| 190 |
if err := Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(&(*in)[i], &(*out)[i], s); err != nil { |
| 191 |
return err |
| 192 |
} |
| 193 |
} |
| 194 |
} else { |
| 195 |
out.Items = nil |
| 196 |
} |
| 197 |
return nil |
| 198 |
} |
| 199 |
|
| 200 |
// Convert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList is an autogenerated conversion function. |
| 201 |
func Convert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error { |
| 202 |
return autoConvert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in, out, s) |
| 203 |
} |