| 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 v1 |
| 23 |
|
| 24 |
import ( |
| 25 |
unsafe "unsafe" |
| 26 |
|
| 27 |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 28 |
conversion "k8s.io/apimachinery/pkg/conversion" |
| 29 |
runtime "k8s.io/apimachinery/pkg/runtime" |
| 30 |
example "k8s.io/apiserver/pkg/apis/example" |
| 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((*Pod)(nil), (*example.Pod)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 41 |
return Convert_v1_Pod_To_example_Pod(a.(*Pod), b.(*example.Pod), scope) |
| 42 |
}); err != nil { |
| 43 |
return err |
| 44 |
} |
| 45 |
if err := s.AddGeneratedConversionFunc((*example.Pod)(nil), (*Pod)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 46 |
return Convert_example_Pod_To_v1_Pod(a.(*example.Pod), b.(*Pod), scope) |
| 47 |
}); err != nil { |
| 48 |
return err |
| 49 |
} |
| 50 |
if err := s.AddGeneratedConversionFunc((*PodCondition)(nil), (*example.PodCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 51 |
return Convert_v1_PodCondition_To_example_PodCondition(a.(*PodCondition), b.(*example.PodCondition), scope) |
| 52 |
}); err != nil { |
| 53 |
return err |
| 54 |
} |
| 55 |
if err := s.AddGeneratedConversionFunc((*example.PodCondition)(nil), (*PodCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 56 |
return Convert_example_PodCondition_To_v1_PodCondition(a.(*example.PodCondition), b.(*PodCondition), scope) |
| 57 |
}); err != nil { |
| 58 |
return err |
| 59 |
} |
| 60 |
if err := s.AddGeneratedConversionFunc((*PodList)(nil), (*example.PodList)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 61 |
return Convert_v1_PodList_To_example_PodList(a.(*PodList), b.(*example.PodList), scope) |
| 62 |
}); err != nil { |
| 63 |
return err |
| 64 |
} |
| 65 |
if err := s.AddGeneratedConversionFunc((*example.PodList)(nil), (*PodList)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 66 |
return Convert_example_PodList_To_v1_PodList(a.(*example.PodList), b.(*PodList), scope) |
| 67 |
}); err != nil { |
| 68 |
return err |
| 69 |
} |
| 70 |
if err := s.AddGeneratedConversionFunc((*PodSpec)(nil), (*example.PodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 71 |
return Convert_v1_PodSpec_To_example_PodSpec(a.(*PodSpec), b.(*example.PodSpec), scope) |
| 72 |
}); err != nil { |
| 73 |
return err |
| 74 |
} |
| 75 |
if err := s.AddGeneratedConversionFunc((*example.PodSpec)(nil), (*PodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 76 |
return Convert_example_PodSpec_To_v1_PodSpec(a.(*example.PodSpec), b.(*PodSpec), scope) |
| 77 |
}); err != nil { |
| 78 |
return err |
| 79 |
} |
| 80 |
if err := s.AddGeneratedConversionFunc((*PodStatus)(nil), (*example.PodStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 81 |
return Convert_v1_PodStatus_To_example_PodStatus(a.(*PodStatus), b.(*example.PodStatus), scope) |
| 82 |
}); err != nil { |
| 83 |
return err |
| 84 |
} |
| 85 |
if err := s.AddGeneratedConversionFunc((*example.PodStatus)(nil), (*PodStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { |
| 86 |
return Convert_example_PodStatus_To_v1_PodStatus(a.(*example.PodStatus), b.(*PodStatus), scope) |
| 87 |
}); err != nil { |
| 88 |
return err |
| 89 |
} |
| 90 |
return nil |
| 91 |
} |
| 92 |
|
| 93 |
func autoConvert_v1_Pod_To_example_Pod(in *Pod, out *example.Pod, s conversion.Scope) error { |
| 94 |
out.ObjectMeta = in.ObjectMeta |
| 95 |
if err := Convert_v1_PodSpec_To_example_PodSpec(&in.Spec, &out.Spec, s); err != nil { |
| 96 |
return err |
| 97 |
} |
| 98 |
if err := Convert_v1_PodStatus_To_example_PodStatus(&in.Status, &out.Status, s); err != nil { |
| 99 |
return err |
| 100 |
} |
| 101 |
return nil |
| 102 |
} |
| 103 |
|
| 104 |
// Convert_v1_Pod_To_example_Pod is an autogenerated conversion function. |
| 105 |
func Convert_v1_Pod_To_example_Pod(in *Pod, out *example.Pod, s conversion.Scope) error { |
| 106 |
return autoConvert_v1_Pod_To_example_Pod(in, out, s) |
| 107 |
} |
| 108 |
|
| 109 |
func autoConvert_example_Pod_To_v1_Pod(in *example.Pod, out *Pod, s conversion.Scope) error { |
| 110 |
out.ObjectMeta = in.ObjectMeta |
| 111 |
if err := Convert_example_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil { |
| 112 |
return err |
| 113 |
} |
| 114 |
if err := Convert_example_PodStatus_To_v1_PodStatus(&in.Status, &out.Status, s); err != nil { |
| 115 |
return err |
| 116 |
} |
| 117 |
return nil |
| 118 |
} |
| 119 |
|
| 120 |
// Convert_example_Pod_To_v1_Pod is an autogenerated conversion function. |
| 121 |
func Convert_example_Pod_To_v1_Pod(in *example.Pod, out *Pod, s conversion.Scope) error { |
| 122 |
return autoConvert_example_Pod_To_v1_Pod(in, out, s) |
| 123 |
} |
| 124 |
|
| 125 |
func autoConvert_v1_PodCondition_To_example_PodCondition(in *PodCondition, out *example.PodCondition, s conversion.Scope) error { |
| 126 |
out.Type = example.PodConditionType(in.Type) |
| 127 |
out.Status = example.ConditionStatus(in.Status) |
| 128 |
out.LastProbeTime = in.LastProbeTime |
| 129 |
out.LastTransitionTime = in.LastTransitionTime |
| 130 |
out.Reason = in.Reason |
| 131 |
out.Message = in.Message |
| 132 |
return nil |
| 133 |
} |
| 134 |
|
| 135 |
// Convert_v1_PodCondition_To_example_PodCondition is an autogenerated conversion function. |
| 136 |
func Convert_v1_PodCondition_To_example_PodCondition(in *PodCondition, out *example.PodCondition, s conversion.Scope) error { |
| 137 |
return autoConvert_v1_PodCondition_To_example_PodCondition(in, out, s) |
| 138 |
} |
| 139 |
|
| 140 |
func autoConvert_example_PodCondition_To_v1_PodCondition(in *example.PodCondition, out *PodCondition, s conversion.Scope) error { |
| 141 |
out.Type = PodConditionType(in.Type) |
| 142 |
out.Status = ConditionStatus(in.Status) |
| 143 |
out.LastProbeTime = in.LastProbeTime |
| 144 |
out.LastTransitionTime = in.LastTransitionTime |
| 145 |
out.Reason = in.Reason |
| 146 |
out.Message = in.Message |
| 147 |
return nil |
| 148 |
} |
| 149 |
|
| 150 |
// Convert_example_PodCondition_To_v1_PodCondition is an autogenerated conversion function. |
| 151 |
func Convert_example_PodCondition_To_v1_PodCondition(in *example.PodCondition, out *PodCondition, s conversion.Scope) error { |
| 152 |
return autoConvert_example_PodCondition_To_v1_PodCondition(in, out, s) |
| 153 |
} |
| 154 |
|
| 155 |
func autoConvert_v1_PodList_To_example_PodList(in *PodList, out *example.PodList, s conversion.Scope) error { |
| 156 |
out.ListMeta = in.ListMeta |
| 157 |
if in.Items != nil { |
| 158 |
in, out := &in.Items, &out.Items |
| 159 |
*out = make([]example.Pod, len(*in)) |
| 160 |
for i := range *in { |
| 161 |
if err := Convert_v1_Pod_To_example_Pod(&(*in)[i], &(*out)[i], s); err != nil { |
| 162 |
return err |
| 163 |
} |
| 164 |
} |
| 165 |
} else { |
| 166 |
out.Items = nil |
| 167 |
} |
| 168 |
return nil |
| 169 |
} |
| 170 |
|
| 171 |
// Convert_v1_PodList_To_example_PodList is an autogenerated conversion function. |
| 172 |
func Convert_v1_PodList_To_example_PodList(in *PodList, out *example.PodList, s conversion.Scope) error { |
| 173 |
return autoConvert_v1_PodList_To_example_PodList(in, out, s) |
| 174 |
} |
| 175 |
|
| 176 |
func autoConvert_example_PodList_To_v1_PodList(in *example.PodList, out *PodList, s conversion.Scope) error { |
| 177 |
out.ListMeta = in.ListMeta |
| 178 |
if in.Items != nil { |
| 179 |
in, out := &in.Items, &out.Items |
| 180 |
*out = make([]Pod, len(*in)) |
| 181 |
for i := range *in { |
| 182 |
if err := Convert_example_Pod_To_v1_Pod(&(*in)[i], &(*out)[i], s); err != nil { |
| 183 |
return err |
| 184 |
} |
| 185 |
} |
| 186 |
} else { |
| 187 |
out.Items = nil |
| 188 |
} |
| 189 |
return nil |
| 190 |
} |
| 191 |
|
| 192 |
// Convert_example_PodList_To_v1_PodList is an autogenerated conversion function. |
| 193 |
func Convert_example_PodList_To_v1_PodList(in *example.PodList, out *PodList, s conversion.Scope) error { |
| 194 |
return autoConvert_example_PodList_To_v1_PodList(in, out, s) |
| 195 |
} |
| 196 |
|
| 197 |
func autoConvert_v1_PodSpec_To_example_PodSpec(in *PodSpec, out *example.PodSpec, s conversion.Scope) error { |
| 198 |
out.RestartPolicy = example.RestartPolicy(in.RestartPolicy) |
| 199 |
out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) |
| 200 |
out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) |
| 201 |
out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) |
| 202 |
out.ServiceAccountName = in.ServiceAccountName |
| 203 |
// INFO: in.DeprecatedServiceAccount opted out of conversion generation |
| 204 |
out.NodeName = in.NodeName |
| 205 |
// INFO: in.HostNetwork opted out of conversion generation |
| 206 |
// INFO: in.HostPID opted out of conversion generation |
| 207 |
// INFO: in.HostIPC opted out of conversion generation |
| 208 |
out.Hostname = in.Hostname |
| 209 |
out.Subdomain = in.Subdomain |
| 210 |
out.SchedulerName = in.SchedulerName |
| 211 |
return nil |
| 212 |
} |
| 213 |
|
| 214 |
// Convert_v1_PodSpec_To_example_PodSpec is an autogenerated conversion function. |
| 215 |
func Convert_v1_PodSpec_To_example_PodSpec(in *PodSpec, out *example.PodSpec, s conversion.Scope) error { |
| 216 |
return autoConvert_v1_PodSpec_To_example_PodSpec(in, out, s) |
| 217 |
} |
| 218 |
|
| 219 |
func autoConvert_example_PodSpec_To_v1_PodSpec(in *example.PodSpec, out *PodSpec, s conversion.Scope) error { |
| 220 |
out.RestartPolicy = RestartPolicy(in.RestartPolicy) |
| 221 |
out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) |
| 222 |
out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) |
| 223 |
out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) |
| 224 |
out.ServiceAccountName = in.ServiceAccountName |
| 225 |
out.NodeName = in.NodeName |
| 226 |
out.Hostname = in.Hostname |
| 227 |
out.Subdomain = in.Subdomain |
| 228 |
out.SchedulerName = in.SchedulerName |
| 229 |
return nil |
| 230 |
} |
| 231 |
|
| 232 |
// Convert_example_PodSpec_To_v1_PodSpec is an autogenerated conversion function. |
| 233 |
func Convert_example_PodSpec_To_v1_PodSpec(in *example.PodSpec, out *PodSpec, s conversion.Scope) error { |
| 234 |
return autoConvert_example_PodSpec_To_v1_PodSpec(in, out, s) |
| 235 |
} |
| 236 |
|
| 237 |
func autoConvert_v1_PodStatus_To_example_PodStatus(in *PodStatus, out *example.PodStatus, s conversion.Scope) error { |
| 238 |
out.Phase = example.PodPhase(in.Phase) |
| 239 |
out.Conditions = *(*[]example.PodCondition)(unsafe.Pointer(&in.Conditions)) |
| 240 |
out.Message = in.Message |
| 241 |
out.Reason = in.Reason |
| 242 |
out.HostIP = in.HostIP |
| 243 |
out.PodIP = in.PodIP |
| 244 |
out.StartTime = (*metav1.Time)(unsafe.Pointer(in.StartTime)) |
| 245 |
return nil |
| 246 |
} |
| 247 |
|
| 248 |
// Convert_v1_PodStatus_To_example_PodStatus is an autogenerated conversion function. |
| 249 |
func Convert_v1_PodStatus_To_example_PodStatus(in *PodStatus, out *example.PodStatus, s conversion.Scope) error { |
| 250 |
return autoConvert_v1_PodStatus_To_example_PodStatus(in, out, s) |
| 251 |
} |
| 252 |
|
| 253 |
func autoConvert_example_PodStatus_To_v1_PodStatus(in *example.PodStatus, out *PodStatus, s conversion.Scope) error { |
| 254 |
out.Phase = PodPhase(in.Phase) |
| 255 |
out.Conditions = *(*[]PodCondition)(unsafe.Pointer(&in.Conditions)) |
| 256 |
out.Message = in.Message |
| 257 |
out.Reason = in.Reason |
| 258 |
out.HostIP = in.HostIP |
| 259 |
out.PodIP = in.PodIP |
| 260 |
out.StartTime = (*metav1.Time)(unsafe.Pointer(in.StartTime)) |
| 261 |
return nil |
| 262 |
} |
| 263 |
|
| 264 |
// Convert_example_PodStatus_To_v1_PodStatus is an autogenerated conversion function. |
| 265 |
func Convert_example_PodStatus_To_v1_PodStatus(in *example.PodStatus, out *PodStatus, s conversion.Scope) error { |
| 266 |
return autoConvert_example_PodStatus_To_v1_PodStatus(in, out, s) |
| 267 |
} |