Conflicts:
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/latest/latest.go
Godeps/_workspace/src/k8s.io/kubernetes/pkg/master/master.go
| ... | ... |
@@ -24,6 +24,7 @@ import ( |
| 24 | 24 |
"k8s.io/kubernetes/pkg/api/meta" |
| 25 | 25 |
"k8s.io/kubernetes/pkg/api/registered" |
| 26 | 26 |
"k8s.io/kubernetes/pkg/api/v1" |
| 27 |
+ "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 27 | 28 |
"k8s.io/kubernetes/pkg/runtime" |
| 28 | 29 |
"k8s.io/kubernetes/pkg/util/sets" |
| 29 | 30 |
) |
| ... | ... |
@@ -110,6 +111,12 @@ func init() {
|
| 110 | 110 |
// string, or an error if the version is not known. |
| 111 | 111 |
func InterfacesFor(version string) (*meta.VersionInterfaces, error) {
|
| 112 | 112 |
switch version {
|
| 113 |
+ case "v1beta3": |
|
| 114 |
+ return &meta.VersionInterfaces{
|
|
| 115 |
+ Codec: v1beta3.Codec, |
|
| 116 |
+ ObjectConvertor: api.Scheme, |
|
| 117 |
+ MetadataAccessor: accessor, |
|
| 118 |
+ }, nil |
|
| 113 | 119 |
case "v1": |
| 114 | 120 |
return &meta.VersionInterfaces{
|
| 115 | 121 |
Codec: v1.Codec, |
| ... | ... |
@@ -31,10 +31,11 @@ var RegisteredVersions []string |
| 31 | 31 |
func init() {
|
| 32 | 32 |
validAPIVersions := map[string]bool{
|
| 33 | 33 |
"v1": true, |
| 34 |
+ "v1beta3": true, |
|
| 34 | 35 |
} |
| 35 | 36 |
|
| 36 | 37 |
// The default list of supported api versions, in order of most preferred to the least. |
| 37 |
- defaultSupportedVersions := "v1" |
|
| 38 |
+ defaultSupportedVersions := "v1,v1beta3" |
|
| 38 | 39 |
// Env var KUBE_API_VERSIONS is a comma separated list of API versions that should be registered in the scheme. |
| 39 | 40 |
// The versions should be in the order of most preferred to the least. |
| 40 | 41 |
supportedVersions := os.Getenv("KUBE_API_VERSIONS")
|
| 41 | 42 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,787 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2014 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+package v1beta3 |
|
| 17 |
+ |
|
| 18 |
+import ( |
|
| 19 |
+ "fmt" |
|
| 20 |
+ "reflect" |
|
| 21 |
+ |
|
| 22 |
+ "k8s.io/kubernetes/pkg/api" |
|
| 23 |
+ "k8s.io/kubernetes/pkg/conversion" |
|
| 24 |
+) |
|
| 25 |
+ |
|
| 26 |
+func addConversionFuncs() {
|
|
| 27 |
+ // Add non-generated conversion functions |
|
| 28 |
+ err := api.Scheme.AddConversionFuncs( |
|
| 29 |
+ convert_v1beta3_Container_To_api_Container, |
|
| 30 |
+ convert_api_Container_To_v1beta3_Container, |
|
| 31 |
+ convert_v1beta3_ServiceSpec_To_api_ServiceSpec, |
|
| 32 |
+ convert_api_ServiceSpec_To_v1beta3_ServiceSpec, |
|
| 33 |
+ convert_v1beta3_PodSpec_To_api_PodSpec, |
|
| 34 |
+ convert_api_PodSpec_To_v1beta3_PodSpec, |
|
| 35 |
+ convert_v1beta3_ContainerState_To_api_ContainerState, |
|
| 36 |
+ convert_api_ContainerState_To_v1beta3_ContainerState, |
|
| 37 |
+ convert_api_ContainerStateTerminated_To_v1beta3_ContainerStateTerminated, |
|
| 38 |
+ convert_v1beta3_ContainerStateTerminated_To_api_ContainerStateTerminated, |
|
| 39 |
+ convert_v1beta3_StatusDetails_To_api_StatusDetails, |
|
| 40 |
+ convert_api_StatusDetails_To_v1beta3_StatusDetails, |
|
| 41 |
+ convert_v1beta3_StatusCause_To_api_StatusCause, |
|
| 42 |
+ convert_api_StatusCause_To_v1beta3_StatusCause, |
|
| 43 |
+ convert_api_ReplicationControllerSpec_To_v1beta3_ReplicationControllerSpec, |
|
| 44 |
+ convert_v1beta3_ReplicationControllerSpec_To_api_ReplicationControllerSpec, |
|
| 45 |
+ ) |
|
| 46 |
+ if err != nil {
|
|
| 47 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 48 |
+ panic(err) |
|
| 49 |
+ } |
|
| 50 |
+ |
|
| 51 |
+ // Add field conversion funcs. |
|
| 52 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "Pod",
|
|
| 53 |
+ func(label, value string) (string, string, error) {
|
|
| 54 |
+ switch label {
|
|
| 55 |
+ case "metadata.name", |
|
| 56 |
+ "metadata.namespace", |
|
| 57 |
+ "metadata.labels", |
|
| 58 |
+ "metadata.annotations", |
|
| 59 |
+ "status.podIP", |
|
| 60 |
+ "status.phase": |
|
| 61 |
+ return label, value, nil |
|
| 62 |
+ case "spec.host": |
|
| 63 |
+ return "spec.nodeName", value, nil |
|
| 64 |
+ default: |
|
| 65 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 66 |
+ } |
|
| 67 |
+ }) |
|
| 68 |
+ if err != nil {
|
|
| 69 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 70 |
+ panic(err) |
|
| 71 |
+ } |
|
| 72 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "Node",
|
|
| 73 |
+ func(label, value string) (string, string, error) {
|
|
| 74 |
+ switch label {
|
|
| 75 |
+ case "metadata.name": |
|
| 76 |
+ return label, value, nil |
|
| 77 |
+ case "spec.unschedulable": |
|
| 78 |
+ return label, value, nil |
|
| 79 |
+ default: |
|
| 80 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 81 |
+ } |
|
| 82 |
+ }) |
|
| 83 |
+ if err != nil {
|
|
| 84 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 85 |
+ panic(err) |
|
| 86 |
+ } |
|
| 87 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "ReplicationController",
|
|
| 88 |
+ func(label, value string) (string, string, error) {
|
|
| 89 |
+ switch label {
|
|
| 90 |
+ case "metadata.name", |
|
| 91 |
+ "status.replicas": |
|
| 92 |
+ return label, value, nil |
|
| 93 |
+ default: |
|
| 94 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 95 |
+ } |
|
| 96 |
+ }) |
|
| 97 |
+ if err != nil {
|
|
| 98 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 99 |
+ panic(err) |
|
| 100 |
+ } |
|
| 101 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "Event",
|
|
| 102 |
+ func(label, value string) (string, string, error) {
|
|
| 103 |
+ switch label {
|
|
| 104 |
+ case "involvedObject.kind", |
|
| 105 |
+ "involvedObject.namespace", |
|
| 106 |
+ "involvedObject.name", |
|
| 107 |
+ "involvedObject.uid", |
|
| 108 |
+ "involvedObject.apiVersion", |
|
| 109 |
+ "involvedObject.resourceVersion", |
|
| 110 |
+ "involvedObject.fieldPath", |
|
| 111 |
+ "reason", |
|
| 112 |
+ "source": |
|
| 113 |
+ return label, value, nil |
|
| 114 |
+ default: |
|
| 115 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 116 |
+ } |
|
| 117 |
+ }) |
|
| 118 |
+ if err != nil {
|
|
| 119 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 120 |
+ panic(err) |
|
| 121 |
+ } |
|
| 122 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "Namespace",
|
|
| 123 |
+ func(label, value string) (string, string, error) {
|
|
| 124 |
+ switch label {
|
|
| 125 |
+ case "status.phase": |
|
| 126 |
+ return label, value, nil |
|
| 127 |
+ default: |
|
| 128 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 129 |
+ } |
|
| 130 |
+ }) |
|
| 131 |
+ if err != nil {
|
|
| 132 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 133 |
+ panic(err) |
|
| 134 |
+ } |
|
| 135 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "Secret",
|
|
| 136 |
+ func(label, value string) (string, string, error) {
|
|
| 137 |
+ switch label {
|
|
| 138 |
+ case "type": |
|
| 139 |
+ return label, value, nil |
|
| 140 |
+ default: |
|
| 141 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 142 |
+ } |
|
| 143 |
+ }) |
|
| 144 |
+ if err != nil {
|
|
| 145 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 146 |
+ panic(err) |
|
| 147 |
+ } |
|
| 148 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "ServiceAccount",
|
|
| 149 |
+ func(label, value string) (string, string, error) {
|
|
| 150 |
+ switch label {
|
|
| 151 |
+ case "metadata.name": |
|
| 152 |
+ return label, value, nil |
|
| 153 |
+ default: |
|
| 154 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 155 |
+ } |
|
| 156 |
+ }) |
|
| 157 |
+ if err != nil {
|
|
| 158 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 159 |
+ panic(err) |
|
| 160 |
+ } |
|
| 161 |
+ err = api.Scheme.AddFieldLabelConversionFunc("v1beta3", "Endpoints",
|
|
| 162 |
+ func(label, value string) (string, string, error) {
|
|
| 163 |
+ switch label {
|
|
| 164 |
+ case "metadata.name": |
|
| 165 |
+ return label, value, nil |
|
| 166 |
+ default: |
|
| 167 |
+ return "", "", fmt.Errorf("field label not supported: %s", label)
|
|
| 168 |
+ } |
|
| 169 |
+ }) |
|
| 170 |
+ if err != nil {
|
|
| 171 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 172 |
+ panic(err) |
|
| 173 |
+ } |
|
| 174 |
+} |
|
| 175 |
+ |
|
| 176 |
+func convert_v1beta3_Container_To_api_Container(in *Container, out *api.Container, s conversion.Scope) error {
|
|
| 177 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 178 |
+ defaulting.(func(*Container))(in) |
|
| 179 |
+ } |
|
| 180 |
+ out.Name = in.Name |
|
| 181 |
+ out.Image = in.Image |
|
| 182 |
+ if in.Command != nil {
|
|
| 183 |
+ out.Command = make([]string, len(in.Command)) |
|
| 184 |
+ for i := range in.Command {
|
|
| 185 |
+ out.Command[i] = in.Command[i] |
|
| 186 |
+ } |
|
| 187 |
+ } |
|
| 188 |
+ if in.Args != nil {
|
|
| 189 |
+ out.Args = make([]string, len(in.Args)) |
|
| 190 |
+ for i := range in.Args {
|
|
| 191 |
+ out.Args[i] = in.Args[i] |
|
| 192 |
+ } |
|
| 193 |
+ } |
|
| 194 |
+ out.WorkingDir = in.WorkingDir |
|
| 195 |
+ if in.Ports != nil {
|
|
| 196 |
+ out.Ports = make([]api.ContainerPort, len(in.Ports)) |
|
| 197 |
+ for i := range in.Ports {
|
|
| 198 |
+ if err := convert_v1beta3_ContainerPort_To_api_ContainerPort(&in.Ports[i], &out.Ports[i], s); err != nil {
|
|
| 199 |
+ return err |
|
| 200 |
+ } |
|
| 201 |
+ } |
|
| 202 |
+ } |
|
| 203 |
+ if in.Env != nil {
|
|
| 204 |
+ out.Env = make([]api.EnvVar, len(in.Env)) |
|
| 205 |
+ for i := range in.Env {
|
|
| 206 |
+ if err := convert_v1beta3_EnvVar_To_api_EnvVar(&in.Env[i], &out.Env[i], s); err != nil {
|
|
| 207 |
+ return err |
|
| 208 |
+ } |
|
| 209 |
+ } |
|
| 210 |
+ } |
|
| 211 |
+ if err := s.Convert(&in.Resources, &out.Resources, 0); err != nil {
|
|
| 212 |
+ return err |
|
| 213 |
+ } |
|
| 214 |
+ if in.VolumeMounts != nil {
|
|
| 215 |
+ out.VolumeMounts = make([]api.VolumeMount, len(in.VolumeMounts)) |
|
| 216 |
+ for i := range in.VolumeMounts {
|
|
| 217 |
+ if err := convert_v1beta3_VolumeMount_To_api_VolumeMount(&in.VolumeMounts[i], &out.VolumeMounts[i], s); err != nil {
|
|
| 218 |
+ return err |
|
| 219 |
+ } |
|
| 220 |
+ } |
|
| 221 |
+ } |
|
| 222 |
+ if in.LivenessProbe != nil {
|
|
| 223 |
+ out.LivenessProbe = new(api.Probe) |
|
| 224 |
+ if err := convert_v1beta3_Probe_To_api_Probe(in.LivenessProbe, out.LivenessProbe, s); err != nil {
|
|
| 225 |
+ return err |
|
| 226 |
+ } |
|
| 227 |
+ } else {
|
|
| 228 |
+ out.LivenessProbe = nil |
|
| 229 |
+ } |
|
| 230 |
+ if in.ReadinessProbe != nil {
|
|
| 231 |
+ out.ReadinessProbe = new(api.Probe) |
|
| 232 |
+ if err := convert_v1beta3_Probe_To_api_Probe(in.ReadinessProbe, out.ReadinessProbe, s); err != nil {
|
|
| 233 |
+ return err |
|
| 234 |
+ } |
|
| 235 |
+ } else {
|
|
| 236 |
+ out.ReadinessProbe = nil |
|
| 237 |
+ } |
|
| 238 |
+ if in.Lifecycle != nil {
|
|
| 239 |
+ out.Lifecycle = new(api.Lifecycle) |
|
| 240 |
+ if err := convert_v1beta3_Lifecycle_To_api_Lifecycle(in.Lifecycle, out.Lifecycle, s); err != nil {
|
|
| 241 |
+ return err |
|
| 242 |
+ } |
|
| 243 |
+ } else {
|
|
| 244 |
+ out.Lifecycle = nil |
|
| 245 |
+ } |
|
| 246 |
+ out.TerminationMessagePath = in.TerminationMessagePath |
|
| 247 |
+ out.ImagePullPolicy = api.PullPolicy(in.ImagePullPolicy) |
|
| 248 |
+ if in.SecurityContext != nil {
|
|
| 249 |
+ if in.SecurityContext.Capabilities != nil {
|
|
| 250 |
+ if !reflect.DeepEqual(in.SecurityContext.Capabilities.Add, in.Capabilities.Add) || |
|
| 251 |
+ !reflect.DeepEqual(in.SecurityContext.Capabilities.Drop, in.Capabilities.Drop) {
|
|
| 252 |
+ return fmt.Errorf("container capability settings do not match security context settings, cannot convert")
|
|
| 253 |
+ } |
|
| 254 |
+ } |
|
| 255 |
+ if in.SecurityContext.Privileged != nil {
|
|
| 256 |
+ if in.Privileged != *in.SecurityContext.Privileged {
|
|
| 257 |
+ return fmt.Errorf("container privileged settings do not match security context settings, cannot convert")
|
|
| 258 |
+ } |
|
| 259 |
+ } |
|
| 260 |
+ } |
|
| 261 |
+ if in.SecurityContext != nil {
|
|
| 262 |
+ out.SecurityContext = new(api.SecurityContext) |
|
| 263 |
+ if err := convert_v1beta3_SecurityContext_To_api_SecurityContext(in.SecurityContext, out.SecurityContext, s); err != nil {
|
|
| 264 |
+ return err |
|
| 265 |
+ } |
|
| 266 |
+ } else {
|
|
| 267 |
+ out.SecurityContext = nil |
|
| 268 |
+ } |
|
| 269 |
+ |
|
| 270 |
+ out.Stdin = in.Stdin |
|
| 271 |
+ out.TTY = in.TTY |
|
| 272 |
+ return nil |
|
| 273 |
+} |
|
| 274 |
+ |
|
| 275 |
+func convert_api_Container_To_v1beta3_Container(in *api.Container, out *Container, s conversion.Scope) error {
|
|
| 276 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 277 |
+ defaulting.(func(*api.Container))(in) |
|
| 278 |
+ } |
|
| 279 |
+ out.Name = in.Name |
|
| 280 |
+ out.Image = in.Image |
|
| 281 |
+ if in.Command != nil {
|
|
| 282 |
+ out.Command = make([]string, len(in.Command)) |
|
| 283 |
+ for i := range in.Command {
|
|
| 284 |
+ out.Command[i] = in.Command[i] |
|
| 285 |
+ } |
|
| 286 |
+ } |
|
| 287 |
+ if in.Args != nil {
|
|
| 288 |
+ out.Args = make([]string, len(in.Args)) |
|
| 289 |
+ for i := range in.Args {
|
|
| 290 |
+ out.Args[i] = in.Args[i] |
|
| 291 |
+ } |
|
| 292 |
+ } |
|
| 293 |
+ out.WorkingDir = in.WorkingDir |
|
| 294 |
+ if in.Ports != nil {
|
|
| 295 |
+ out.Ports = make([]ContainerPort, len(in.Ports)) |
|
| 296 |
+ for i := range in.Ports {
|
|
| 297 |
+ if err := convert_api_ContainerPort_To_v1beta3_ContainerPort(&in.Ports[i], &out.Ports[i], s); err != nil {
|
|
| 298 |
+ return err |
|
| 299 |
+ } |
|
| 300 |
+ } |
|
| 301 |
+ } |
|
| 302 |
+ if in.Env != nil {
|
|
| 303 |
+ out.Env = make([]EnvVar, len(in.Env)) |
|
| 304 |
+ for i := range in.Env {
|
|
| 305 |
+ if err := convert_api_EnvVar_To_v1beta3_EnvVar(&in.Env[i], &out.Env[i], s); err != nil {
|
|
| 306 |
+ return err |
|
| 307 |
+ } |
|
| 308 |
+ } |
|
| 309 |
+ } |
|
| 310 |
+ if err := s.Convert(&in.Resources, &out.Resources, 0); err != nil {
|
|
| 311 |
+ return err |
|
| 312 |
+ } |
|
| 313 |
+ if in.VolumeMounts != nil {
|
|
| 314 |
+ out.VolumeMounts = make([]VolumeMount, len(in.VolumeMounts)) |
|
| 315 |
+ for i := range in.VolumeMounts {
|
|
| 316 |
+ if err := convert_api_VolumeMount_To_v1beta3_VolumeMount(&in.VolumeMounts[i], &out.VolumeMounts[i], s); err != nil {
|
|
| 317 |
+ return err |
|
| 318 |
+ } |
|
| 319 |
+ } |
|
| 320 |
+ } |
|
| 321 |
+ if in.LivenessProbe != nil {
|
|
| 322 |
+ out.LivenessProbe = new(Probe) |
|
| 323 |
+ if err := convert_api_Probe_To_v1beta3_Probe(in.LivenessProbe, out.LivenessProbe, s); err != nil {
|
|
| 324 |
+ return err |
|
| 325 |
+ } |
|
| 326 |
+ } else {
|
|
| 327 |
+ out.LivenessProbe = nil |
|
| 328 |
+ } |
|
| 329 |
+ if in.ReadinessProbe != nil {
|
|
| 330 |
+ out.ReadinessProbe = new(Probe) |
|
| 331 |
+ if err := convert_api_Probe_To_v1beta3_Probe(in.ReadinessProbe, out.ReadinessProbe, s); err != nil {
|
|
| 332 |
+ return err |
|
| 333 |
+ } |
|
| 334 |
+ } else {
|
|
| 335 |
+ out.ReadinessProbe = nil |
|
| 336 |
+ } |
|
| 337 |
+ if in.Lifecycle != nil {
|
|
| 338 |
+ out.Lifecycle = new(Lifecycle) |
|
| 339 |
+ if err := convert_api_Lifecycle_To_v1beta3_Lifecycle(in.Lifecycle, out.Lifecycle, s); err != nil {
|
|
| 340 |
+ return err |
|
| 341 |
+ } |
|
| 342 |
+ } else {
|
|
| 343 |
+ out.Lifecycle = nil |
|
| 344 |
+ } |
|
| 345 |
+ out.TerminationMessagePath = in.TerminationMessagePath |
|
| 346 |
+ out.ImagePullPolicy = PullPolicy(in.ImagePullPolicy) |
|
| 347 |
+ if in.SecurityContext != nil {
|
|
| 348 |
+ out.SecurityContext = new(SecurityContext) |
|
| 349 |
+ if err := convert_api_SecurityContext_To_v1beta3_SecurityContext(in.SecurityContext, out.SecurityContext, s); err != nil {
|
|
| 350 |
+ return err |
|
| 351 |
+ } |
|
| 352 |
+ } else {
|
|
| 353 |
+ out.SecurityContext = nil |
|
| 354 |
+ } |
|
| 355 |
+ // now that we've converted set the container field from security context |
|
| 356 |
+ if out.SecurityContext != nil && out.SecurityContext.Privileged != nil {
|
|
| 357 |
+ out.Privileged = *out.SecurityContext.Privileged |
|
| 358 |
+ } |
|
| 359 |
+ // now that we've converted set the container field from security context |
|
| 360 |
+ if out.SecurityContext != nil && out.SecurityContext.Capabilities != nil {
|
|
| 361 |
+ out.Capabilities = *out.SecurityContext.Capabilities |
|
| 362 |
+ } |
|
| 363 |
+ |
|
| 364 |
+ out.Stdin = in.Stdin |
|
| 365 |
+ out.TTY = in.TTY |
|
| 366 |
+ return nil |
|
| 367 |
+} |
|
| 368 |
+ |
|
| 369 |
+func convert_v1beta3_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.ServiceSpec, s conversion.Scope) error {
|
|
| 370 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 371 |
+ defaulting.(func(*ServiceSpec))(in) |
|
| 372 |
+ } |
|
| 373 |
+ if in.Ports != nil {
|
|
| 374 |
+ out.Ports = make([]api.ServicePort, len(in.Ports)) |
|
| 375 |
+ for i := range in.Ports {
|
|
| 376 |
+ if err := convert_v1beta3_ServicePort_To_api_ServicePort(&in.Ports[i], &out.Ports[i], s); err != nil {
|
|
| 377 |
+ return err |
|
| 378 |
+ } |
|
| 379 |
+ } |
|
| 380 |
+ } else {
|
|
| 381 |
+ out.Ports = nil |
|
| 382 |
+ } |
|
| 383 |
+ if in.Selector != nil {
|
|
| 384 |
+ out.Selector = make(map[string]string) |
|
| 385 |
+ for key, val := range in.Selector {
|
|
| 386 |
+ out.Selector[key] = val |
|
| 387 |
+ } |
|
| 388 |
+ } else {
|
|
| 389 |
+ out.Selector = nil |
|
| 390 |
+ } |
|
| 391 |
+ out.ClusterIP = in.PortalIP |
|
| 392 |
+ |
|
| 393 |
+ typeIn := in.Type |
|
| 394 |
+ if typeIn == "" {
|
|
| 395 |
+ if in.CreateExternalLoadBalancer {
|
|
| 396 |
+ typeIn = ServiceTypeLoadBalancer |
|
| 397 |
+ } else {
|
|
| 398 |
+ typeIn = ServiceTypeClusterIP |
|
| 399 |
+ } |
|
| 400 |
+ } |
|
| 401 |
+ if err := s.Convert(&typeIn, &out.Type, 0); err != nil {
|
|
| 402 |
+ return err |
|
| 403 |
+ } |
|
| 404 |
+ |
|
| 405 |
+ if in.PublicIPs != nil {
|
|
| 406 |
+ out.ExternalIPs = make([]string, len(in.PublicIPs)) |
|
| 407 |
+ for i := range in.PublicIPs {
|
|
| 408 |
+ out.ExternalIPs[i] = in.PublicIPs[i] |
|
| 409 |
+ } |
|
| 410 |
+ } else {
|
|
| 411 |
+ out.ExternalIPs = nil |
|
| 412 |
+ } |
|
| 413 |
+ out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity) |
|
| 414 |
+ return nil |
|
| 415 |
+} |
|
| 416 |
+ |
|
| 417 |
+func convert_api_ServiceSpec_To_v1beta3_ServiceSpec(in *api.ServiceSpec, out *ServiceSpec, s conversion.Scope) error {
|
|
| 418 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 419 |
+ defaulting.(func(*api.ServiceSpec))(in) |
|
| 420 |
+ } |
|
| 421 |
+ if in.Ports != nil {
|
|
| 422 |
+ out.Ports = make([]ServicePort, len(in.Ports)) |
|
| 423 |
+ for i := range in.Ports {
|
|
| 424 |
+ if err := convert_api_ServicePort_To_v1beta3_ServicePort(&in.Ports[i], &out.Ports[i], s); err != nil {
|
|
| 425 |
+ return err |
|
| 426 |
+ } |
|
| 427 |
+ } |
|
| 428 |
+ } else {
|
|
| 429 |
+ out.Ports = nil |
|
| 430 |
+ } |
|
| 431 |
+ if in.Selector != nil {
|
|
| 432 |
+ out.Selector = make(map[string]string) |
|
| 433 |
+ for key, val := range in.Selector {
|
|
| 434 |
+ out.Selector[key] = val |
|
| 435 |
+ } |
|
| 436 |
+ } else {
|
|
| 437 |
+ out.Selector = nil |
|
| 438 |
+ } |
|
| 439 |
+ out.PortalIP = in.ClusterIP |
|
| 440 |
+ |
|
| 441 |
+ if err := s.Convert(&in.Type, &out.Type, 0); err != nil {
|
|
| 442 |
+ return err |
|
| 443 |
+ } |
|
| 444 |
+ out.CreateExternalLoadBalancer = in.Type == api.ServiceTypeLoadBalancer |
|
| 445 |
+ |
|
| 446 |
+ if in.ExternalIPs != nil {
|
|
| 447 |
+ out.PublicIPs = make([]string, len(in.ExternalIPs)) |
|
| 448 |
+ for i := range in.ExternalIPs {
|
|
| 449 |
+ out.PublicIPs[i] = in.ExternalIPs[i] |
|
| 450 |
+ } |
|
| 451 |
+ } else {
|
|
| 452 |
+ out.PublicIPs = nil |
|
| 453 |
+ } |
|
| 454 |
+ out.SessionAffinity = ServiceAffinity(in.SessionAffinity) |
|
| 455 |
+ return nil |
|
| 456 |
+} |
|
| 457 |
+ |
|
| 458 |
+func convert_v1beta3_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conversion.Scope) error {
|
|
| 459 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 460 |
+ defaulting.(func(*PodSpec))(in) |
|
| 461 |
+ } |
|
| 462 |
+ if in.Volumes != nil {
|
|
| 463 |
+ out.Volumes = make([]api.Volume, len(in.Volumes)) |
|
| 464 |
+ for i := range in.Volumes {
|
|
| 465 |
+ if err := convert_v1beta3_Volume_To_api_Volume(&in.Volumes[i], &out.Volumes[i], s); err != nil {
|
|
| 466 |
+ return err |
|
| 467 |
+ } |
|
| 468 |
+ } |
|
| 469 |
+ } else {
|
|
| 470 |
+ out.Volumes = nil |
|
| 471 |
+ } |
|
| 472 |
+ if in.Containers != nil {
|
|
| 473 |
+ out.Containers = make([]api.Container, len(in.Containers)) |
|
| 474 |
+ for i := range in.Containers {
|
|
| 475 |
+ if err := convert_v1beta3_Container_To_api_Container(&in.Containers[i], &out.Containers[i], s); err != nil {
|
|
| 476 |
+ return err |
|
| 477 |
+ } |
|
| 478 |
+ } |
|
| 479 |
+ } else {
|
|
| 480 |
+ out.Containers = nil |
|
| 481 |
+ } |
|
| 482 |
+ out.RestartPolicy = api.RestartPolicy(in.RestartPolicy) |
|
| 483 |
+ if in.TerminationGracePeriodSeconds != nil {
|
|
| 484 |
+ out.TerminationGracePeriodSeconds = new(int64) |
|
| 485 |
+ *out.TerminationGracePeriodSeconds = *in.TerminationGracePeriodSeconds |
|
| 486 |
+ } else {
|
|
| 487 |
+ out.TerminationGracePeriodSeconds = nil |
|
| 488 |
+ } |
|
| 489 |
+ if in.ActiveDeadlineSeconds != nil {
|
|
| 490 |
+ out.ActiveDeadlineSeconds = new(int64) |
|
| 491 |
+ *out.ActiveDeadlineSeconds = *in.ActiveDeadlineSeconds |
|
| 492 |
+ } else {
|
|
| 493 |
+ out.ActiveDeadlineSeconds = nil |
|
| 494 |
+ } |
|
| 495 |
+ out.DNSPolicy = api.DNSPolicy(in.DNSPolicy) |
|
| 496 |
+ if in.NodeSelector != nil {
|
|
| 497 |
+ out.NodeSelector = make(map[string]string) |
|
| 498 |
+ for key, val := range in.NodeSelector {
|
|
| 499 |
+ out.NodeSelector[key] = val |
|
| 500 |
+ } |
|
| 501 |
+ } else {
|
|
| 502 |
+ out.NodeSelector = nil |
|
| 503 |
+ } |
|
| 504 |
+ out.ServiceAccountName = in.ServiceAccount |
|
| 505 |
+ out.NodeName = in.Host |
|
| 506 |
+ out.HostNetwork = in.HostNetwork |
|
| 507 |
+ if in.ImagePullSecrets != nil {
|
|
| 508 |
+ out.ImagePullSecrets = make([]api.LocalObjectReference, len(in.ImagePullSecrets)) |
|
| 509 |
+ for i := range in.ImagePullSecrets {
|
|
| 510 |
+ if err := convert_v1beta3_LocalObjectReference_To_api_LocalObjectReference(&in.ImagePullSecrets[i], &out.ImagePullSecrets[i], s); err != nil {
|
|
| 511 |
+ return err |
|
| 512 |
+ } |
|
| 513 |
+ } |
|
| 514 |
+ } else {
|
|
| 515 |
+ out.ImagePullSecrets = nil |
|
| 516 |
+ } |
|
| 517 |
+ return nil |
|
| 518 |
+} |
|
| 519 |
+ |
|
| 520 |
+func convert_api_PodSpec_To_v1beta3_PodSpec(in *api.PodSpec, out *PodSpec, s conversion.Scope) error {
|
|
| 521 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 522 |
+ defaulting.(func(*api.PodSpec))(in) |
|
| 523 |
+ } |
|
| 524 |
+ if in.Volumes != nil {
|
|
| 525 |
+ out.Volumes = make([]Volume, len(in.Volumes)) |
|
| 526 |
+ for i := range in.Volumes {
|
|
| 527 |
+ if err := convert_api_Volume_To_v1beta3_Volume(&in.Volumes[i], &out.Volumes[i], s); err != nil {
|
|
| 528 |
+ return err |
|
| 529 |
+ } |
|
| 530 |
+ } |
|
| 531 |
+ } else {
|
|
| 532 |
+ out.Volumes = nil |
|
| 533 |
+ } |
|
| 534 |
+ if in.Containers != nil {
|
|
| 535 |
+ out.Containers = make([]Container, len(in.Containers)) |
|
| 536 |
+ for i := range in.Containers {
|
|
| 537 |
+ if err := convert_api_Container_To_v1beta3_Container(&in.Containers[i], &out.Containers[i], s); err != nil {
|
|
| 538 |
+ return err |
|
| 539 |
+ } |
|
| 540 |
+ } |
|
| 541 |
+ } else {
|
|
| 542 |
+ out.Containers = nil |
|
| 543 |
+ } |
|
| 544 |
+ out.RestartPolicy = RestartPolicy(in.RestartPolicy) |
|
| 545 |
+ if in.TerminationGracePeriodSeconds != nil {
|
|
| 546 |
+ out.TerminationGracePeriodSeconds = new(int64) |
|
| 547 |
+ *out.TerminationGracePeriodSeconds = *in.TerminationGracePeriodSeconds |
|
| 548 |
+ } else {
|
|
| 549 |
+ out.TerminationGracePeriodSeconds = nil |
|
| 550 |
+ } |
|
| 551 |
+ if in.ActiveDeadlineSeconds != nil {
|
|
| 552 |
+ out.ActiveDeadlineSeconds = new(int64) |
|
| 553 |
+ *out.ActiveDeadlineSeconds = *in.ActiveDeadlineSeconds |
|
| 554 |
+ } else {
|
|
| 555 |
+ out.ActiveDeadlineSeconds = nil |
|
| 556 |
+ } |
|
| 557 |
+ out.DNSPolicy = DNSPolicy(in.DNSPolicy) |
|
| 558 |
+ if in.NodeSelector != nil {
|
|
| 559 |
+ out.NodeSelector = make(map[string]string) |
|
| 560 |
+ for key, val := range in.NodeSelector {
|
|
| 561 |
+ out.NodeSelector[key] = val |
|
| 562 |
+ } |
|
| 563 |
+ } else {
|
|
| 564 |
+ out.NodeSelector = nil |
|
| 565 |
+ } |
|
| 566 |
+ out.ServiceAccount = in.ServiceAccountName |
|
| 567 |
+ out.Host = in.NodeName |
|
| 568 |
+ out.HostNetwork = in.HostNetwork |
|
| 569 |
+ if in.ImagePullSecrets != nil {
|
|
| 570 |
+ out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) |
|
| 571 |
+ for i := range in.ImagePullSecrets {
|
|
| 572 |
+ if err := convert_api_LocalObjectReference_To_v1beta3_LocalObjectReference(&in.ImagePullSecrets[i], &out.ImagePullSecrets[i], s); err != nil {
|
|
| 573 |
+ return err |
|
| 574 |
+ } |
|
| 575 |
+ } |
|
| 576 |
+ } else {
|
|
| 577 |
+ out.ImagePullSecrets = nil |
|
| 578 |
+ } |
|
| 579 |
+ return nil |
|
| 580 |
+} |
|
| 581 |
+ |
|
| 582 |
+func convert_api_ContainerState_To_v1beta3_ContainerState(in *api.ContainerState, out *ContainerState, s conversion.Scope) error {
|
|
| 583 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 584 |
+ defaulting.(func(*api.ContainerState))(in) |
|
| 585 |
+ } |
|
| 586 |
+ if in.Waiting != nil {
|
|
| 587 |
+ out.Waiting = new(ContainerStateWaiting) |
|
| 588 |
+ if err := convert_api_ContainerStateWaiting_To_v1beta3_ContainerStateWaiting(in.Waiting, out.Waiting, s); err != nil {
|
|
| 589 |
+ return err |
|
| 590 |
+ } |
|
| 591 |
+ } else {
|
|
| 592 |
+ out.Waiting = nil |
|
| 593 |
+ } |
|
| 594 |
+ if in.Running != nil {
|
|
| 595 |
+ out.Running = new(ContainerStateRunning) |
|
| 596 |
+ if err := convert_api_ContainerStateRunning_To_v1beta3_ContainerStateRunning(in.Running, out.Running, s); err != nil {
|
|
| 597 |
+ return err |
|
| 598 |
+ } |
|
| 599 |
+ } else {
|
|
| 600 |
+ out.Running = nil |
|
| 601 |
+ } |
|
| 602 |
+ if in.Terminated != nil {
|
|
| 603 |
+ out.Termination = new(ContainerStateTerminated) |
|
| 604 |
+ if err := convert_api_ContainerStateTerminated_To_v1beta3_ContainerStateTerminated(in.Terminated, out.Termination, s); err != nil {
|
|
| 605 |
+ return err |
|
| 606 |
+ } |
|
| 607 |
+ } else {
|
|
| 608 |
+ out.Termination = nil |
|
| 609 |
+ } |
|
| 610 |
+ return nil |
|
| 611 |
+} |
|
| 612 |
+ |
|
| 613 |
+func convert_v1beta3_ContainerState_To_api_ContainerState(in *ContainerState, out *api.ContainerState, s conversion.Scope) error {
|
|
| 614 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 615 |
+ defaulting.(func(*ContainerState))(in) |
|
| 616 |
+ } |
|
| 617 |
+ if in.Waiting != nil {
|
|
| 618 |
+ out.Waiting = new(api.ContainerStateWaiting) |
|
| 619 |
+ if err := convert_v1beta3_ContainerStateWaiting_To_api_ContainerStateWaiting(in.Waiting, out.Waiting, s); err != nil {
|
|
| 620 |
+ return err |
|
| 621 |
+ } |
|
| 622 |
+ } else {
|
|
| 623 |
+ out.Waiting = nil |
|
| 624 |
+ } |
|
| 625 |
+ if in.Running != nil {
|
|
| 626 |
+ out.Running = new(api.ContainerStateRunning) |
|
| 627 |
+ if err := convert_v1beta3_ContainerStateRunning_To_api_ContainerStateRunning(in.Running, out.Running, s); err != nil {
|
|
| 628 |
+ return err |
|
| 629 |
+ } |
|
| 630 |
+ } else {
|
|
| 631 |
+ out.Running = nil |
|
| 632 |
+ } |
|
| 633 |
+ if in.Termination != nil {
|
|
| 634 |
+ out.Terminated = new(api.ContainerStateTerminated) |
|
| 635 |
+ if err := convert_v1beta3_ContainerStateTerminated_To_api_ContainerStateTerminated(in.Termination, out.Terminated, s); err != nil {
|
|
| 636 |
+ return err |
|
| 637 |
+ } |
|
| 638 |
+ } else {
|
|
| 639 |
+ out.Terminated = nil |
|
| 640 |
+ } |
|
| 641 |
+ return nil |
|
| 642 |
+} |
|
| 643 |
+ |
|
| 644 |
+func convert_api_ContainerStateTerminated_To_v1beta3_ContainerStateTerminated(in *api.ContainerStateTerminated, out *ContainerStateTerminated, s conversion.Scope) error {
|
|
| 645 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 646 |
+ defaulting.(func(*api.ContainerStateTerminated))(in) |
|
| 647 |
+ } |
|
| 648 |
+ out.ExitCode = in.ExitCode |
|
| 649 |
+ out.Signal = in.Signal |
|
| 650 |
+ out.Reason = in.Reason |
|
| 651 |
+ out.Message = in.Message |
|
| 652 |
+ if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil {
|
|
| 653 |
+ return err |
|
| 654 |
+ } |
|
| 655 |
+ if err := s.Convert(&in.FinishedAt, &out.FinishedAt, 0); err != nil {
|
|
| 656 |
+ return err |
|
| 657 |
+ } |
|
| 658 |
+ out.ContainerID = in.ContainerID |
|
| 659 |
+ return nil |
|
| 660 |
+} |
|
| 661 |
+ |
|
| 662 |
+func convert_v1beta3_ContainerStateTerminated_To_api_ContainerStateTerminated(in *ContainerStateTerminated, out *api.ContainerStateTerminated, s conversion.Scope) error {
|
|
| 663 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 664 |
+ defaulting.(func(*ContainerStateTerminated))(in) |
|
| 665 |
+ } |
|
| 666 |
+ out.ExitCode = in.ExitCode |
|
| 667 |
+ out.Signal = in.Signal |
|
| 668 |
+ out.Reason = in.Reason |
|
| 669 |
+ out.Message = in.Message |
|
| 670 |
+ if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil {
|
|
| 671 |
+ return err |
|
| 672 |
+ } |
|
| 673 |
+ if err := s.Convert(&in.FinishedAt, &out.FinishedAt, 0); err != nil {
|
|
| 674 |
+ return err |
|
| 675 |
+ } |
|
| 676 |
+ out.ContainerID = in.ContainerID |
|
| 677 |
+ return nil |
|
| 678 |
+} |
|
| 679 |
+ |
|
| 680 |
+func convert_v1beta3_StatusDetails_To_api_StatusDetails(in *StatusDetails, out *api.StatusDetails, s conversion.Scope) error {
|
|
| 681 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 682 |
+ defaulting.(func(*StatusDetails))(in) |
|
| 683 |
+ } |
|
| 684 |
+ out.Name = in.ID |
|
| 685 |
+ out.Kind = in.Kind |
|
| 686 |
+ if in.Causes != nil {
|
|
| 687 |
+ out.Causes = make([]api.StatusCause, len(in.Causes)) |
|
| 688 |
+ for i := range in.Causes {
|
|
| 689 |
+ if err := convert_v1beta3_StatusCause_To_api_StatusCause(&in.Causes[i], &out.Causes[i], s); err != nil {
|
|
| 690 |
+ return err |
|
| 691 |
+ } |
|
| 692 |
+ } |
|
| 693 |
+ } else {
|
|
| 694 |
+ out.Causes = nil |
|
| 695 |
+ } |
|
| 696 |
+ out.RetryAfterSeconds = in.RetryAfterSeconds |
|
| 697 |
+ return nil |
|
| 698 |
+} |
|
| 699 |
+ |
|
| 700 |
+func convert_api_StatusDetails_To_v1beta3_StatusDetails(in *api.StatusDetails, out *StatusDetails, s conversion.Scope) error {
|
|
| 701 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 702 |
+ defaulting.(func(*api.StatusDetails))(in) |
|
| 703 |
+ } |
|
| 704 |
+ out.ID = in.Name |
|
| 705 |
+ out.Kind = in.Kind |
|
| 706 |
+ if in.Causes != nil {
|
|
| 707 |
+ out.Causes = make([]StatusCause, len(in.Causes)) |
|
| 708 |
+ for i := range in.Causes {
|
|
| 709 |
+ if err := convert_api_StatusCause_To_v1beta3_StatusCause(&in.Causes[i], &out.Causes[i], s); err != nil {
|
|
| 710 |
+ return err |
|
| 711 |
+ } |
|
| 712 |
+ } |
|
| 713 |
+ } else {
|
|
| 714 |
+ out.Causes = nil |
|
| 715 |
+ } |
|
| 716 |
+ out.RetryAfterSeconds = in.RetryAfterSeconds |
|
| 717 |
+ return nil |
|
| 718 |
+} |
|
| 719 |
+ |
|
| 720 |
+func convert_v1beta3_StatusCause_To_api_StatusCause(in *StatusCause, out *api.StatusCause, s conversion.Scope) error {
|
|
| 721 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 722 |
+ defaulting.(func(*StatusCause))(in) |
|
| 723 |
+ } |
|
| 724 |
+ out.Type = api.CauseType(in.Type) |
|
| 725 |
+ out.Message = in.Message |
|
| 726 |
+ out.Field = in.Field |
|
| 727 |
+ return nil |
|
| 728 |
+} |
|
| 729 |
+ |
|
| 730 |
+func convert_api_StatusCause_To_v1beta3_StatusCause(in *api.StatusCause, out *StatusCause, s conversion.Scope) error {
|
|
| 731 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 732 |
+ defaulting.(func(*api.StatusCause))(in) |
|
| 733 |
+ } |
|
| 734 |
+ out.Type = CauseType(in.Type) |
|
| 735 |
+ out.Message = in.Message |
|
| 736 |
+ out.Field = in.Field |
|
| 737 |
+ return nil |
|
| 738 |
+} |
|
| 739 |
+ |
|
| 740 |
+func convert_api_ReplicationControllerSpec_To_v1beta3_ReplicationControllerSpec(in *api.ReplicationControllerSpec, out *ReplicationControllerSpec, s conversion.Scope) error {
|
|
| 741 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 742 |
+ defaulting.(func(*api.ReplicationControllerSpec))(in) |
|
| 743 |
+ } |
|
| 744 |
+ out.Replicas = &in.Replicas |
|
| 745 |
+ if in.Selector != nil {
|
|
| 746 |
+ out.Selector = make(map[string]string) |
|
| 747 |
+ for key, val := range in.Selector {
|
|
| 748 |
+ out.Selector[key] = val |
|
| 749 |
+ } |
|
| 750 |
+ } else {
|
|
| 751 |
+ out.Selector = nil |
|
| 752 |
+ } |
|
| 753 |
+ if in.Template != nil {
|
|
| 754 |
+ out.Template = new(PodTemplateSpec) |
|
| 755 |
+ if err := convert_api_PodTemplateSpec_To_v1beta3_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
|
| 756 |
+ return err |
|
| 757 |
+ } |
|
| 758 |
+ } else {
|
|
| 759 |
+ out.Template = nil |
|
| 760 |
+ } |
|
| 761 |
+ return nil |
|
| 762 |
+} |
|
| 763 |
+ |
|
| 764 |
+func convert_v1beta3_ReplicationControllerSpec_To_api_ReplicationControllerSpec(in *ReplicationControllerSpec, out *api.ReplicationControllerSpec, s conversion.Scope) error {
|
|
| 765 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 766 |
+ defaulting.(func(*ReplicationControllerSpec))(in) |
|
| 767 |
+ } |
|
| 768 |
+ out.Replicas = *in.Replicas |
|
| 769 |
+ if in.Selector != nil {
|
|
| 770 |
+ out.Selector = make(map[string]string) |
|
| 771 |
+ for key, val := range in.Selector {
|
|
| 772 |
+ out.Selector[key] = val |
|
| 773 |
+ } |
|
| 774 |
+ } else {
|
|
| 775 |
+ out.Selector = nil |
|
| 776 |
+ } |
|
| 777 |
+ if in.Template != nil {
|
|
| 778 |
+ out.Template = new(api.PodTemplateSpec) |
|
| 779 |
+ if err := convert_v1beta3_PodTemplateSpec_To_api_PodTemplateSpec(in.Template, out.Template, s); err != nil {
|
|
| 780 |
+ return err |
|
| 781 |
+ } |
|
| 782 |
+ } else {
|
|
| 783 |
+ out.Template = nil |
|
| 784 |
+ } |
|
| 785 |
+ return nil |
|
| 786 |
+} |
| 0 | 787 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,4826 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2015 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-conversions.sh |
|
| 17 |
+ |
|
| 18 |
+package v1beta3 |
|
| 19 |
+ |
|
| 20 |
+import ( |
|
| 21 |
+ reflect "reflect" |
|
| 22 |
+ |
|
| 23 |
+ api "k8s.io/kubernetes/pkg/api" |
|
| 24 |
+ resource "k8s.io/kubernetes/pkg/api/resource" |
|
| 25 |
+ conversion "k8s.io/kubernetes/pkg/conversion" |
|
| 26 |
+) |
|
| 27 |
+ |
|
| 28 |
+func convert_api_AWSElasticBlockStoreVolumeSource_To_v1beta3_AWSElasticBlockStoreVolumeSource(in *api.AWSElasticBlockStoreVolumeSource, out *AWSElasticBlockStoreVolumeSource, s conversion.Scope) error {
|
|
| 29 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 30 |
+ defaulting.(func(*api.AWSElasticBlockStoreVolumeSource))(in) |
|
| 31 |
+ } |
|
| 32 |
+ out.VolumeID = in.VolumeID |
|
| 33 |
+ out.FSType = in.FSType |
|
| 34 |
+ out.Partition = in.Partition |
|
| 35 |
+ out.ReadOnly = in.ReadOnly |
|
| 36 |
+ return nil |
|
| 37 |
+} |
|
| 38 |
+ |
|
| 39 |
+func convert_api_Binding_To_v1beta3_Binding(in *api.Binding, out *Binding, s conversion.Scope) error {
|
|
| 40 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 41 |
+ defaulting.(func(*api.Binding))(in) |
|
| 42 |
+ } |
|
| 43 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 44 |
+ return err |
|
| 45 |
+ } |
|
| 46 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 47 |
+ return err |
|
| 48 |
+ } |
|
| 49 |
+ if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(&in.Target, &out.Target, s); err != nil {
|
|
| 50 |
+ return err |
|
| 51 |
+ } |
|
| 52 |
+ return nil |
|
| 53 |
+} |
|
| 54 |
+ |
|
| 55 |
+func convert_api_Capabilities_To_v1beta3_Capabilities(in *api.Capabilities, out *Capabilities, s conversion.Scope) error {
|
|
| 56 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 57 |
+ defaulting.(func(*api.Capabilities))(in) |
|
| 58 |
+ } |
|
| 59 |
+ if in.Add != nil {
|
|
| 60 |
+ out.Add = make([]Capability, len(in.Add)) |
|
| 61 |
+ for i := range in.Add {
|
|
| 62 |
+ out.Add[i] = Capability(in.Add[i]) |
|
| 63 |
+ } |
|
| 64 |
+ } else {
|
|
| 65 |
+ out.Add = nil |
|
| 66 |
+ } |
|
| 67 |
+ if in.Drop != nil {
|
|
| 68 |
+ out.Drop = make([]Capability, len(in.Drop)) |
|
| 69 |
+ for i := range in.Drop {
|
|
| 70 |
+ out.Drop[i] = Capability(in.Drop[i]) |
|
| 71 |
+ } |
|
| 72 |
+ } else {
|
|
| 73 |
+ out.Drop = nil |
|
| 74 |
+ } |
|
| 75 |
+ return nil |
|
| 76 |
+} |
|
| 77 |
+ |
|
| 78 |
+func convert_api_CephFSVolumeSource_To_v1beta3_CephFSVolumeSource(in *api.CephFSVolumeSource, out *CephFSVolumeSource, s conversion.Scope) error {
|
|
| 79 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 80 |
+ defaulting.(func(*api.CephFSVolumeSource))(in) |
|
| 81 |
+ } |
|
| 82 |
+ if in.Monitors != nil {
|
|
| 83 |
+ out.Monitors = make([]string, len(in.Monitors)) |
|
| 84 |
+ for i := range in.Monitors {
|
|
| 85 |
+ out.Monitors[i] = in.Monitors[i] |
|
| 86 |
+ } |
|
| 87 |
+ } else {
|
|
| 88 |
+ out.Monitors = nil |
|
| 89 |
+ } |
|
| 90 |
+ out.User = in.User |
|
| 91 |
+ out.SecretFile = in.SecretFile |
|
| 92 |
+ if in.SecretRef != nil {
|
|
| 93 |
+ out.SecretRef = new(LocalObjectReference) |
|
| 94 |
+ if err := convert_api_LocalObjectReference_To_v1beta3_LocalObjectReference(in.SecretRef, out.SecretRef, s); err != nil {
|
|
| 95 |
+ return err |
|
| 96 |
+ } |
|
| 97 |
+ } else {
|
|
| 98 |
+ out.SecretRef = nil |
|
| 99 |
+ } |
|
| 100 |
+ out.ReadOnly = in.ReadOnly |
|
| 101 |
+ return nil |
|
| 102 |
+} |
|
| 103 |
+ |
|
| 104 |
+func convert_api_CinderVolumeSource_To_v1beta3_CinderVolumeSource(in *api.CinderVolumeSource, out *CinderVolumeSource, s conversion.Scope) error {
|
|
| 105 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 106 |
+ defaulting.(func(*api.CinderVolumeSource))(in) |
|
| 107 |
+ } |
|
| 108 |
+ out.VolumeID = in.VolumeID |
|
| 109 |
+ out.FSType = in.FSType |
|
| 110 |
+ out.ReadOnly = in.ReadOnly |
|
| 111 |
+ return nil |
|
| 112 |
+} |
|
| 113 |
+ |
|
| 114 |
+func convert_api_ComponentCondition_To_v1beta3_ComponentCondition(in *api.ComponentCondition, out *ComponentCondition, s conversion.Scope) error {
|
|
| 115 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 116 |
+ defaulting.(func(*api.ComponentCondition))(in) |
|
| 117 |
+ } |
|
| 118 |
+ out.Type = ComponentConditionType(in.Type) |
|
| 119 |
+ out.Status = ConditionStatus(in.Status) |
|
| 120 |
+ out.Message = in.Message |
|
| 121 |
+ out.Error = in.Error |
|
| 122 |
+ return nil |
|
| 123 |
+} |
|
| 124 |
+ |
|
| 125 |
+func convert_api_ComponentStatus_To_v1beta3_ComponentStatus(in *api.ComponentStatus, out *ComponentStatus, s conversion.Scope) error {
|
|
| 126 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 127 |
+ defaulting.(func(*api.ComponentStatus))(in) |
|
| 128 |
+ } |
|
| 129 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 130 |
+ return err |
|
| 131 |
+ } |
|
| 132 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 133 |
+ return err |
|
| 134 |
+ } |
|
| 135 |
+ if in.Conditions != nil {
|
|
| 136 |
+ out.Conditions = make([]ComponentCondition, len(in.Conditions)) |
|
| 137 |
+ for i := range in.Conditions {
|
|
| 138 |
+ if err := convert_api_ComponentCondition_To_v1beta3_ComponentCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
|
| 139 |
+ return err |
|
| 140 |
+ } |
|
| 141 |
+ } |
|
| 142 |
+ } else {
|
|
| 143 |
+ out.Conditions = nil |
|
| 144 |
+ } |
|
| 145 |
+ return nil |
|
| 146 |
+} |
|
| 147 |
+ |
|
| 148 |
+func convert_api_ComponentStatusList_To_v1beta3_ComponentStatusList(in *api.ComponentStatusList, out *ComponentStatusList, s conversion.Scope) error {
|
|
| 149 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 150 |
+ defaulting.(func(*api.ComponentStatusList))(in) |
|
| 151 |
+ } |
|
| 152 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 153 |
+ return err |
|
| 154 |
+ } |
|
| 155 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 156 |
+ return err |
|
| 157 |
+ } |
|
| 158 |
+ if in.Items != nil {
|
|
| 159 |
+ out.Items = make([]ComponentStatus, len(in.Items)) |
|
| 160 |
+ for i := range in.Items {
|
|
| 161 |
+ if err := convert_api_ComponentStatus_To_v1beta3_ComponentStatus(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 162 |
+ return err |
|
| 163 |
+ } |
|
| 164 |
+ } |
|
| 165 |
+ } else {
|
|
| 166 |
+ out.Items = nil |
|
| 167 |
+ } |
|
| 168 |
+ return nil |
|
| 169 |
+} |
|
| 170 |
+ |
|
| 171 |
+func convert_api_ContainerPort_To_v1beta3_ContainerPort(in *api.ContainerPort, out *ContainerPort, s conversion.Scope) error {
|
|
| 172 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 173 |
+ defaulting.(func(*api.ContainerPort))(in) |
|
| 174 |
+ } |
|
| 175 |
+ out.Name = in.Name |
|
| 176 |
+ out.HostPort = in.HostPort |
|
| 177 |
+ out.ContainerPort = in.ContainerPort |
|
| 178 |
+ out.Protocol = Protocol(in.Protocol) |
|
| 179 |
+ out.HostIP = in.HostIP |
|
| 180 |
+ return nil |
|
| 181 |
+} |
|
| 182 |
+ |
|
| 183 |
+func convert_api_ContainerStateRunning_To_v1beta3_ContainerStateRunning(in *api.ContainerStateRunning, out *ContainerStateRunning, s conversion.Scope) error {
|
|
| 184 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 185 |
+ defaulting.(func(*api.ContainerStateRunning))(in) |
|
| 186 |
+ } |
|
| 187 |
+ if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil {
|
|
| 188 |
+ return err |
|
| 189 |
+ } |
|
| 190 |
+ return nil |
|
| 191 |
+} |
|
| 192 |
+ |
|
| 193 |
+func convert_api_ContainerStateWaiting_To_v1beta3_ContainerStateWaiting(in *api.ContainerStateWaiting, out *ContainerStateWaiting, s conversion.Scope) error {
|
|
| 194 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 195 |
+ defaulting.(func(*api.ContainerStateWaiting))(in) |
|
| 196 |
+ } |
|
| 197 |
+ out.Reason = in.Reason |
|
| 198 |
+ return nil |
|
| 199 |
+} |
|
| 200 |
+ |
|
| 201 |
+func convert_api_ContainerStatus_To_v1beta3_ContainerStatus(in *api.ContainerStatus, out *ContainerStatus, s conversion.Scope) error {
|
|
| 202 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 203 |
+ defaulting.(func(*api.ContainerStatus))(in) |
|
| 204 |
+ } |
|
| 205 |
+ out.Name = in.Name |
|
| 206 |
+ if err := convert_api_ContainerState_To_v1beta3_ContainerState(&in.State, &out.State, s); err != nil {
|
|
| 207 |
+ return err |
|
| 208 |
+ } |
|
| 209 |
+ if err := convert_api_ContainerState_To_v1beta3_ContainerState(&in.LastTerminationState, &out.LastTerminationState, s); err != nil {
|
|
| 210 |
+ return err |
|
| 211 |
+ } |
|
| 212 |
+ out.Ready = in.Ready |
|
| 213 |
+ out.RestartCount = in.RestartCount |
|
| 214 |
+ out.Image = in.Image |
|
| 215 |
+ out.ImageID = in.ImageID |
|
| 216 |
+ out.ContainerID = in.ContainerID |
|
| 217 |
+ return nil |
|
| 218 |
+} |
|
| 219 |
+ |
|
| 220 |
+func convert_api_DeleteOptions_To_v1beta3_DeleteOptions(in *api.DeleteOptions, out *DeleteOptions, s conversion.Scope) error {
|
|
| 221 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 222 |
+ defaulting.(func(*api.DeleteOptions))(in) |
|
| 223 |
+ } |
|
| 224 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 225 |
+ return err |
|
| 226 |
+ } |
|
| 227 |
+ if in.GracePeriodSeconds != nil {
|
|
| 228 |
+ out.GracePeriodSeconds = new(int64) |
|
| 229 |
+ *out.GracePeriodSeconds = *in.GracePeriodSeconds |
|
| 230 |
+ } else {
|
|
| 231 |
+ out.GracePeriodSeconds = nil |
|
| 232 |
+ } |
|
| 233 |
+ return nil |
|
| 234 |
+} |
|
| 235 |
+ |
|
| 236 |
+func convert_api_DownwardAPIVolumeFile_To_v1beta3_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error {
|
|
| 237 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 238 |
+ defaulting.(func(*api.DownwardAPIVolumeFile))(in) |
|
| 239 |
+ } |
|
| 240 |
+ out.Path = in.Path |
|
| 241 |
+ if err := convert_api_ObjectFieldSelector_To_v1beta3_ObjectFieldSelector(&in.FieldRef, &out.FieldRef, s); err != nil {
|
|
| 242 |
+ return err |
|
| 243 |
+ } |
|
| 244 |
+ return nil |
|
| 245 |
+} |
|
| 246 |
+ |
|
| 247 |
+func convert_api_DownwardAPIVolumeSource_To_v1beta3_DownwardAPIVolumeSource(in *api.DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, s conversion.Scope) error {
|
|
| 248 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 249 |
+ defaulting.(func(*api.DownwardAPIVolumeSource))(in) |
|
| 250 |
+ } |
|
| 251 |
+ if in.Items != nil {
|
|
| 252 |
+ out.Items = make([]DownwardAPIVolumeFile, len(in.Items)) |
|
| 253 |
+ for i := range in.Items {
|
|
| 254 |
+ if err := convert_api_DownwardAPIVolumeFile_To_v1beta3_DownwardAPIVolumeFile(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 255 |
+ return err |
|
| 256 |
+ } |
|
| 257 |
+ } |
|
| 258 |
+ } else {
|
|
| 259 |
+ out.Items = nil |
|
| 260 |
+ } |
|
| 261 |
+ return nil |
|
| 262 |
+} |
|
| 263 |
+ |
|
| 264 |
+func convert_api_EmptyDirVolumeSource_To_v1beta3_EmptyDirVolumeSource(in *api.EmptyDirVolumeSource, out *EmptyDirVolumeSource, s conversion.Scope) error {
|
|
| 265 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 266 |
+ defaulting.(func(*api.EmptyDirVolumeSource))(in) |
|
| 267 |
+ } |
|
| 268 |
+ out.Medium = StorageMedium(in.Medium) |
|
| 269 |
+ return nil |
|
| 270 |
+} |
|
| 271 |
+ |
|
| 272 |
+func convert_api_EndpointAddress_To_v1beta3_EndpointAddress(in *api.EndpointAddress, out *EndpointAddress, s conversion.Scope) error {
|
|
| 273 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 274 |
+ defaulting.(func(*api.EndpointAddress))(in) |
|
| 275 |
+ } |
|
| 276 |
+ out.IP = in.IP |
|
| 277 |
+ if in.TargetRef != nil {
|
|
| 278 |
+ out.TargetRef = new(ObjectReference) |
|
| 279 |
+ if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(in.TargetRef, out.TargetRef, s); err != nil {
|
|
| 280 |
+ return err |
|
| 281 |
+ } |
|
| 282 |
+ } else {
|
|
| 283 |
+ out.TargetRef = nil |
|
| 284 |
+ } |
|
| 285 |
+ return nil |
|
| 286 |
+} |
|
| 287 |
+ |
|
| 288 |
+func convert_api_EndpointPort_To_v1beta3_EndpointPort(in *api.EndpointPort, out *EndpointPort, s conversion.Scope) error {
|
|
| 289 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 290 |
+ defaulting.(func(*api.EndpointPort))(in) |
|
| 291 |
+ } |
|
| 292 |
+ out.Name = in.Name |
|
| 293 |
+ out.Port = in.Port |
|
| 294 |
+ out.Protocol = Protocol(in.Protocol) |
|
| 295 |
+ return nil |
|
| 296 |
+} |
|
| 297 |
+ |
|
| 298 |
+func convert_api_EndpointSubset_To_v1beta3_EndpointSubset(in *api.EndpointSubset, out *EndpointSubset, s conversion.Scope) error {
|
|
| 299 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 300 |
+ defaulting.(func(*api.EndpointSubset))(in) |
|
| 301 |
+ } |
|
| 302 |
+ if in.Addresses != nil {
|
|
| 303 |
+ out.Addresses = make([]EndpointAddress, len(in.Addresses)) |
|
| 304 |
+ for i := range in.Addresses {
|
|
| 305 |
+ if err := convert_api_EndpointAddress_To_v1beta3_EndpointAddress(&in.Addresses[i], &out.Addresses[i], s); err != nil {
|
|
| 306 |
+ return err |
|
| 307 |
+ } |
|
| 308 |
+ } |
|
| 309 |
+ } else {
|
|
| 310 |
+ out.Addresses = nil |
|
| 311 |
+ } |
|
| 312 |
+ if in.Ports != nil {
|
|
| 313 |
+ out.Ports = make([]EndpointPort, len(in.Ports)) |
|
| 314 |
+ for i := range in.Ports {
|
|
| 315 |
+ if err := convert_api_EndpointPort_To_v1beta3_EndpointPort(&in.Ports[i], &out.Ports[i], s); err != nil {
|
|
| 316 |
+ return err |
|
| 317 |
+ } |
|
| 318 |
+ } |
|
| 319 |
+ } else {
|
|
| 320 |
+ out.Ports = nil |
|
| 321 |
+ } |
|
| 322 |
+ return nil |
|
| 323 |
+} |
|
| 324 |
+ |
|
| 325 |
+func convert_api_Endpoints_To_v1beta3_Endpoints(in *api.Endpoints, out *Endpoints, s conversion.Scope) error {
|
|
| 326 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 327 |
+ defaulting.(func(*api.Endpoints))(in) |
|
| 328 |
+ } |
|
| 329 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 330 |
+ return err |
|
| 331 |
+ } |
|
| 332 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 333 |
+ return err |
|
| 334 |
+ } |
|
| 335 |
+ if in.Subsets != nil {
|
|
| 336 |
+ out.Subsets = make([]EndpointSubset, len(in.Subsets)) |
|
| 337 |
+ for i := range in.Subsets {
|
|
| 338 |
+ if err := convert_api_EndpointSubset_To_v1beta3_EndpointSubset(&in.Subsets[i], &out.Subsets[i], s); err != nil {
|
|
| 339 |
+ return err |
|
| 340 |
+ } |
|
| 341 |
+ } |
|
| 342 |
+ } else {
|
|
| 343 |
+ out.Subsets = nil |
|
| 344 |
+ } |
|
| 345 |
+ return nil |
|
| 346 |
+} |
|
| 347 |
+ |
|
| 348 |
+func convert_api_EndpointsList_To_v1beta3_EndpointsList(in *api.EndpointsList, out *EndpointsList, s conversion.Scope) error {
|
|
| 349 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 350 |
+ defaulting.(func(*api.EndpointsList))(in) |
|
| 351 |
+ } |
|
| 352 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 353 |
+ return err |
|
| 354 |
+ } |
|
| 355 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 356 |
+ return err |
|
| 357 |
+ } |
|
| 358 |
+ if in.Items != nil {
|
|
| 359 |
+ out.Items = make([]Endpoints, len(in.Items)) |
|
| 360 |
+ for i := range in.Items {
|
|
| 361 |
+ if err := convert_api_Endpoints_To_v1beta3_Endpoints(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 362 |
+ return err |
|
| 363 |
+ } |
|
| 364 |
+ } |
|
| 365 |
+ } else {
|
|
| 366 |
+ out.Items = nil |
|
| 367 |
+ } |
|
| 368 |
+ return nil |
|
| 369 |
+} |
|
| 370 |
+ |
|
| 371 |
+func convert_api_EnvVar_To_v1beta3_EnvVar(in *api.EnvVar, out *EnvVar, s conversion.Scope) error {
|
|
| 372 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 373 |
+ defaulting.(func(*api.EnvVar))(in) |
|
| 374 |
+ } |
|
| 375 |
+ out.Name = in.Name |
|
| 376 |
+ out.Value = in.Value |
|
| 377 |
+ if in.ValueFrom != nil {
|
|
| 378 |
+ out.ValueFrom = new(EnvVarSource) |
|
| 379 |
+ if err := convert_api_EnvVarSource_To_v1beta3_EnvVarSource(in.ValueFrom, out.ValueFrom, s); err != nil {
|
|
| 380 |
+ return err |
|
| 381 |
+ } |
|
| 382 |
+ } else {
|
|
| 383 |
+ out.ValueFrom = nil |
|
| 384 |
+ } |
|
| 385 |
+ return nil |
|
| 386 |
+} |
|
| 387 |
+ |
|
| 388 |
+func convert_api_EnvVarSource_To_v1beta3_EnvVarSource(in *api.EnvVarSource, out *EnvVarSource, s conversion.Scope) error {
|
|
| 389 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 390 |
+ defaulting.(func(*api.EnvVarSource))(in) |
|
| 391 |
+ } |
|
| 392 |
+ if in.FieldRef != nil {
|
|
| 393 |
+ out.FieldRef = new(ObjectFieldSelector) |
|
| 394 |
+ if err := convert_api_ObjectFieldSelector_To_v1beta3_ObjectFieldSelector(in.FieldRef, out.FieldRef, s); err != nil {
|
|
| 395 |
+ return err |
|
| 396 |
+ } |
|
| 397 |
+ } else {
|
|
| 398 |
+ out.FieldRef = nil |
|
| 399 |
+ } |
|
| 400 |
+ return nil |
|
| 401 |
+} |
|
| 402 |
+ |
|
| 403 |
+func convert_api_Event_To_v1beta3_Event(in *api.Event, out *Event, s conversion.Scope) error {
|
|
| 404 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 405 |
+ defaulting.(func(*api.Event))(in) |
|
| 406 |
+ } |
|
| 407 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 408 |
+ return err |
|
| 409 |
+ } |
|
| 410 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 411 |
+ return err |
|
| 412 |
+ } |
|
| 413 |
+ if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil {
|
|
| 414 |
+ return err |
|
| 415 |
+ } |
|
| 416 |
+ out.Reason = in.Reason |
|
| 417 |
+ out.Message = in.Message |
|
| 418 |
+ if err := convert_api_EventSource_To_v1beta3_EventSource(&in.Source, &out.Source, s); err != nil {
|
|
| 419 |
+ return err |
|
| 420 |
+ } |
|
| 421 |
+ if err := s.Convert(&in.FirstTimestamp, &out.FirstTimestamp, 0); err != nil {
|
|
| 422 |
+ return err |
|
| 423 |
+ } |
|
| 424 |
+ if err := s.Convert(&in.LastTimestamp, &out.LastTimestamp, 0); err != nil {
|
|
| 425 |
+ return err |
|
| 426 |
+ } |
|
| 427 |
+ out.Count = in.Count |
|
| 428 |
+ return nil |
|
| 429 |
+} |
|
| 430 |
+ |
|
| 431 |
+func convert_api_EventList_To_v1beta3_EventList(in *api.EventList, out *EventList, s conversion.Scope) error {
|
|
| 432 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 433 |
+ defaulting.(func(*api.EventList))(in) |
|
| 434 |
+ } |
|
| 435 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 436 |
+ return err |
|
| 437 |
+ } |
|
| 438 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 439 |
+ return err |
|
| 440 |
+ } |
|
| 441 |
+ if in.Items != nil {
|
|
| 442 |
+ out.Items = make([]Event, len(in.Items)) |
|
| 443 |
+ for i := range in.Items {
|
|
| 444 |
+ if err := convert_api_Event_To_v1beta3_Event(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 445 |
+ return err |
|
| 446 |
+ } |
|
| 447 |
+ } |
|
| 448 |
+ } else {
|
|
| 449 |
+ out.Items = nil |
|
| 450 |
+ } |
|
| 451 |
+ return nil |
|
| 452 |
+} |
|
| 453 |
+ |
|
| 454 |
+func convert_api_EventSource_To_v1beta3_EventSource(in *api.EventSource, out *EventSource, s conversion.Scope) error {
|
|
| 455 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 456 |
+ defaulting.(func(*api.EventSource))(in) |
|
| 457 |
+ } |
|
| 458 |
+ out.Component = in.Component |
|
| 459 |
+ out.Host = in.Host |
|
| 460 |
+ return nil |
|
| 461 |
+} |
|
| 462 |
+ |
|
| 463 |
+func convert_api_ExecAction_To_v1beta3_ExecAction(in *api.ExecAction, out *ExecAction, s conversion.Scope) error {
|
|
| 464 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 465 |
+ defaulting.(func(*api.ExecAction))(in) |
|
| 466 |
+ } |
|
| 467 |
+ if in.Command != nil {
|
|
| 468 |
+ out.Command = make([]string, len(in.Command)) |
|
| 469 |
+ for i := range in.Command {
|
|
| 470 |
+ out.Command[i] = in.Command[i] |
|
| 471 |
+ } |
|
| 472 |
+ } else {
|
|
| 473 |
+ out.Command = nil |
|
| 474 |
+ } |
|
| 475 |
+ return nil |
|
| 476 |
+} |
|
| 477 |
+ |
|
| 478 |
+func convert_api_GCEPersistentDiskVolumeSource_To_v1beta3_GCEPersistentDiskVolumeSource(in *api.GCEPersistentDiskVolumeSource, out *GCEPersistentDiskVolumeSource, s conversion.Scope) error {
|
|
| 479 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 480 |
+ defaulting.(func(*api.GCEPersistentDiskVolumeSource))(in) |
|
| 481 |
+ } |
|
| 482 |
+ out.PDName = in.PDName |
|
| 483 |
+ out.FSType = in.FSType |
|
| 484 |
+ out.Partition = in.Partition |
|
| 485 |
+ out.ReadOnly = in.ReadOnly |
|
| 486 |
+ return nil |
|
| 487 |
+} |
|
| 488 |
+ |
|
| 489 |
+func convert_api_GitRepoVolumeSource_To_v1beta3_GitRepoVolumeSource(in *api.GitRepoVolumeSource, out *GitRepoVolumeSource, s conversion.Scope) error {
|
|
| 490 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 491 |
+ defaulting.(func(*api.GitRepoVolumeSource))(in) |
|
| 492 |
+ } |
|
| 493 |
+ out.Repository = in.Repository |
|
| 494 |
+ out.Revision = in.Revision |
|
| 495 |
+ return nil |
|
| 496 |
+} |
|
| 497 |
+ |
|
| 498 |
+func convert_api_GlusterfsVolumeSource_To_v1beta3_GlusterfsVolumeSource(in *api.GlusterfsVolumeSource, out *GlusterfsVolumeSource, s conversion.Scope) error {
|
|
| 499 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 500 |
+ defaulting.(func(*api.GlusterfsVolumeSource))(in) |
|
| 501 |
+ } |
|
| 502 |
+ out.EndpointsName = in.EndpointsName |
|
| 503 |
+ out.Path = in.Path |
|
| 504 |
+ out.ReadOnly = in.ReadOnly |
|
| 505 |
+ return nil |
|
| 506 |
+} |
|
| 507 |
+ |
|
| 508 |
+func convert_api_HTTPGetAction_To_v1beta3_HTTPGetAction(in *api.HTTPGetAction, out *HTTPGetAction, s conversion.Scope) error {
|
|
| 509 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 510 |
+ defaulting.(func(*api.HTTPGetAction))(in) |
|
| 511 |
+ } |
|
| 512 |
+ out.Path = in.Path |
|
| 513 |
+ if err := s.Convert(&in.Port, &out.Port, 0); err != nil {
|
|
| 514 |
+ return err |
|
| 515 |
+ } |
|
| 516 |
+ out.Host = in.Host |
|
| 517 |
+ out.Scheme = URIScheme(in.Scheme) |
|
| 518 |
+ return nil |
|
| 519 |
+} |
|
| 520 |
+ |
|
| 521 |
+func convert_api_Handler_To_v1beta3_Handler(in *api.Handler, out *Handler, s conversion.Scope) error {
|
|
| 522 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 523 |
+ defaulting.(func(*api.Handler))(in) |
|
| 524 |
+ } |
|
| 525 |
+ if in.Exec != nil {
|
|
| 526 |
+ out.Exec = new(ExecAction) |
|
| 527 |
+ if err := convert_api_ExecAction_To_v1beta3_ExecAction(in.Exec, out.Exec, s); err != nil {
|
|
| 528 |
+ return err |
|
| 529 |
+ } |
|
| 530 |
+ } else {
|
|
| 531 |
+ out.Exec = nil |
|
| 532 |
+ } |
|
| 533 |
+ if in.HTTPGet != nil {
|
|
| 534 |
+ out.HTTPGet = new(HTTPGetAction) |
|
| 535 |
+ if err := convert_api_HTTPGetAction_To_v1beta3_HTTPGetAction(in.HTTPGet, out.HTTPGet, s); err != nil {
|
|
| 536 |
+ return err |
|
| 537 |
+ } |
|
| 538 |
+ } else {
|
|
| 539 |
+ out.HTTPGet = nil |
|
| 540 |
+ } |
|
| 541 |
+ if in.TCPSocket != nil {
|
|
| 542 |
+ out.TCPSocket = new(TCPSocketAction) |
|
| 543 |
+ if err := convert_api_TCPSocketAction_To_v1beta3_TCPSocketAction(in.TCPSocket, out.TCPSocket, s); err != nil {
|
|
| 544 |
+ return err |
|
| 545 |
+ } |
|
| 546 |
+ } else {
|
|
| 547 |
+ out.TCPSocket = nil |
|
| 548 |
+ } |
|
| 549 |
+ return nil |
|
| 550 |
+} |
|
| 551 |
+ |
|
| 552 |
+func convert_api_HostPathVolumeSource_To_v1beta3_HostPathVolumeSource(in *api.HostPathVolumeSource, out *HostPathVolumeSource, s conversion.Scope) error {
|
|
| 553 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 554 |
+ defaulting.(func(*api.HostPathVolumeSource))(in) |
|
| 555 |
+ } |
|
| 556 |
+ out.Path = in.Path |
|
| 557 |
+ return nil |
|
| 558 |
+} |
|
| 559 |
+ |
|
| 560 |
+func convert_api_ISCSIVolumeSource_To_v1beta3_ISCSIVolumeSource(in *api.ISCSIVolumeSource, out *ISCSIVolumeSource, s conversion.Scope) error {
|
|
| 561 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 562 |
+ defaulting.(func(*api.ISCSIVolumeSource))(in) |
|
| 563 |
+ } |
|
| 564 |
+ out.TargetPortal = in.TargetPortal |
|
| 565 |
+ out.IQN = in.IQN |
|
| 566 |
+ out.Lun = in.Lun |
|
| 567 |
+ out.FSType = in.FSType |
|
| 568 |
+ out.ReadOnly = in.ReadOnly |
|
| 569 |
+ return nil |
|
| 570 |
+} |
|
| 571 |
+ |
|
| 572 |
+func convert_api_Lifecycle_To_v1beta3_Lifecycle(in *api.Lifecycle, out *Lifecycle, s conversion.Scope) error {
|
|
| 573 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 574 |
+ defaulting.(func(*api.Lifecycle))(in) |
|
| 575 |
+ } |
|
| 576 |
+ if in.PostStart != nil {
|
|
| 577 |
+ out.PostStart = new(Handler) |
|
| 578 |
+ if err := convert_api_Handler_To_v1beta3_Handler(in.PostStart, out.PostStart, s); err != nil {
|
|
| 579 |
+ return err |
|
| 580 |
+ } |
|
| 581 |
+ } else {
|
|
| 582 |
+ out.PostStart = nil |
|
| 583 |
+ } |
|
| 584 |
+ if in.PreStop != nil {
|
|
| 585 |
+ out.PreStop = new(Handler) |
|
| 586 |
+ if err := convert_api_Handler_To_v1beta3_Handler(in.PreStop, out.PreStop, s); err != nil {
|
|
| 587 |
+ return err |
|
| 588 |
+ } |
|
| 589 |
+ } else {
|
|
| 590 |
+ out.PreStop = nil |
|
| 591 |
+ } |
|
| 592 |
+ return nil |
|
| 593 |
+} |
|
| 594 |
+ |
|
| 595 |
+func convert_api_LimitRange_To_v1beta3_LimitRange(in *api.LimitRange, out *LimitRange, s conversion.Scope) error {
|
|
| 596 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 597 |
+ defaulting.(func(*api.LimitRange))(in) |
|
| 598 |
+ } |
|
| 599 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 600 |
+ return err |
|
| 601 |
+ } |
|
| 602 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 603 |
+ return err |
|
| 604 |
+ } |
|
| 605 |
+ if err := convert_api_LimitRangeSpec_To_v1beta3_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 606 |
+ return err |
|
| 607 |
+ } |
|
| 608 |
+ return nil |
|
| 609 |
+} |
|
| 610 |
+ |
|
| 611 |
+func convert_api_LimitRangeItem_To_v1beta3_LimitRangeItem(in *api.LimitRangeItem, out *LimitRangeItem, s conversion.Scope) error {
|
|
| 612 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 613 |
+ defaulting.(func(*api.LimitRangeItem))(in) |
|
| 614 |
+ } |
|
| 615 |
+ out.Type = LimitType(in.Type) |
|
| 616 |
+ if in.Max != nil {
|
|
| 617 |
+ out.Max = make(ResourceList) |
|
| 618 |
+ for key, val := range in.Max {
|
|
| 619 |
+ newVal := resource.Quantity{}
|
|
| 620 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 621 |
+ return err |
|
| 622 |
+ } |
|
| 623 |
+ out.Max[ResourceName(key)] = newVal |
|
| 624 |
+ } |
|
| 625 |
+ } else {
|
|
| 626 |
+ out.Max = nil |
|
| 627 |
+ } |
|
| 628 |
+ if in.Min != nil {
|
|
| 629 |
+ out.Min = make(ResourceList) |
|
| 630 |
+ for key, val := range in.Min {
|
|
| 631 |
+ newVal := resource.Quantity{}
|
|
| 632 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 633 |
+ return err |
|
| 634 |
+ } |
|
| 635 |
+ out.Min[ResourceName(key)] = newVal |
|
| 636 |
+ } |
|
| 637 |
+ } else {
|
|
| 638 |
+ out.Min = nil |
|
| 639 |
+ } |
|
| 640 |
+ if in.Default != nil {
|
|
| 641 |
+ out.Default = make(ResourceList) |
|
| 642 |
+ for key, val := range in.Default {
|
|
| 643 |
+ newVal := resource.Quantity{}
|
|
| 644 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 645 |
+ return err |
|
| 646 |
+ } |
|
| 647 |
+ out.Default[ResourceName(key)] = newVal |
|
| 648 |
+ } |
|
| 649 |
+ } else {
|
|
| 650 |
+ out.Default = nil |
|
| 651 |
+ } |
|
| 652 |
+ if in.DefaultRequest != nil {
|
|
| 653 |
+ out.DefaultRequest = make(ResourceList) |
|
| 654 |
+ for key, val := range in.DefaultRequest {
|
|
| 655 |
+ newVal := resource.Quantity{}
|
|
| 656 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 657 |
+ return err |
|
| 658 |
+ } |
|
| 659 |
+ out.DefaultRequest[ResourceName(key)] = newVal |
|
| 660 |
+ } |
|
| 661 |
+ } else {
|
|
| 662 |
+ out.DefaultRequest = nil |
|
| 663 |
+ } |
|
| 664 |
+ if in.MaxLimitRequestRatio != nil {
|
|
| 665 |
+ out.MaxLimitRequestRatio = make(ResourceList) |
|
| 666 |
+ for key, val := range in.MaxLimitRequestRatio {
|
|
| 667 |
+ newVal := resource.Quantity{}
|
|
| 668 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 669 |
+ return err |
|
| 670 |
+ } |
|
| 671 |
+ out.MaxLimitRequestRatio[ResourceName(key)] = newVal |
|
| 672 |
+ } |
|
| 673 |
+ } else {
|
|
| 674 |
+ out.MaxLimitRequestRatio = nil |
|
| 675 |
+ } |
|
| 676 |
+ return nil |
|
| 677 |
+} |
|
| 678 |
+ |
|
| 679 |
+func convert_api_LimitRangeList_To_v1beta3_LimitRangeList(in *api.LimitRangeList, out *LimitRangeList, s conversion.Scope) error {
|
|
| 680 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 681 |
+ defaulting.(func(*api.LimitRangeList))(in) |
|
| 682 |
+ } |
|
| 683 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 684 |
+ return err |
|
| 685 |
+ } |
|
| 686 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 687 |
+ return err |
|
| 688 |
+ } |
|
| 689 |
+ if in.Items != nil {
|
|
| 690 |
+ out.Items = make([]LimitRange, len(in.Items)) |
|
| 691 |
+ for i := range in.Items {
|
|
| 692 |
+ if err := convert_api_LimitRange_To_v1beta3_LimitRange(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 693 |
+ return err |
|
| 694 |
+ } |
|
| 695 |
+ } |
|
| 696 |
+ } else {
|
|
| 697 |
+ out.Items = nil |
|
| 698 |
+ } |
|
| 699 |
+ return nil |
|
| 700 |
+} |
|
| 701 |
+ |
|
| 702 |
+func convert_api_LimitRangeSpec_To_v1beta3_LimitRangeSpec(in *api.LimitRangeSpec, out *LimitRangeSpec, s conversion.Scope) error {
|
|
| 703 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 704 |
+ defaulting.(func(*api.LimitRangeSpec))(in) |
|
| 705 |
+ } |
|
| 706 |
+ if in.Limits != nil {
|
|
| 707 |
+ out.Limits = make([]LimitRangeItem, len(in.Limits)) |
|
| 708 |
+ for i := range in.Limits {
|
|
| 709 |
+ if err := convert_api_LimitRangeItem_To_v1beta3_LimitRangeItem(&in.Limits[i], &out.Limits[i], s); err != nil {
|
|
| 710 |
+ return err |
|
| 711 |
+ } |
|
| 712 |
+ } |
|
| 713 |
+ } else {
|
|
| 714 |
+ out.Limits = nil |
|
| 715 |
+ } |
|
| 716 |
+ return nil |
|
| 717 |
+} |
|
| 718 |
+ |
|
| 719 |
+func convert_api_List_To_v1beta3_List(in *api.List, out *List, s conversion.Scope) error {
|
|
| 720 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 721 |
+ defaulting.(func(*api.List))(in) |
|
| 722 |
+ } |
|
| 723 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 724 |
+ return err |
|
| 725 |
+ } |
|
| 726 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 727 |
+ return err |
|
| 728 |
+ } |
|
| 729 |
+ if err := s.Convert(&in.Items, &out.Items, 0); err != nil {
|
|
| 730 |
+ return err |
|
| 731 |
+ } |
|
| 732 |
+ return nil |
|
| 733 |
+} |
|
| 734 |
+ |
|
| 735 |
+func convert_api_ListMeta_To_v1beta3_ListMeta(in *api.ListMeta, out *ListMeta, s conversion.Scope) error {
|
|
| 736 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 737 |
+ defaulting.(func(*api.ListMeta))(in) |
|
| 738 |
+ } |
|
| 739 |
+ out.SelfLink = in.SelfLink |
|
| 740 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 741 |
+ return nil |
|
| 742 |
+} |
|
| 743 |
+ |
|
| 744 |
+func convert_api_ListOptions_To_v1beta3_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error {
|
|
| 745 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 746 |
+ defaulting.(func(*api.ListOptions))(in) |
|
| 747 |
+ } |
|
| 748 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 749 |
+ return err |
|
| 750 |
+ } |
|
| 751 |
+ if err := s.Convert(&in.LabelSelector, &out.LabelSelector, 0); err != nil {
|
|
| 752 |
+ return err |
|
| 753 |
+ } |
|
| 754 |
+ if err := s.Convert(&in.FieldSelector, &out.FieldSelector, 0); err != nil {
|
|
| 755 |
+ return err |
|
| 756 |
+ } |
|
| 757 |
+ out.Watch = in.Watch |
|
| 758 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 759 |
+ return nil |
|
| 760 |
+} |
|
| 761 |
+ |
|
| 762 |
+func convert_api_LoadBalancerIngress_To_v1beta3_LoadBalancerIngress(in *api.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error {
|
|
| 763 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 764 |
+ defaulting.(func(*api.LoadBalancerIngress))(in) |
|
| 765 |
+ } |
|
| 766 |
+ out.IP = in.IP |
|
| 767 |
+ out.Hostname = in.Hostname |
|
| 768 |
+ return nil |
|
| 769 |
+} |
|
| 770 |
+ |
|
| 771 |
+func convert_api_LoadBalancerStatus_To_v1beta3_LoadBalancerStatus(in *api.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error {
|
|
| 772 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 773 |
+ defaulting.(func(*api.LoadBalancerStatus))(in) |
|
| 774 |
+ } |
|
| 775 |
+ if in.Ingress != nil {
|
|
| 776 |
+ out.Ingress = make([]LoadBalancerIngress, len(in.Ingress)) |
|
| 777 |
+ for i := range in.Ingress {
|
|
| 778 |
+ if err := convert_api_LoadBalancerIngress_To_v1beta3_LoadBalancerIngress(&in.Ingress[i], &out.Ingress[i], s); err != nil {
|
|
| 779 |
+ return err |
|
| 780 |
+ } |
|
| 781 |
+ } |
|
| 782 |
+ } else {
|
|
| 783 |
+ out.Ingress = nil |
|
| 784 |
+ } |
|
| 785 |
+ return nil |
|
| 786 |
+} |
|
| 787 |
+ |
|
| 788 |
+func convert_api_LocalObjectReference_To_v1beta3_LocalObjectReference(in *api.LocalObjectReference, out *LocalObjectReference, s conversion.Scope) error {
|
|
| 789 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 790 |
+ defaulting.(func(*api.LocalObjectReference))(in) |
|
| 791 |
+ } |
|
| 792 |
+ out.Name = in.Name |
|
| 793 |
+ return nil |
|
| 794 |
+} |
|
| 795 |
+ |
|
| 796 |
+func convert_api_NFSVolumeSource_To_v1beta3_NFSVolumeSource(in *api.NFSVolumeSource, out *NFSVolumeSource, s conversion.Scope) error {
|
|
| 797 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 798 |
+ defaulting.(func(*api.NFSVolumeSource))(in) |
|
| 799 |
+ } |
|
| 800 |
+ out.Server = in.Server |
|
| 801 |
+ out.Path = in.Path |
|
| 802 |
+ out.ReadOnly = in.ReadOnly |
|
| 803 |
+ return nil |
|
| 804 |
+} |
|
| 805 |
+ |
|
| 806 |
+func convert_api_Namespace_To_v1beta3_Namespace(in *api.Namespace, out *Namespace, s conversion.Scope) error {
|
|
| 807 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 808 |
+ defaulting.(func(*api.Namespace))(in) |
|
| 809 |
+ } |
|
| 810 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 811 |
+ return err |
|
| 812 |
+ } |
|
| 813 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 814 |
+ return err |
|
| 815 |
+ } |
|
| 816 |
+ if err := convert_api_NamespaceSpec_To_v1beta3_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 817 |
+ return err |
|
| 818 |
+ } |
|
| 819 |
+ if err := convert_api_NamespaceStatus_To_v1beta3_NamespaceStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 820 |
+ return err |
|
| 821 |
+ } |
|
| 822 |
+ return nil |
|
| 823 |
+} |
|
| 824 |
+ |
|
| 825 |
+func convert_api_NamespaceList_To_v1beta3_NamespaceList(in *api.NamespaceList, out *NamespaceList, s conversion.Scope) error {
|
|
| 826 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 827 |
+ defaulting.(func(*api.NamespaceList))(in) |
|
| 828 |
+ } |
|
| 829 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 830 |
+ return err |
|
| 831 |
+ } |
|
| 832 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 833 |
+ return err |
|
| 834 |
+ } |
|
| 835 |
+ if in.Items != nil {
|
|
| 836 |
+ out.Items = make([]Namespace, len(in.Items)) |
|
| 837 |
+ for i := range in.Items {
|
|
| 838 |
+ if err := convert_api_Namespace_To_v1beta3_Namespace(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 839 |
+ return err |
|
| 840 |
+ } |
|
| 841 |
+ } |
|
| 842 |
+ } else {
|
|
| 843 |
+ out.Items = nil |
|
| 844 |
+ } |
|
| 845 |
+ return nil |
|
| 846 |
+} |
|
| 847 |
+ |
|
| 848 |
+func convert_api_NamespaceSpec_To_v1beta3_NamespaceSpec(in *api.NamespaceSpec, out *NamespaceSpec, s conversion.Scope) error {
|
|
| 849 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 850 |
+ defaulting.(func(*api.NamespaceSpec))(in) |
|
| 851 |
+ } |
|
| 852 |
+ if in.Finalizers != nil {
|
|
| 853 |
+ out.Finalizers = make([]FinalizerName, len(in.Finalizers)) |
|
| 854 |
+ for i := range in.Finalizers {
|
|
| 855 |
+ out.Finalizers[i] = FinalizerName(in.Finalizers[i]) |
|
| 856 |
+ } |
|
| 857 |
+ } else {
|
|
| 858 |
+ out.Finalizers = nil |
|
| 859 |
+ } |
|
| 860 |
+ return nil |
|
| 861 |
+} |
|
| 862 |
+ |
|
| 863 |
+func convert_api_NamespaceStatus_To_v1beta3_NamespaceStatus(in *api.NamespaceStatus, out *NamespaceStatus, s conversion.Scope) error {
|
|
| 864 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 865 |
+ defaulting.(func(*api.NamespaceStatus))(in) |
|
| 866 |
+ } |
|
| 867 |
+ out.Phase = NamespacePhase(in.Phase) |
|
| 868 |
+ return nil |
|
| 869 |
+} |
|
| 870 |
+ |
|
| 871 |
+func convert_api_Node_To_v1beta3_Node(in *api.Node, out *Node, s conversion.Scope) error {
|
|
| 872 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 873 |
+ defaulting.(func(*api.Node))(in) |
|
| 874 |
+ } |
|
| 875 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 876 |
+ return err |
|
| 877 |
+ } |
|
| 878 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 879 |
+ return err |
|
| 880 |
+ } |
|
| 881 |
+ if err := convert_api_NodeSpec_To_v1beta3_NodeSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 882 |
+ return err |
|
| 883 |
+ } |
|
| 884 |
+ if err := convert_api_NodeStatus_To_v1beta3_NodeStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 885 |
+ return err |
|
| 886 |
+ } |
|
| 887 |
+ return nil |
|
| 888 |
+} |
|
| 889 |
+ |
|
| 890 |
+func convert_api_NodeAddress_To_v1beta3_NodeAddress(in *api.NodeAddress, out *NodeAddress, s conversion.Scope) error {
|
|
| 891 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 892 |
+ defaulting.(func(*api.NodeAddress))(in) |
|
| 893 |
+ } |
|
| 894 |
+ out.Type = NodeAddressType(in.Type) |
|
| 895 |
+ out.Address = in.Address |
|
| 896 |
+ return nil |
|
| 897 |
+} |
|
| 898 |
+ |
|
| 899 |
+func convert_api_NodeCondition_To_v1beta3_NodeCondition(in *api.NodeCondition, out *NodeCondition, s conversion.Scope) error {
|
|
| 900 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 901 |
+ defaulting.(func(*api.NodeCondition))(in) |
|
| 902 |
+ } |
|
| 903 |
+ out.Type = NodeConditionType(in.Type) |
|
| 904 |
+ out.Status = ConditionStatus(in.Status) |
|
| 905 |
+ if err := s.Convert(&in.LastHeartbeatTime, &out.LastHeartbeatTime, 0); err != nil {
|
|
| 906 |
+ return err |
|
| 907 |
+ } |
|
| 908 |
+ if err := s.Convert(&in.LastTransitionTime, &out.LastTransitionTime, 0); err != nil {
|
|
| 909 |
+ return err |
|
| 910 |
+ } |
|
| 911 |
+ out.Reason = in.Reason |
|
| 912 |
+ out.Message = in.Message |
|
| 913 |
+ return nil |
|
| 914 |
+} |
|
| 915 |
+ |
|
| 916 |
+func convert_api_NodeList_To_v1beta3_NodeList(in *api.NodeList, out *NodeList, s conversion.Scope) error {
|
|
| 917 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 918 |
+ defaulting.(func(*api.NodeList))(in) |
|
| 919 |
+ } |
|
| 920 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 921 |
+ return err |
|
| 922 |
+ } |
|
| 923 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 924 |
+ return err |
|
| 925 |
+ } |
|
| 926 |
+ if in.Items != nil {
|
|
| 927 |
+ out.Items = make([]Node, len(in.Items)) |
|
| 928 |
+ for i := range in.Items {
|
|
| 929 |
+ if err := convert_api_Node_To_v1beta3_Node(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 930 |
+ return err |
|
| 931 |
+ } |
|
| 932 |
+ } |
|
| 933 |
+ } else {
|
|
| 934 |
+ out.Items = nil |
|
| 935 |
+ } |
|
| 936 |
+ return nil |
|
| 937 |
+} |
|
| 938 |
+ |
|
| 939 |
+func convert_api_NodeSpec_To_v1beta3_NodeSpec(in *api.NodeSpec, out *NodeSpec, s conversion.Scope) error {
|
|
| 940 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 941 |
+ defaulting.(func(*api.NodeSpec))(in) |
|
| 942 |
+ } |
|
| 943 |
+ out.PodCIDR = in.PodCIDR |
|
| 944 |
+ out.ExternalID = in.ExternalID |
|
| 945 |
+ out.ProviderID = in.ProviderID |
|
| 946 |
+ out.Unschedulable = in.Unschedulable |
|
| 947 |
+ return nil |
|
| 948 |
+} |
|
| 949 |
+ |
|
| 950 |
+func convert_api_NodeStatus_To_v1beta3_NodeStatus(in *api.NodeStatus, out *NodeStatus, s conversion.Scope) error {
|
|
| 951 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 952 |
+ defaulting.(func(*api.NodeStatus))(in) |
|
| 953 |
+ } |
|
| 954 |
+ if in.Capacity != nil {
|
|
| 955 |
+ out.Capacity = make(ResourceList) |
|
| 956 |
+ for key, val := range in.Capacity {
|
|
| 957 |
+ newVal := resource.Quantity{}
|
|
| 958 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 959 |
+ return err |
|
| 960 |
+ } |
|
| 961 |
+ out.Capacity[ResourceName(key)] = newVal |
|
| 962 |
+ } |
|
| 963 |
+ } else {
|
|
| 964 |
+ out.Capacity = nil |
|
| 965 |
+ } |
|
| 966 |
+ out.Phase = NodePhase(in.Phase) |
|
| 967 |
+ if in.Conditions != nil {
|
|
| 968 |
+ out.Conditions = make([]NodeCondition, len(in.Conditions)) |
|
| 969 |
+ for i := range in.Conditions {
|
|
| 970 |
+ if err := convert_api_NodeCondition_To_v1beta3_NodeCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
|
| 971 |
+ return err |
|
| 972 |
+ } |
|
| 973 |
+ } |
|
| 974 |
+ } else {
|
|
| 975 |
+ out.Conditions = nil |
|
| 976 |
+ } |
|
| 977 |
+ if in.Addresses != nil {
|
|
| 978 |
+ out.Addresses = make([]NodeAddress, len(in.Addresses)) |
|
| 979 |
+ for i := range in.Addresses {
|
|
| 980 |
+ if err := convert_api_NodeAddress_To_v1beta3_NodeAddress(&in.Addresses[i], &out.Addresses[i], s); err != nil {
|
|
| 981 |
+ return err |
|
| 982 |
+ } |
|
| 983 |
+ } |
|
| 984 |
+ } else {
|
|
| 985 |
+ out.Addresses = nil |
|
| 986 |
+ } |
|
| 987 |
+ if err := convert_api_NodeSystemInfo_To_v1beta3_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil {
|
|
| 988 |
+ return err |
|
| 989 |
+ } |
|
| 990 |
+ return nil |
|
| 991 |
+} |
|
| 992 |
+ |
|
| 993 |
+func convert_api_NodeSystemInfo_To_v1beta3_NodeSystemInfo(in *api.NodeSystemInfo, out *NodeSystemInfo, s conversion.Scope) error {
|
|
| 994 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 995 |
+ defaulting.(func(*api.NodeSystemInfo))(in) |
|
| 996 |
+ } |
|
| 997 |
+ out.MachineID = in.MachineID |
|
| 998 |
+ out.SystemUUID = in.SystemUUID |
|
| 999 |
+ out.BootID = in.BootID |
|
| 1000 |
+ out.KernelVersion = in.KernelVersion |
|
| 1001 |
+ out.OsImage = in.OsImage |
|
| 1002 |
+ out.ContainerRuntimeVersion = in.ContainerRuntimeVersion |
|
| 1003 |
+ out.KubeletVersion = in.KubeletVersion |
|
| 1004 |
+ out.KubeProxyVersion = in.KubeProxyVersion |
|
| 1005 |
+ return nil |
|
| 1006 |
+} |
|
| 1007 |
+ |
|
| 1008 |
+func convert_api_ObjectFieldSelector_To_v1beta3_ObjectFieldSelector(in *api.ObjectFieldSelector, out *ObjectFieldSelector, s conversion.Scope) error {
|
|
| 1009 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1010 |
+ defaulting.(func(*api.ObjectFieldSelector))(in) |
|
| 1011 |
+ } |
|
| 1012 |
+ out.APIVersion = in.APIVersion |
|
| 1013 |
+ out.FieldPath = in.FieldPath |
|
| 1014 |
+ return nil |
|
| 1015 |
+} |
|
| 1016 |
+ |
|
| 1017 |
+func convert_api_ObjectMeta_To_v1beta3_ObjectMeta(in *api.ObjectMeta, out *ObjectMeta, s conversion.Scope) error {
|
|
| 1018 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1019 |
+ defaulting.(func(*api.ObjectMeta))(in) |
|
| 1020 |
+ } |
|
| 1021 |
+ out.Name = in.Name |
|
| 1022 |
+ out.GenerateName = in.GenerateName |
|
| 1023 |
+ out.Namespace = in.Namespace |
|
| 1024 |
+ out.SelfLink = in.SelfLink |
|
| 1025 |
+ out.UID = in.UID |
|
| 1026 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 1027 |
+ out.Generation = in.Generation |
|
| 1028 |
+ if err := s.Convert(&in.CreationTimestamp, &out.CreationTimestamp, 0); err != nil {
|
|
| 1029 |
+ return err |
|
| 1030 |
+ } |
|
| 1031 |
+ if in.DeletionTimestamp != nil {
|
|
| 1032 |
+ if err := s.Convert(&in.DeletionTimestamp, &out.DeletionTimestamp, 0); err != nil {
|
|
| 1033 |
+ return err |
|
| 1034 |
+ } |
|
| 1035 |
+ } else {
|
|
| 1036 |
+ out.DeletionTimestamp = nil |
|
| 1037 |
+ } |
|
| 1038 |
+ if in.DeletionGracePeriodSeconds != nil {
|
|
| 1039 |
+ out.DeletionGracePeriodSeconds = new(int64) |
|
| 1040 |
+ *out.DeletionGracePeriodSeconds = *in.DeletionGracePeriodSeconds |
|
| 1041 |
+ } else {
|
|
| 1042 |
+ out.DeletionGracePeriodSeconds = nil |
|
| 1043 |
+ } |
|
| 1044 |
+ if in.Labels != nil {
|
|
| 1045 |
+ out.Labels = make(map[string]string) |
|
| 1046 |
+ for key, val := range in.Labels {
|
|
| 1047 |
+ out.Labels[key] = val |
|
| 1048 |
+ } |
|
| 1049 |
+ } else {
|
|
| 1050 |
+ out.Labels = nil |
|
| 1051 |
+ } |
|
| 1052 |
+ if in.Annotations != nil {
|
|
| 1053 |
+ out.Annotations = make(map[string]string) |
|
| 1054 |
+ for key, val := range in.Annotations {
|
|
| 1055 |
+ out.Annotations[key] = val |
|
| 1056 |
+ } |
|
| 1057 |
+ } else {
|
|
| 1058 |
+ out.Annotations = nil |
|
| 1059 |
+ } |
|
| 1060 |
+ return nil |
|
| 1061 |
+} |
|
| 1062 |
+ |
|
| 1063 |
+func convert_api_ObjectReference_To_v1beta3_ObjectReference(in *api.ObjectReference, out *ObjectReference, s conversion.Scope) error {
|
|
| 1064 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1065 |
+ defaulting.(func(*api.ObjectReference))(in) |
|
| 1066 |
+ } |
|
| 1067 |
+ out.Kind = in.Kind |
|
| 1068 |
+ out.Namespace = in.Namespace |
|
| 1069 |
+ out.Name = in.Name |
|
| 1070 |
+ out.UID = in.UID |
|
| 1071 |
+ out.APIVersion = in.APIVersion |
|
| 1072 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 1073 |
+ out.FieldPath = in.FieldPath |
|
| 1074 |
+ return nil |
|
| 1075 |
+} |
|
| 1076 |
+ |
|
| 1077 |
+func convert_api_PersistentVolume_To_v1beta3_PersistentVolume(in *api.PersistentVolume, out *PersistentVolume, s conversion.Scope) error {
|
|
| 1078 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1079 |
+ defaulting.(func(*api.PersistentVolume))(in) |
|
| 1080 |
+ } |
|
| 1081 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1082 |
+ return err |
|
| 1083 |
+ } |
|
| 1084 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1085 |
+ return err |
|
| 1086 |
+ } |
|
| 1087 |
+ if err := convert_api_PersistentVolumeSpec_To_v1beta3_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 1088 |
+ return err |
|
| 1089 |
+ } |
|
| 1090 |
+ if err := convert_api_PersistentVolumeStatus_To_v1beta3_PersistentVolumeStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 1091 |
+ return err |
|
| 1092 |
+ } |
|
| 1093 |
+ return nil |
|
| 1094 |
+} |
|
| 1095 |
+ |
|
| 1096 |
+func convert_api_PersistentVolumeClaim_To_v1beta3_PersistentVolumeClaim(in *api.PersistentVolumeClaim, out *PersistentVolumeClaim, s conversion.Scope) error {
|
|
| 1097 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1098 |
+ defaulting.(func(*api.PersistentVolumeClaim))(in) |
|
| 1099 |
+ } |
|
| 1100 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1101 |
+ return err |
|
| 1102 |
+ } |
|
| 1103 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1104 |
+ return err |
|
| 1105 |
+ } |
|
| 1106 |
+ if err := convert_api_PersistentVolumeClaimSpec_To_v1beta3_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 1107 |
+ return err |
|
| 1108 |
+ } |
|
| 1109 |
+ if err := convert_api_PersistentVolumeClaimStatus_To_v1beta3_PersistentVolumeClaimStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 1110 |
+ return err |
|
| 1111 |
+ } |
|
| 1112 |
+ return nil |
|
| 1113 |
+} |
|
| 1114 |
+ |
|
| 1115 |
+func convert_api_PersistentVolumeClaimList_To_v1beta3_PersistentVolumeClaimList(in *api.PersistentVolumeClaimList, out *PersistentVolumeClaimList, s conversion.Scope) error {
|
|
| 1116 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1117 |
+ defaulting.(func(*api.PersistentVolumeClaimList))(in) |
|
| 1118 |
+ } |
|
| 1119 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1120 |
+ return err |
|
| 1121 |
+ } |
|
| 1122 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1123 |
+ return err |
|
| 1124 |
+ } |
|
| 1125 |
+ if in.Items != nil {
|
|
| 1126 |
+ out.Items = make([]PersistentVolumeClaim, len(in.Items)) |
|
| 1127 |
+ for i := range in.Items {
|
|
| 1128 |
+ if err := convert_api_PersistentVolumeClaim_To_v1beta3_PersistentVolumeClaim(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1129 |
+ return err |
|
| 1130 |
+ } |
|
| 1131 |
+ } |
|
| 1132 |
+ } else {
|
|
| 1133 |
+ out.Items = nil |
|
| 1134 |
+ } |
|
| 1135 |
+ return nil |
|
| 1136 |
+} |
|
| 1137 |
+ |
|
| 1138 |
+func convert_api_PersistentVolumeClaimSpec_To_v1beta3_PersistentVolumeClaimSpec(in *api.PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, s conversion.Scope) error {
|
|
| 1139 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1140 |
+ defaulting.(func(*api.PersistentVolumeClaimSpec))(in) |
|
| 1141 |
+ } |
|
| 1142 |
+ if in.AccessModes != nil {
|
|
| 1143 |
+ out.AccessModes = make([]PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 1144 |
+ for i := range in.AccessModes {
|
|
| 1145 |
+ out.AccessModes[i] = PersistentVolumeAccessMode(in.AccessModes[i]) |
|
| 1146 |
+ } |
|
| 1147 |
+ } else {
|
|
| 1148 |
+ out.AccessModes = nil |
|
| 1149 |
+ } |
|
| 1150 |
+ if err := convert_api_ResourceRequirements_To_v1beta3_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil {
|
|
| 1151 |
+ return err |
|
| 1152 |
+ } |
|
| 1153 |
+ out.VolumeName = in.VolumeName |
|
| 1154 |
+ return nil |
|
| 1155 |
+} |
|
| 1156 |
+ |
|
| 1157 |
+func convert_api_PersistentVolumeClaimStatus_To_v1beta3_PersistentVolumeClaimStatus(in *api.PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, s conversion.Scope) error {
|
|
| 1158 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1159 |
+ defaulting.(func(*api.PersistentVolumeClaimStatus))(in) |
|
| 1160 |
+ } |
|
| 1161 |
+ out.Phase = PersistentVolumeClaimPhase(in.Phase) |
|
| 1162 |
+ if in.AccessModes != nil {
|
|
| 1163 |
+ out.AccessModes = make([]PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 1164 |
+ for i := range in.AccessModes {
|
|
| 1165 |
+ out.AccessModes[i] = PersistentVolumeAccessMode(in.AccessModes[i]) |
|
| 1166 |
+ } |
|
| 1167 |
+ } else {
|
|
| 1168 |
+ out.AccessModes = nil |
|
| 1169 |
+ } |
|
| 1170 |
+ if in.Capacity != nil {
|
|
| 1171 |
+ out.Capacity = make(ResourceList) |
|
| 1172 |
+ for key, val := range in.Capacity {
|
|
| 1173 |
+ newVal := resource.Quantity{}
|
|
| 1174 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1175 |
+ return err |
|
| 1176 |
+ } |
|
| 1177 |
+ out.Capacity[ResourceName(key)] = newVal |
|
| 1178 |
+ } |
|
| 1179 |
+ } else {
|
|
| 1180 |
+ out.Capacity = nil |
|
| 1181 |
+ } |
|
| 1182 |
+ return nil |
|
| 1183 |
+} |
|
| 1184 |
+ |
|
| 1185 |
+func convert_api_PersistentVolumeClaimVolumeSource_To_v1beta3_PersistentVolumeClaimVolumeSource(in *api.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error {
|
|
| 1186 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1187 |
+ defaulting.(func(*api.PersistentVolumeClaimVolumeSource))(in) |
|
| 1188 |
+ } |
|
| 1189 |
+ out.ClaimName = in.ClaimName |
|
| 1190 |
+ out.ReadOnly = in.ReadOnly |
|
| 1191 |
+ return nil |
|
| 1192 |
+} |
|
| 1193 |
+ |
|
| 1194 |
+func convert_api_PersistentVolumeList_To_v1beta3_PersistentVolumeList(in *api.PersistentVolumeList, out *PersistentVolumeList, s conversion.Scope) error {
|
|
| 1195 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1196 |
+ defaulting.(func(*api.PersistentVolumeList))(in) |
|
| 1197 |
+ } |
|
| 1198 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1199 |
+ return err |
|
| 1200 |
+ } |
|
| 1201 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1202 |
+ return err |
|
| 1203 |
+ } |
|
| 1204 |
+ if in.Items != nil {
|
|
| 1205 |
+ out.Items = make([]PersistentVolume, len(in.Items)) |
|
| 1206 |
+ for i := range in.Items {
|
|
| 1207 |
+ if err := convert_api_PersistentVolume_To_v1beta3_PersistentVolume(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1208 |
+ return err |
|
| 1209 |
+ } |
|
| 1210 |
+ } |
|
| 1211 |
+ } else {
|
|
| 1212 |
+ out.Items = nil |
|
| 1213 |
+ } |
|
| 1214 |
+ return nil |
|
| 1215 |
+} |
|
| 1216 |
+ |
|
| 1217 |
+func convert_api_PersistentVolumeSource_To_v1beta3_PersistentVolumeSource(in *api.PersistentVolumeSource, out *PersistentVolumeSource, s conversion.Scope) error {
|
|
| 1218 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1219 |
+ defaulting.(func(*api.PersistentVolumeSource))(in) |
|
| 1220 |
+ } |
|
| 1221 |
+ if in.GCEPersistentDisk != nil {
|
|
| 1222 |
+ out.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) |
|
| 1223 |
+ if err := convert_api_GCEPersistentDiskVolumeSource_To_v1beta3_GCEPersistentDiskVolumeSource(in.GCEPersistentDisk, out.GCEPersistentDisk, s); err != nil {
|
|
| 1224 |
+ return err |
|
| 1225 |
+ } |
|
| 1226 |
+ } else {
|
|
| 1227 |
+ out.GCEPersistentDisk = nil |
|
| 1228 |
+ } |
|
| 1229 |
+ if in.AWSElasticBlockStore != nil {
|
|
| 1230 |
+ out.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) |
|
| 1231 |
+ if err := convert_api_AWSElasticBlockStoreVolumeSource_To_v1beta3_AWSElasticBlockStoreVolumeSource(in.AWSElasticBlockStore, out.AWSElasticBlockStore, s); err != nil {
|
|
| 1232 |
+ return err |
|
| 1233 |
+ } |
|
| 1234 |
+ } else {
|
|
| 1235 |
+ out.AWSElasticBlockStore = nil |
|
| 1236 |
+ } |
|
| 1237 |
+ if in.HostPath != nil {
|
|
| 1238 |
+ out.HostPath = new(HostPathVolumeSource) |
|
| 1239 |
+ if err := convert_api_HostPathVolumeSource_To_v1beta3_HostPathVolumeSource(in.HostPath, out.HostPath, s); err != nil {
|
|
| 1240 |
+ return err |
|
| 1241 |
+ } |
|
| 1242 |
+ } else {
|
|
| 1243 |
+ out.HostPath = nil |
|
| 1244 |
+ } |
|
| 1245 |
+ if in.Glusterfs != nil {
|
|
| 1246 |
+ out.Glusterfs = new(GlusterfsVolumeSource) |
|
| 1247 |
+ if err := convert_api_GlusterfsVolumeSource_To_v1beta3_GlusterfsVolumeSource(in.Glusterfs, out.Glusterfs, s); err != nil {
|
|
| 1248 |
+ return err |
|
| 1249 |
+ } |
|
| 1250 |
+ } else {
|
|
| 1251 |
+ out.Glusterfs = nil |
|
| 1252 |
+ } |
|
| 1253 |
+ if in.NFS != nil {
|
|
| 1254 |
+ out.NFS = new(NFSVolumeSource) |
|
| 1255 |
+ if err := convert_api_NFSVolumeSource_To_v1beta3_NFSVolumeSource(in.NFS, out.NFS, s); err != nil {
|
|
| 1256 |
+ return err |
|
| 1257 |
+ } |
|
| 1258 |
+ } else {
|
|
| 1259 |
+ out.NFS = nil |
|
| 1260 |
+ } |
|
| 1261 |
+ if in.RBD != nil {
|
|
| 1262 |
+ out.RBD = new(RBDVolumeSource) |
|
| 1263 |
+ if err := convert_api_RBDVolumeSource_To_v1beta3_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
|
| 1264 |
+ return err |
|
| 1265 |
+ } |
|
| 1266 |
+ } else {
|
|
| 1267 |
+ out.RBD = nil |
|
| 1268 |
+ } |
|
| 1269 |
+ if in.ISCSI != nil {
|
|
| 1270 |
+ out.ISCSI = new(ISCSIVolumeSource) |
|
| 1271 |
+ if err := convert_api_ISCSIVolumeSource_To_v1beta3_ISCSIVolumeSource(in.ISCSI, out.ISCSI, s); err != nil {
|
|
| 1272 |
+ return err |
|
| 1273 |
+ } |
|
| 1274 |
+ } else {
|
|
| 1275 |
+ out.ISCSI = nil |
|
| 1276 |
+ } |
|
| 1277 |
+ if in.Cinder != nil {
|
|
| 1278 |
+ out.Cinder = new(CinderVolumeSource) |
|
| 1279 |
+ if err := convert_api_CinderVolumeSource_To_v1beta3_CinderVolumeSource(in.Cinder, out.Cinder, s); err != nil {
|
|
| 1280 |
+ return err |
|
| 1281 |
+ } |
|
| 1282 |
+ } else {
|
|
| 1283 |
+ out.Cinder = nil |
|
| 1284 |
+ } |
|
| 1285 |
+ if in.CephFS != nil {
|
|
| 1286 |
+ out.CephFS = new(CephFSVolumeSource) |
|
| 1287 |
+ if err := convert_api_CephFSVolumeSource_To_v1beta3_CephFSVolumeSource(in.CephFS, out.CephFS, s); err != nil {
|
|
| 1288 |
+ return err |
|
| 1289 |
+ } |
|
| 1290 |
+ } else {
|
|
| 1291 |
+ out.CephFS = nil |
|
| 1292 |
+ } |
|
| 1293 |
+ return nil |
|
| 1294 |
+} |
|
| 1295 |
+ |
|
| 1296 |
+func convert_api_PersistentVolumeSpec_To_v1beta3_PersistentVolumeSpec(in *api.PersistentVolumeSpec, out *PersistentVolumeSpec, s conversion.Scope) error {
|
|
| 1297 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1298 |
+ defaulting.(func(*api.PersistentVolumeSpec))(in) |
|
| 1299 |
+ } |
|
| 1300 |
+ if in.Capacity != nil {
|
|
| 1301 |
+ out.Capacity = make(ResourceList) |
|
| 1302 |
+ for key, val := range in.Capacity {
|
|
| 1303 |
+ newVal := resource.Quantity{}
|
|
| 1304 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1305 |
+ return err |
|
| 1306 |
+ } |
|
| 1307 |
+ out.Capacity[ResourceName(key)] = newVal |
|
| 1308 |
+ } |
|
| 1309 |
+ } else {
|
|
| 1310 |
+ out.Capacity = nil |
|
| 1311 |
+ } |
|
| 1312 |
+ if err := convert_api_PersistentVolumeSource_To_v1beta3_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil {
|
|
| 1313 |
+ return err |
|
| 1314 |
+ } |
|
| 1315 |
+ if in.AccessModes != nil {
|
|
| 1316 |
+ out.AccessModes = make([]PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 1317 |
+ for i := range in.AccessModes {
|
|
| 1318 |
+ out.AccessModes[i] = PersistentVolumeAccessMode(in.AccessModes[i]) |
|
| 1319 |
+ } |
|
| 1320 |
+ } else {
|
|
| 1321 |
+ out.AccessModes = nil |
|
| 1322 |
+ } |
|
| 1323 |
+ if in.ClaimRef != nil {
|
|
| 1324 |
+ out.ClaimRef = new(ObjectReference) |
|
| 1325 |
+ if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(in.ClaimRef, out.ClaimRef, s); err != nil {
|
|
| 1326 |
+ return err |
|
| 1327 |
+ } |
|
| 1328 |
+ } else {
|
|
| 1329 |
+ out.ClaimRef = nil |
|
| 1330 |
+ } |
|
| 1331 |
+ out.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) |
|
| 1332 |
+ return nil |
|
| 1333 |
+} |
|
| 1334 |
+ |
|
| 1335 |
+func convert_api_PersistentVolumeStatus_To_v1beta3_PersistentVolumeStatus(in *api.PersistentVolumeStatus, out *PersistentVolumeStatus, s conversion.Scope) error {
|
|
| 1336 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1337 |
+ defaulting.(func(*api.PersistentVolumeStatus))(in) |
|
| 1338 |
+ } |
|
| 1339 |
+ out.Phase = PersistentVolumePhase(in.Phase) |
|
| 1340 |
+ out.Message = in.Message |
|
| 1341 |
+ out.Reason = in.Reason |
|
| 1342 |
+ return nil |
|
| 1343 |
+} |
|
| 1344 |
+ |
|
| 1345 |
+func convert_api_Pod_To_v1beta3_Pod(in *api.Pod, out *Pod, s conversion.Scope) error {
|
|
| 1346 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1347 |
+ defaulting.(func(*api.Pod))(in) |
|
| 1348 |
+ } |
|
| 1349 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1350 |
+ return err |
|
| 1351 |
+ } |
|
| 1352 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1353 |
+ return err |
|
| 1354 |
+ } |
|
| 1355 |
+ if err := convert_api_PodSpec_To_v1beta3_PodSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 1356 |
+ return err |
|
| 1357 |
+ } |
|
| 1358 |
+ if err := convert_api_PodStatus_To_v1beta3_PodStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 1359 |
+ return err |
|
| 1360 |
+ } |
|
| 1361 |
+ return nil |
|
| 1362 |
+} |
|
| 1363 |
+ |
|
| 1364 |
+func convert_api_PodCondition_To_v1beta3_PodCondition(in *api.PodCondition, out *PodCondition, s conversion.Scope) error {
|
|
| 1365 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1366 |
+ defaulting.(func(*api.PodCondition))(in) |
|
| 1367 |
+ } |
|
| 1368 |
+ out.Type = PodConditionType(in.Type) |
|
| 1369 |
+ out.Status = ConditionStatus(in.Status) |
|
| 1370 |
+ return nil |
|
| 1371 |
+} |
|
| 1372 |
+ |
|
| 1373 |
+func convert_api_PodExecOptions_To_v1beta3_PodExecOptions(in *api.PodExecOptions, out *PodExecOptions, s conversion.Scope) error {
|
|
| 1374 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1375 |
+ defaulting.(func(*api.PodExecOptions))(in) |
|
| 1376 |
+ } |
|
| 1377 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1378 |
+ return err |
|
| 1379 |
+ } |
|
| 1380 |
+ out.Stdin = in.Stdin |
|
| 1381 |
+ out.Stdout = in.Stdout |
|
| 1382 |
+ out.Stderr = in.Stderr |
|
| 1383 |
+ out.TTY = in.TTY |
|
| 1384 |
+ out.Container = in.Container |
|
| 1385 |
+ if in.Command != nil {
|
|
| 1386 |
+ out.Command = make([]string, len(in.Command)) |
|
| 1387 |
+ for i := range in.Command {
|
|
| 1388 |
+ out.Command[i] = in.Command[i] |
|
| 1389 |
+ } |
|
| 1390 |
+ } else {
|
|
| 1391 |
+ out.Command = nil |
|
| 1392 |
+ } |
|
| 1393 |
+ return nil |
|
| 1394 |
+} |
|
| 1395 |
+ |
|
| 1396 |
+func convert_api_PodList_To_v1beta3_PodList(in *api.PodList, out *PodList, s conversion.Scope) error {
|
|
| 1397 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1398 |
+ defaulting.(func(*api.PodList))(in) |
|
| 1399 |
+ } |
|
| 1400 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1401 |
+ return err |
|
| 1402 |
+ } |
|
| 1403 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1404 |
+ return err |
|
| 1405 |
+ } |
|
| 1406 |
+ if in.Items != nil {
|
|
| 1407 |
+ out.Items = make([]Pod, len(in.Items)) |
|
| 1408 |
+ for i := range in.Items {
|
|
| 1409 |
+ if err := convert_api_Pod_To_v1beta3_Pod(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1410 |
+ return err |
|
| 1411 |
+ } |
|
| 1412 |
+ } |
|
| 1413 |
+ } else {
|
|
| 1414 |
+ out.Items = nil |
|
| 1415 |
+ } |
|
| 1416 |
+ return nil |
|
| 1417 |
+} |
|
| 1418 |
+ |
|
| 1419 |
+func convert_api_PodLogOptions_To_v1beta3_PodLogOptions(in *api.PodLogOptions, out *PodLogOptions, s conversion.Scope) error {
|
|
| 1420 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1421 |
+ defaulting.(func(*api.PodLogOptions))(in) |
|
| 1422 |
+ } |
|
| 1423 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1424 |
+ return err |
|
| 1425 |
+ } |
|
| 1426 |
+ out.Container = in.Container |
|
| 1427 |
+ out.Follow = in.Follow |
|
| 1428 |
+ out.Previous = in.Previous |
|
| 1429 |
+ return nil |
|
| 1430 |
+} |
|
| 1431 |
+ |
|
| 1432 |
+func convert_api_PodProxyOptions_To_v1beta3_PodProxyOptions(in *api.PodProxyOptions, out *PodProxyOptions, s conversion.Scope) error {
|
|
| 1433 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1434 |
+ defaulting.(func(*api.PodProxyOptions))(in) |
|
| 1435 |
+ } |
|
| 1436 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1437 |
+ return err |
|
| 1438 |
+ } |
|
| 1439 |
+ out.Path = in.Path |
|
| 1440 |
+ return nil |
|
| 1441 |
+} |
|
| 1442 |
+ |
|
| 1443 |
+func convert_api_PodStatus_To_v1beta3_PodStatus(in *api.PodStatus, out *PodStatus, s conversion.Scope) error {
|
|
| 1444 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1445 |
+ defaulting.(func(*api.PodStatus))(in) |
|
| 1446 |
+ } |
|
| 1447 |
+ out.Phase = PodPhase(in.Phase) |
|
| 1448 |
+ if in.Conditions != nil {
|
|
| 1449 |
+ out.Conditions = make([]PodCondition, len(in.Conditions)) |
|
| 1450 |
+ for i := range in.Conditions {
|
|
| 1451 |
+ if err := convert_api_PodCondition_To_v1beta3_PodCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
|
| 1452 |
+ return err |
|
| 1453 |
+ } |
|
| 1454 |
+ } |
|
| 1455 |
+ } else {
|
|
| 1456 |
+ out.Conditions = nil |
|
| 1457 |
+ } |
|
| 1458 |
+ out.Message = in.Message |
|
| 1459 |
+ out.Reason = in.Reason |
|
| 1460 |
+ out.HostIP = in.HostIP |
|
| 1461 |
+ out.PodIP = in.PodIP |
|
| 1462 |
+ if in.StartTime != nil {
|
|
| 1463 |
+ if err := s.Convert(&in.StartTime, &out.StartTime, 0); err != nil {
|
|
| 1464 |
+ return err |
|
| 1465 |
+ } |
|
| 1466 |
+ } else {
|
|
| 1467 |
+ out.StartTime = nil |
|
| 1468 |
+ } |
|
| 1469 |
+ if in.ContainerStatuses != nil {
|
|
| 1470 |
+ out.ContainerStatuses = make([]ContainerStatus, len(in.ContainerStatuses)) |
|
| 1471 |
+ for i := range in.ContainerStatuses {
|
|
| 1472 |
+ if err := convert_api_ContainerStatus_To_v1beta3_ContainerStatus(&in.ContainerStatuses[i], &out.ContainerStatuses[i], s); err != nil {
|
|
| 1473 |
+ return err |
|
| 1474 |
+ } |
|
| 1475 |
+ } |
|
| 1476 |
+ } else {
|
|
| 1477 |
+ out.ContainerStatuses = nil |
|
| 1478 |
+ } |
|
| 1479 |
+ return nil |
|
| 1480 |
+} |
|
| 1481 |
+ |
|
| 1482 |
+func convert_api_PodStatusResult_To_v1beta3_PodStatusResult(in *api.PodStatusResult, out *PodStatusResult, s conversion.Scope) error {
|
|
| 1483 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1484 |
+ defaulting.(func(*api.PodStatusResult))(in) |
|
| 1485 |
+ } |
|
| 1486 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1487 |
+ return err |
|
| 1488 |
+ } |
|
| 1489 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1490 |
+ return err |
|
| 1491 |
+ } |
|
| 1492 |
+ if err := convert_api_PodStatus_To_v1beta3_PodStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 1493 |
+ return err |
|
| 1494 |
+ } |
|
| 1495 |
+ return nil |
|
| 1496 |
+} |
|
| 1497 |
+ |
|
| 1498 |
+func convert_api_PodTemplate_To_v1beta3_PodTemplate(in *api.PodTemplate, out *PodTemplate, s conversion.Scope) error {
|
|
| 1499 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1500 |
+ defaulting.(func(*api.PodTemplate))(in) |
|
| 1501 |
+ } |
|
| 1502 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1503 |
+ return err |
|
| 1504 |
+ } |
|
| 1505 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1506 |
+ return err |
|
| 1507 |
+ } |
|
| 1508 |
+ if err := convert_api_PodTemplateSpec_To_v1beta3_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
|
|
| 1509 |
+ return err |
|
| 1510 |
+ } |
|
| 1511 |
+ return nil |
|
| 1512 |
+} |
|
| 1513 |
+ |
|
| 1514 |
+func convert_api_PodTemplateList_To_v1beta3_PodTemplateList(in *api.PodTemplateList, out *PodTemplateList, s conversion.Scope) error {
|
|
| 1515 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1516 |
+ defaulting.(func(*api.PodTemplateList))(in) |
|
| 1517 |
+ } |
|
| 1518 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1519 |
+ return err |
|
| 1520 |
+ } |
|
| 1521 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1522 |
+ return err |
|
| 1523 |
+ } |
|
| 1524 |
+ if in.Items != nil {
|
|
| 1525 |
+ out.Items = make([]PodTemplate, len(in.Items)) |
|
| 1526 |
+ for i := range in.Items {
|
|
| 1527 |
+ if err := convert_api_PodTemplate_To_v1beta3_PodTemplate(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1528 |
+ return err |
|
| 1529 |
+ } |
|
| 1530 |
+ } |
|
| 1531 |
+ } else {
|
|
| 1532 |
+ out.Items = nil |
|
| 1533 |
+ } |
|
| 1534 |
+ return nil |
|
| 1535 |
+} |
|
| 1536 |
+ |
|
| 1537 |
+func convert_api_PodTemplateSpec_To_v1beta3_PodTemplateSpec(in *api.PodTemplateSpec, out *PodTemplateSpec, s conversion.Scope) error {
|
|
| 1538 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1539 |
+ defaulting.(func(*api.PodTemplateSpec))(in) |
|
| 1540 |
+ } |
|
| 1541 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1542 |
+ return err |
|
| 1543 |
+ } |
|
| 1544 |
+ if err := convert_api_PodSpec_To_v1beta3_PodSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 1545 |
+ return err |
|
| 1546 |
+ } |
|
| 1547 |
+ return nil |
|
| 1548 |
+} |
|
| 1549 |
+ |
|
| 1550 |
+func convert_api_Probe_To_v1beta3_Probe(in *api.Probe, out *Probe, s conversion.Scope) error {
|
|
| 1551 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1552 |
+ defaulting.(func(*api.Probe))(in) |
|
| 1553 |
+ } |
|
| 1554 |
+ if err := convert_api_Handler_To_v1beta3_Handler(&in.Handler, &out.Handler, s); err != nil {
|
|
| 1555 |
+ return err |
|
| 1556 |
+ } |
|
| 1557 |
+ out.InitialDelaySeconds = in.InitialDelaySeconds |
|
| 1558 |
+ out.TimeoutSeconds = in.TimeoutSeconds |
|
| 1559 |
+ return nil |
|
| 1560 |
+} |
|
| 1561 |
+ |
|
| 1562 |
+func convert_api_RBDVolumeSource_To_v1beta3_RBDVolumeSource(in *api.RBDVolumeSource, out *RBDVolumeSource, s conversion.Scope) error {
|
|
| 1563 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1564 |
+ defaulting.(func(*api.RBDVolumeSource))(in) |
|
| 1565 |
+ } |
|
| 1566 |
+ if in.CephMonitors != nil {
|
|
| 1567 |
+ out.CephMonitors = make([]string, len(in.CephMonitors)) |
|
| 1568 |
+ for i := range in.CephMonitors {
|
|
| 1569 |
+ out.CephMonitors[i] = in.CephMonitors[i] |
|
| 1570 |
+ } |
|
| 1571 |
+ } else {
|
|
| 1572 |
+ out.CephMonitors = nil |
|
| 1573 |
+ } |
|
| 1574 |
+ out.RBDImage = in.RBDImage |
|
| 1575 |
+ out.FSType = in.FSType |
|
| 1576 |
+ out.RBDPool = in.RBDPool |
|
| 1577 |
+ out.RadosUser = in.RadosUser |
|
| 1578 |
+ out.Keyring = in.Keyring |
|
| 1579 |
+ if in.SecretRef != nil {
|
|
| 1580 |
+ out.SecretRef = new(LocalObjectReference) |
|
| 1581 |
+ if err := convert_api_LocalObjectReference_To_v1beta3_LocalObjectReference(in.SecretRef, out.SecretRef, s); err != nil {
|
|
| 1582 |
+ return err |
|
| 1583 |
+ } |
|
| 1584 |
+ } else {
|
|
| 1585 |
+ out.SecretRef = nil |
|
| 1586 |
+ } |
|
| 1587 |
+ out.ReadOnly = in.ReadOnly |
|
| 1588 |
+ return nil |
|
| 1589 |
+} |
|
| 1590 |
+ |
|
| 1591 |
+func convert_api_RangeAllocation_To_v1beta3_RangeAllocation(in *api.RangeAllocation, out *RangeAllocation, s conversion.Scope) error {
|
|
| 1592 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1593 |
+ defaulting.(func(*api.RangeAllocation))(in) |
|
| 1594 |
+ } |
|
| 1595 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1596 |
+ return err |
|
| 1597 |
+ } |
|
| 1598 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1599 |
+ return err |
|
| 1600 |
+ } |
|
| 1601 |
+ out.Range = in.Range |
|
| 1602 |
+ if err := s.Convert(&in.Data, &out.Data, 0); err != nil {
|
|
| 1603 |
+ return err |
|
| 1604 |
+ } |
|
| 1605 |
+ return nil |
|
| 1606 |
+} |
|
| 1607 |
+ |
|
| 1608 |
+func convert_api_ReplicationController_To_v1beta3_ReplicationController(in *api.ReplicationController, out *ReplicationController, s conversion.Scope) error {
|
|
| 1609 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1610 |
+ defaulting.(func(*api.ReplicationController))(in) |
|
| 1611 |
+ } |
|
| 1612 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1613 |
+ return err |
|
| 1614 |
+ } |
|
| 1615 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1616 |
+ return err |
|
| 1617 |
+ } |
|
| 1618 |
+ if err := convert_api_ReplicationControllerSpec_To_v1beta3_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 1619 |
+ return err |
|
| 1620 |
+ } |
|
| 1621 |
+ if err := convert_api_ReplicationControllerStatus_To_v1beta3_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 1622 |
+ return err |
|
| 1623 |
+ } |
|
| 1624 |
+ return nil |
|
| 1625 |
+} |
|
| 1626 |
+ |
|
| 1627 |
+func convert_api_ReplicationControllerList_To_v1beta3_ReplicationControllerList(in *api.ReplicationControllerList, out *ReplicationControllerList, s conversion.Scope) error {
|
|
| 1628 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1629 |
+ defaulting.(func(*api.ReplicationControllerList))(in) |
|
| 1630 |
+ } |
|
| 1631 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1632 |
+ return err |
|
| 1633 |
+ } |
|
| 1634 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1635 |
+ return err |
|
| 1636 |
+ } |
|
| 1637 |
+ if in.Items != nil {
|
|
| 1638 |
+ out.Items = make([]ReplicationController, len(in.Items)) |
|
| 1639 |
+ for i := range in.Items {
|
|
| 1640 |
+ if err := convert_api_ReplicationController_To_v1beta3_ReplicationController(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1641 |
+ return err |
|
| 1642 |
+ } |
|
| 1643 |
+ } |
|
| 1644 |
+ } else {
|
|
| 1645 |
+ out.Items = nil |
|
| 1646 |
+ } |
|
| 1647 |
+ return nil |
|
| 1648 |
+} |
|
| 1649 |
+ |
|
| 1650 |
+func convert_api_ReplicationControllerStatus_To_v1beta3_ReplicationControllerStatus(in *api.ReplicationControllerStatus, out *ReplicationControllerStatus, s conversion.Scope) error {
|
|
| 1651 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1652 |
+ defaulting.(func(*api.ReplicationControllerStatus))(in) |
|
| 1653 |
+ } |
|
| 1654 |
+ out.Replicas = in.Replicas |
|
| 1655 |
+ out.ObservedGeneration = in.ObservedGeneration |
|
| 1656 |
+ return nil |
|
| 1657 |
+} |
|
| 1658 |
+ |
|
| 1659 |
+func convert_api_ResourceQuota_To_v1beta3_ResourceQuota(in *api.ResourceQuota, out *ResourceQuota, s conversion.Scope) error {
|
|
| 1660 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1661 |
+ defaulting.(func(*api.ResourceQuota))(in) |
|
| 1662 |
+ } |
|
| 1663 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1664 |
+ return err |
|
| 1665 |
+ } |
|
| 1666 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1667 |
+ return err |
|
| 1668 |
+ } |
|
| 1669 |
+ if err := convert_api_ResourceQuotaSpec_To_v1beta3_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 1670 |
+ return err |
|
| 1671 |
+ } |
|
| 1672 |
+ if err := convert_api_ResourceQuotaStatus_To_v1beta3_ResourceQuotaStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 1673 |
+ return err |
|
| 1674 |
+ } |
|
| 1675 |
+ return nil |
|
| 1676 |
+} |
|
| 1677 |
+ |
|
| 1678 |
+func convert_api_ResourceQuotaList_To_v1beta3_ResourceQuotaList(in *api.ResourceQuotaList, out *ResourceQuotaList, s conversion.Scope) error {
|
|
| 1679 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1680 |
+ defaulting.(func(*api.ResourceQuotaList))(in) |
|
| 1681 |
+ } |
|
| 1682 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1683 |
+ return err |
|
| 1684 |
+ } |
|
| 1685 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1686 |
+ return err |
|
| 1687 |
+ } |
|
| 1688 |
+ if in.Items != nil {
|
|
| 1689 |
+ out.Items = make([]ResourceQuota, len(in.Items)) |
|
| 1690 |
+ for i := range in.Items {
|
|
| 1691 |
+ if err := convert_api_ResourceQuota_To_v1beta3_ResourceQuota(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1692 |
+ return err |
|
| 1693 |
+ } |
|
| 1694 |
+ } |
|
| 1695 |
+ } else {
|
|
| 1696 |
+ out.Items = nil |
|
| 1697 |
+ } |
|
| 1698 |
+ return nil |
|
| 1699 |
+} |
|
| 1700 |
+ |
|
| 1701 |
+func convert_api_ResourceQuotaSpec_To_v1beta3_ResourceQuotaSpec(in *api.ResourceQuotaSpec, out *ResourceQuotaSpec, s conversion.Scope) error {
|
|
| 1702 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1703 |
+ defaulting.(func(*api.ResourceQuotaSpec))(in) |
|
| 1704 |
+ } |
|
| 1705 |
+ if in.Hard != nil {
|
|
| 1706 |
+ out.Hard = make(ResourceList) |
|
| 1707 |
+ for key, val := range in.Hard {
|
|
| 1708 |
+ newVal := resource.Quantity{}
|
|
| 1709 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1710 |
+ return err |
|
| 1711 |
+ } |
|
| 1712 |
+ out.Hard[ResourceName(key)] = newVal |
|
| 1713 |
+ } |
|
| 1714 |
+ } else {
|
|
| 1715 |
+ out.Hard = nil |
|
| 1716 |
+ } |
|
| 1717 |
+ return nil |
|
| 1718 |
+} |
|
| 1719 |
+ |
|
| 1720 |
+func convert_api_ResourceQuotaStatus_To_v1beta3_ResourceQuotaStatus(in *api.ResourceQuotaStatus, out *ResourceQuotaStatus, s conversion.Scope) error {
|
|
| 1721 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1722 |
+ defaulting.(func(*api.ResourceQuotaStatus))(in) |
|
| 1723 |
+ } |
|
| 1724 |
+ if in.Hard != nil {
|
|
| 1725 |
+ out.Hard = make(ResourceList) |
|
| 1726 |
+ for key, val := range in.Hard {
|
|
| 1727 |
+ newVal := resource.Quantity{}
|
|
| 1728 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1729 |
+ return err |
|
| 1730 |
+ } |
|
| 1731 |
+ out.Hard[ResourceName(key)] = newVal |
|
| 1732 |
+ } |
|
| 1733 |
+ } else {
|
|
| 1734 |
+ out.Hard = nil |
|
| 1735 |
+ } |
|
| 1736 |
+ if in.Used != nil {
|
|
| 1737 |
+ out.Used = make(ResourceList) |
|
| 1738 |
+ for key, val := range in.Used {
|
|
| 1739 |
+ newVal := resource.Quantity{}
|
|
| 1740 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1741 |
+ return err |
|
| 1742 |
+ } |
|
| 1743 |
+ out.Used[ResourceName(key)] = newVal |
|
| 1744 |
+ } |
|
| 1745 |
+ } else {
|
|
| 1746 |
+ out.Used = nil |
|
| 1747 |
+ } |
|
| 1748 |
+ return nil |
|
| 1749 |
+} |
|
| 1750 |
+ |
|
| 1751 |
+func convert_api_ResourceRequirements_To_v1beta3_ResourceRequirements(in *api.ResourceRequirements, out *ResourceRequirements, s conversion.Scope) error {
|
|
| 1752 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1753 |
+ defaulting.(func(*api.ResourceRequirements))(in) |
|
| 1754 |
+ } |
|
| 1755 |
+ if in.Limits != nil {
|
|
| 1756 |
+ out.Limits = make(ResourceList) |
|
| 1757 |
+ for key, val := range in.Limits {
|
|
| 1758 |
+ newVal := resource.Quantity{}
|
|
| 1759 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1760 |
+ return err |
|
| 1761 |
+ } |
|
| 1762 |
+ out.Limits[ResourceName(key)] = newVal |
|
| 1763 |
+ } |
|
| 1764 |
+ } else {
|
|
| 1765 |
+ out.Limits = nil |
|
| 1766 |
+ } |
|
| 1767 |
+ if in.Requests != nil {
|
|
| 1768 |
+ out.Requests = make(ResourceList) |
|
| 1769 |
+ for key, val := range in.Requests {
|
|
| 1770 |
+ newVal := resource.Quantity{}
|
|
| 1771 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1772 |
+ return err |
|
| 1773 |
+ } |
|
| 1774 |
+ out.Requests[ResourceName(key)] = newVal |
|
| 1775 |
+ } |
|
| 1776 |
+ } else {
|
|
| 1777 |
+ out.Requests = nil |
|
| 1778 |
+ } |
|
| 1779 |
+ return nil |
|
| 1780 |
+} |
|
| 1781 |
+ |
|
| 1782 |
+func convert_api_RunAsUserStrategyOptions_To_v1beta3_RunAsUserStrategyOptions(in *api.RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, s conversion.Scope) error {
|
|
| 1783 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1784 |
+ defaulting.(func(*api.RunAsUserStrategyOptions))(in) |
|
| 1785 |
+ } |
|
| 1786 |
+ out.Type = RunAsUserStrategyType(in.Type) |
|
| 1787 |
+ if in.UID != nil {
|
|
| 1788 |
+ out.UID = new(int64) |
|
| 1789 |
+ *out.UID = *in.UID |
|
| 1790 |
+ } else {
|
|
| 1791 |
+ out.UID = nil |
|
| 1792 |
+ } |
|
| 1793 |
+ if in.UIDRangeMin != nil {
|
|
| 1794 |
+ out.UIDRangeMin = new(int64) |
|
| 1795 |
+ *out.UIDRangeMin = *in.UIDRangeMin |
|
| 1796 |
+ } else {
|
|
| 1797 |
+ out.UIDRangeMin = nil |
|
| 1798 |
+ } |
|
| 1799 |
+ if in.UIDRangeMax != nil {
|
|
| 1800 |
+ out.UIDRangeMax = new(int64) |
|
| 1801 |
+ *out.UIDRangeMax = *in.UIDRangeMax |
|
| 1802 |
+ } else {
|
|
| 1803 |
+ out.UIDRangeMax = nil |
|
| 1804 |
+ } |
|
| 1805 |
+ return nil |
|
| 1806 |
+} |
|
| 1807 |
+ |
|
| 1808 |
+func convert_api_SELinuxContextStrategyOptions_To_v1beta3_SELinuxContextStrategyOptions(in *api.SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, s conversion.Scope) error {
|
|
| 1809 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1810 |
+ defaulting.(func(*api.SELinuxContextStrategyOptions))(in) |
|
| 1811 |
+ } |
|
| 1812 |
+ out.Type = SELinuxContextStrategyType(in.Type) |
|
| 1813 |
+ if in.SELinuxOptions != nil {
|
|
| 1814 |
+ out.SELinuxOptions = new(SELinuxOptions) |
|
| 1815 |
+ if err := convert_api_SELinuxOptions_To_v1beta3_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil {
|
|
| 1816 |
+ return err |
|
| 1817 |
+ } |
|
| 1818 |
+ } else {
|
|
| 1819 |
+ out.SELinuxOptions = nil |
|
| 1820 |
+ } |
|
| 1821 |
+ return nil |
|
| 1822 |
+} |
|
| 1823 |
+ |
|
| 1824 |
+func convert_api_SELinuxOptions_To_v1beta3_SELinuxOptions(in *api.SELinuxOptions, out *SELinuxOptions, s conversion.Scope) error {
|
|
| 1825 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1826 |
+ defaulting.(func(*api.SELinuxOptions))(in) |
|
| 1827 |
+ } |
|
| 1828 |
+ out.User = in.User |
|
| 1829 |
+ out.Role = in.Role |
|
| 1830 |
+ out.Type = in.Type |
|
| 1831 |
+ out.Level = in.Level |
|
| 1832 |
+ return nil |
|
| 1833 |
+} |
|
| 1834 |
+ |
|
| 1835 |
+func convert_api_Secret_To_v1beta3_Secret(in *api.Secret, out *Secret, s conversion.Scope) error {
|
|
| 1836 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1837 |
+ defaulting.(func(*api.Secret))(in) |
|
| 1838 |
+ } |
|
| 1839 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1840 |
+ return err |
|
| 1841 |
+ } |
|
| 1842 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1843 |
+ return err |
|
| 1844 |
+ } |
|
| 1845 |
+ if in.Data != nil {
|
|
| 1846 |
+ out.Data = make(map[string][]uint8) |
|
| 1847 |
+ for key, val := range in.Data {
|
|
| 1848 |
+ newVal := []uint8{}
|
|
| 1849 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 1850 |
+ return err |
|
| 1851 |
+ } |
|
| 1852 |
+ out.Data[key] = newVal |
|
| 1853 |
+ } |
|
| 1854 |
+ } else {
|
|
| 1855 |
+ out.Data = nil |
|
| 1856 |
+ } |
|
| 1857 |
+ out.Type = SecretType(in.Type) |
|
| 1858 |
+ return nil |
|
| 1859 |
+} |
|
| 1860 |
+ |
|
| 1861 |
+func convert_api_SecretList_To_v1beta3_SecretList(in *api.SecretList, out *SecretList, s conversion.Scope) error {
|
|
| 1862 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1863 |
+ defaulting.(func(*api.SecretList))(in) |
|
| 1864 |
+ } |
|
| 1865 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1866 |
+ return err |
|
| 1867 |
+ } |
|
| 1868 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1869 |
+ return err |
|
| 1870 |
+ } |
|
| 1871 |
+ if in.Items != nil {
|
|
| 1872 |
+ out.Items = make([]Secret, len(in.Items)) |
|
| 1873 |
+ for i := range in.Items {
|
|
| 1874 |
+ if err := convert_api_Secret_To_v1beta3_Secret(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1875 |
+ return err |
|
| 1876 |
+ } |
|
| 1877 |
+ } |
|
| 1878 |
+ } else {
|
|
| 1879 |
+ out.Items = nil |
|
| 1880 |
+ } |
|
| 1881 |
+ return nil |
|
| 1882 |
+} |
|
| 1883 |
+ |
|
| 1884 |
+func convert_api_SecretVolumeSource_To_v1beta3_SecretVolumeSource(in *api.SecretVolumeSource, out *SecretVolumeSource, s conversion.Scope) error {
|
|
| 1885 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1886 |
+ defaulting.(func(*api.SecretVolumeSource))(in) |
|
| 1887 |
+ } |
|
| 1888 |
+ out.SecretName = in.SecretName |
|
| 1889 |
+ return nil |
|
| 1890 |
+} |
|
| 1891 |
+ |
|
| 1892 |
+func convert_api_SecurityContext_To_v1beta3_SecurityContext(in *api.SecurityContext, out *SecurityContext, s conversion.Scope) error {
|
|
| 1893 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1894 |
+ defaulting.(func(*api.SecurityContext))(in) |
|
| 1895 |
+ } |
|
| 1896 |
+ if in.Capabilities != nil {
|
|
| 1897 |
+ out.Capabilities = new(Capabilities) |
|
| 1898 |
+ if err := convert_api_Capabilities_To_v1beta3_Capabilities(in.Capabilities, out.Capabilities, s); err != nil {
|
|
| 1899 |
+ return err |
|
| 1900 |
+ } |
|
| 1901 |
+ } else {
|
|
| 1902 |
+ out.Capabilities = nil |
|
| 1903 |
+ } |
|
| 1904 |
+ if in.Privileged != nil {
|
|
| 1905 |
+ out.Privileged = new(bool) |
|
| 1906 |
+ *out.Privileged = *in.Privileged |
|
| 1907 |
+ } else {
|
|
| 1908 |
+ out.Privileged = nil |
|
| 1909 |
+ } |
|
| 1910 |
+ if in.SELinuxOptions != nil {
|
|
| 1911 |
+ out.SELinuxOptions = new(SELinuxOptions) |
|
| 1912 |
+ if err := convert_api_SELinuxOptions_To_v1beta3_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil {
|
|
| 1913 |
+ return err |
|
| 1914 |
+ } |
|
| 1915 |
+ } else {
|
|
| 1916 |
+ out.SELinuxOptions = nil |
|
| 1917 |
+ } |
|
| 1918 |
+ if in.RunAsUser != nil {
|
|
| 1919 |
+ out.RunAsUser = new(int64) |
|
| 1920 |
+ *out.RunAsUser = *in.RunAsUser |
|
| 1921 |
+ } else {
|
|
| 1922 |
+ out.RunAsUser = nil |
|
| 1923 |
+ } |
|
| 1924 |
+ out.RunAsNonRoot = in.RunAsNonRoot |
|
| 1925 |
+ return nil |
|
| 1926 |
+} |
|
| 1927 |
+ |
|
| 1928 |
+func convert_api_SecurityContextConstraints_To_v1beta3_SecurityContextConstraints(in *api.SecurityContextConstraints, out *SecurityContextConstraints, s conversion.Scope) error {
|
|
| 1929 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1930 |
+ defaulting.(func(*api.SecurityContextConstraints))(in) |
|
| 1931 |
+ } |
|
| 1932 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1933 |
+ return err |
|
| 1934 |
+ } |
|
| 1935 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 1936 |
+ return err |
|
| 1937 |
+ } |
|
| 1938 |
+ out.AllowPrivilegedContainer = in.AllowPrivilegedContainer |
|
| 1939 |
+ if in.AllowedCapabilities != nil {
|
|
| 1940 |
+ out.AllowedCapabilities = make([]Capability, len(in.AllowedCapabilities)) |
|
| 1941 |
+ for i := range in.AllowedCapabilities {
|
|
| 1942 |
+ out.AllowedCapabilities[i] = Capability(in.AllowedCapabilities[i]) |
|
| 1943 |
+ } |
|
| 1944 |
+ } else {
|
|
| 1945 |
+ out.AllowedCapabilities = nil |
|
| 1946 |
+ } |
|
| 1947 |
+ out.AllowHostDirVolumePlugin = in.AllowHostDirVolumePlugin |
|
| 1948 |
+ out.AllowHostNetwork = in.AllowHostNetwork |
|
| 1949 |
+ out.AllowHostPorts = in.AllowHostPorts |
|
| 1950 |
+ if err := convert_api_SELinuxContextStrategyOptions_To_v1beta3_SELinuxContextStrategyOptions(&in.SELinuxContext, &out.SELinuxContext, s); err != nil {
|
|
| 1951 |
+ return err |
|
| 1952 |
+ } |
|
| 1953 |
+ if err := convert_api_RunAsUserStrategyOptions_To_v1beta3_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, s); err != nil {
|
|
| 1954 |
+ return err |
|
| 1955 |
+ } |
|
| 1956 |
+ if in.Users != nil {
|
|
| 1957 |
+ out.Users = make([]string, len(in.Users)) |
|
| 1958 |
+ for i := range in.Users {
|
|
| 1959 |
+ out.Users[i] = in.Users[i] |
|
| 1960 |
+ } |
|
| 1961 |
+ } else {
|
|
| 1962 |
+ out.Users = nil |
|
| 1963 |
+ } |
|
| 1964 |
+ if in.Groups != nil {
|
|
| 1965 |
+ out.Groups = make([]string, len(in.Groups)) |
|
| 1966 |
+ for i := range in.Groups {
|
|
| 1967 |
+ out.Groups[i] = in.Groups[i] |
|
| 1968 |
+ } |
|
| 1969 |
+ } else {
|
|
| 1970 |
+ out.Groups = nil |
|
| 1971 |
+ } |
|
| 1972 |
+ return nil |
|
| 1973 |
+} |
|
| 1974 |
+ |
|
| 1975 |
+func convert_api_SecurityContextConstraintsList_To_v1beta3_SecurityContextConstraintsList(in *api.SecurityContextConstraintsList, out *SecurityContextConstraintsList, s conversion.Scope) error {
|
|
| 1976 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 1977 |
+ defaulting.(func(*api.SecurityContextConstraintsList))(in) |
|
| 1978 |
+ } |
|
| 1979 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 1980 |
+ return err |
|
| 1981 |
+ } |
|
| 1982 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 1983 |
+ return err |
|
| 1984 |
+ } |
|
| 1985 |
+ if in.Items != nil {
|
|
| 1986 |
+ out.Items = make([]SecurityContextConstraints, len(in.Items)) |
|
| 1987 |
+ for i := range in.Items {
|
|
| 1988 |
+ if err := convert_api_SecurityContextConstraints_To_v1beta3_SecurityContextConstraints(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 1989 |
+ return err |
|
| 1990 |
+ } |
|
| 1991 |
+ } |
|
| 1992 |
+ } else {
|
|
| 1993 |
+ out.Items = nil |
|
| 1994 |
+ } |
|
| 1995 |
+ return nil |
|
| 1996 |
+} |
|
| 1997 |
+ |
|
| 1998 |
+func convert_api_SerializedReference_To_v1beta3_SerializedReference(in *api.SerializedReference, out *SerializedReference, s conversion.Scope) error {
|
|
| 1999 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2000 |
+ defaulting.(func(*api.SerializedReference))(in) |
|
| 2001 |
+ } |
|
| 2002 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2003 |
+ return err |
|
| 2004 |
+ } |
|
| 2005 |
+ if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(&in.Reference, &out.Reference, s); err != nil {
|
|
| 2006 |
+ return err |
|
| 2007 |
+ } |
|
| 2008 |
+ return nil |
|
| 2009 |
+} |
|
| 2010 |
+ |
|
| 2011 |
+func convert_api_Service_To_v1beta3_Service(in *api.Service, out *Service, s conversion.Scope) error {
|
|
| 2012 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2013 |
+ defaulting.(func(*api.Service))(in) |
|
| 2014 |
+ } |
|
| 2015 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2016 |
+ return err |
|
| 2017 |
+ } |
|
| 2018 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2019 |
+ return err |
|
| 2020 |
+ } |
|
| 2021 |
+ if err := convert_api_ServiceSpec_To_v1beta3_ServiceSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 2022 |
+ return err |
|
| 2023 |
+ } |
|
| 2024 |
+ if err := convert_api_ServiceStatus_To_v1beta3_ServiceStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 2025 |
+ return err |
|
| 2026 |
+ } |
|
| 2027 |
+ return nil |
|
| 2028 |
+} |
|
| 2029 |
+ |
|
| 2030 |
+func convert_api_ServiceAccount_To_v1beta3_ServiceAccount(in *api.ServiceAccount, out *ServiceAccount, s conversion.Scope) error {
|
|
| 2031 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2032 |
+ defaulting.(func(*api.ServiceAccount))(in) |
|
| 2033 |
+ } |
|
| 2034 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2035 |
+ return err |
|
| 2036 |
+ } |
|
| 2037 |
+ if err := convert_api_ObjectMeta_To_v1beta3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2038 |
+ return err |
|
| 2039 |
+ } |
|
| 2040 |
+ if in.Secrets != nil {
|
|
| 2041 |
+ out.Secrets = make([]ObjectReference, len(in.Secrets)) |
|
| 2042 |
+ for i := range in.Secrets {
|
|
| 2043 |
+ if err := convert_api_ObjectReference_To_v1beta3_ObjectReference(&in.Secrets[i], &out.Secrets[i], s); err != nil {
|
|
| 2044 |
+ return err |
|
| 2045 |
+ } |
|
| 2046 |
+ } |
|
| 2047 |
+ } else {
|
|
| 2048 |
+ out.Secrets = nil |
|
| 2049 |
+ } |
|
| 2050 |
+ if in.ImagePullSecrets != nil {
|
|
| 2051 |
+ out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) |
|
| 2052 |
+ for i := range in.ImagePullSecrets {
|
|
| 2053 |
+ if err := convert_api_LocalObjectReference_To_v1beta3_LocalObjectReference(&in.ImagePullSecrets[i], &out.ImagePullSecrets[i], s); err != nil {
|
|
| 2054 |
+ return err |
|
| 2055 |
+ } |
|
| 2056 |
+ } |
|
| 2057 |
+ } else {
|
|
| 2058 |
+ out.ImagePullSecrets = nil |
|
| 2059 |
+ } |
|
| 2060 |
+ return nil |
|
| 2061 |
+} |
|
| 2062 |
+ |
|
| 2063 |
+func convert_api_ServiceAccountList_To_v1beta3_ServiceAccountList(in *api.ServiceAccountList, out *ServiceAccountList, s conversion.Scope) error {
|
|
| 2064 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2065 |
+ defaulting.(func(*api.ServiceAccountList))(in) |
|
| 2066 |
+ } |
|
| 2067 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2068 |
+ return err |
|
| 2069 |
+ } |
|
| 2070 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2071 |
+ return err |
|
| 2072 |
+ } |
|
| 2073 |
+ if in.Items != nil {
|
|
| 2074 |
+ out.Items = make([]ServiceAccount, len(in.Items)) |
|
| 2075 |
+ for i := range in.Items {
|
|
| 2076 |
+ if err := convert_api_ServiceAccount_To_v1beta3_ServiceAccount(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2077 |
+ return err |
|
| 2078 |
+ } |
|
| 2079 |
+ } |
|
| 2080 |
+ } else {
|
|
| 2081 |
+ out.Items = nil |
|
| 2082 |
+ } |
|
| 2083 |
+ return nil |
|
| 2084 |
+} |
|
| 2085 |
+ |
|
| 2086 |
+func convert_api_ServiceList_To_v1beta3_ServiceList(in *api.ServiceList, out *ServiceList, s conversion.Scope) error {
|
|
| 2087 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2088 |
+ defaulting.(func(*api.ServiceList))(in) |
|
| 2089 |
+ } |
|
| 2090 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2091 |
+ return err |
|
| 2092 |
+ } |
|
| 2093 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2094 |
+ return err |
|
| 2095 |
+ } |
|
| 2096 |
+ if in.Items != nil {
|
|
| 2097 |
+ out.Items = make([]Service, len(in.Items)) |
|
| 2098 |
+ for i := range in.Items {
|
|
| 2099 |
+ if err := convert_api_Service_To_v1beta3_Service(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2100 |
+ return err |
|
| 2101 |
+ } |
|
| 2102 |
+ } |
|
| 2103 |
+ } else {
|
|
| 2104 |
+ out.Items = nil |
|
| 2105 |
+ } |
|
| 2106 |
+ return nil |
|
| 2107 |
+} |
|
| 2108 |
+ |
|
| 2109 |
+func convert_api_ServicePort_To_v1beta3_ServicePort(in *api.ServicePort, out *ServicePort, s conversion.Scope) error {
|
|
| 2110 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2111 |
+ defaulting.(func(*api.ServicePort))(in) |
|
| 2112 |
+ } |
|
| 2113 |
+ out.Name = in.Name |
|
| 2114 |
+ out.Protocol = Protocol(in.Protocol) |
|
| 2115 |
+ out.Port = in.Port |
|
| 2116 |
+ if err := s.Convert(&in.TargetPort, &out.TargetPort, 0); err != nil {
|
|
| 2117 |
+ return err |
|
| 2118 |
+ } |
|
| 2119 |
+ out.NodePort = in.NodePort |
|
| 2120 |
+ return nil |
|
| 2121 |
+} |
|
| 2122 |
+ |
|
| 2123 |
+func convert_api_ServiceStatus_To_v1beta3_ServiceStatus(in *api.ServiceStatus, out *ServiceStatus, s conversion.Scope) error {
|
|
| 2124 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2125 |
+ defaulting.(func(*api.ServiceStatus))(in) |
|
| 2126 |
+ } |
|
| 2127 |
+ if err := convert_api_LoadBalancerStatus_To_v1beta3_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil {
|
|
| 2128 |
+ return err |
|
| 2129 |
+ } |
|
| 2130 |
+ return nil |
|
| 2131 |
+} |
|
| 2132 |
+ |
|
| 2133 |
+func convert_api_Status_To_v1beta3_Status(in *api.Status, out *Status, s conversion.Scope) error {
|
|
| 2134 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2135 |
+ defaulting.(func(*api.Status))(in) |
|
| 2136 |
+ } |
|
| 2137 |
+ if err := convert_api_TypeMeta_To_v1beta3_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2138 |
+ return err |
|
| 2139 |
+ } |
|
| 2140 |
+ if err := convert_api_ListMeta_To_v1beta3_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2141 |
+ return err |
|
| 2142 |
+ } |
|
| 2143 |
+ out.Status = in.Status |
|
| 2144 |
+ out.Message = in.Message |
|
| 2145 |
+ out.Reason = StatusReason(in.Reason) |
|
| 2146 |
+ if in.Details != nil {
|
|
| 2147 |
+ out.Details = new(StatusDetails) |
|
| 2148 |
+ if err := convert_api_StatusDetails_To_v1beta3_StatusDetails(in.Details, out.Details, s); err != nil {
|
|
| 2149 |
+ return err |
|
| 2150 |
+ } |
|
| 2151 |
+ } else {
|
|
| 2152 |
+ out.Details = nil |
|
| 2153 |
+ } |
|
| 2154 |
+ out.Code = in.Code |
|
| 2155 |
+ return nil |
|
| 2156 |
+} |
|
| 2157 |
+ |
|
| 2158 |
+func convert_api_TCPSocketAction_To_v1beta3_TCPSocketAction(in *api.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error {
|
|
| 2159 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2160 |
+ defaulting.(func(*api.TCPSocketAction))(in) |
|
| 2161 |
+ } |
|
| 2162 |
+ if err := s.Convert(&in.Port, &out.Port, 0); err != nil {
|
|
| 2163 |
+ return err |
|
| 2164 |
+ } |
|
| 2165 |
+ return nil |
|
| 2166 |
+} |
|
| 2167 |
+ |
|
| 2168 |
+func convert_api_TypeMeta_To_v1beta3_TypeMeta(in *api.TypeMeta, out *TypeMeta, s conversion.Scope) error {
|
|
| 2169 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2170 |
+ defaulting.(func(*api.TypeMeta))(in) |
|
| 2171 |
+ } |
|
| 2172 |
+ out.Kind = in.Kind |
|
| 2173 |
+ out.APIVersion = in.APIVersion |
|
| 2174 |
+ return nil |
|
| 2175 |
+} |
|
| 2176 |
+ |
|
| 2177 |
+func convert_api_Volume_To_v1beta3_Volume(in *api.Volume, out *Volume, s conversion.Scope) error {
|
|
| 2178 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2179 |
+ defaulting.(func(*api.Volume))(in) |
|
| 2180 |
+ } |
|
| 2181 |
+ out.Name = in.Name |
|
| 2182 |
+ if err := convert_api_VolumeSource_To_v1beta3_VolumeSource(&in.VolumeSource, &out.VolumeSource, s); err != nil {
|
|
| 2183 |
+ return err |
|
| 2184 |
+ } |
|
| 2185 |
+ return nil |
|
| 2186 |
+} |
|
| 2187 |
+ |
|
| 2188 |
+func convert_api_VolumeMount_To_v1beta3_VolumeMount(in *api.VolumeMount, out *VolumeMount, s conversion.Scope) error {
|
|
| 2189 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2190 |
+ defaulting.(func(*api.VolumeMount))(in) |
|
| 2191 |
+ } |
|
| 2192 |
+ out.Name = in.Name |
|
| 2193 |
+ out.ReadOnly = in.ReadOnly |
|
| 2194 |
+ out.MountPath = in.MountPath |
|
| 2195 |
+ return nil |
|
| 2196 |
+} |
|
| 2197 |
+ |
|
| 2198 |
+func convert_api_VolumeSource_To_v1beta3_VolumeSource(in *api.VolumeSource, out *VolumeSource, s conversion.Scope) error {
|
|
| 2199 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2200 |
+ defaulting.(func(*api.VolumeSource))(in) |
|
| 2201 |
+ } |
|
| 2202 |
+ if in.HostPath != nil {
|
|
| 2203 |
+ out.HostPath = new(HostPathVolumeSource) |
|
| 2204 |
+ if err := convert_api_HostPathVolumeSource_To_v1beta3_HostPathVolumeSource(in.HostPath, out.HostPath, s); err != nil {
|
|
| 2205 |
+ return err |
|
| 2206 |
+ } |
|
| 2207 |
+ } else {
|
|
| 2208 |
+ out.HostPath = nil |
|
| 2209 |
+ } |
|
| 2210 |
+ if in.EmptyDir != nil {
|
|
| 2211 |
+ out.EmptyDir = new(EmptyDirVolumeSource) |
|
| 2212 |
+ if err := convert_api_EmptyDirVolumeSource_To_v1beta3_EmptyDirVolumeSource(in.EmptyDir, out.EmptyDir, s); err != nil {
|
|
| 2213 |
+ return err |
|
| 2214 |
+ } |
|
| 2215 |
+ } else {
|
|
| 2216 |
+ out.EmptyDir = nil |
|
| 2217 |
+ } |
|
| 2218 |
+ if in.GCEPersistentDisk != nil {
|
|
| 2219 |
+ out.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) |
|
| 2220 |
+ if err := convert_api_GCEPersistentDiskVolumeSource_To_v1beta3_GCEPersistentDiskVolumeSource(in.GCEPersistentDisk, out.GCEPersistentDisk, s); err != nil {
|
|
| 2221 |
+ return err |
|
| 2222 |
+ } |
|
| 2223 |
+ } else {
|
|
| 2224 |
+ out.GCEPersistentDisk = nil |
|
| 2225 |
+ } |
|
| 2226 |
+ if in.AWSElasticBlockStore != nil {
|
|
| 2227 |
+ out.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) |
|
| 2228 |
+ if err := convert_api_AWSElasticBlockStoreVolumeSource_To_v1beta3_AWSElasticBlockStoreVolumeSource(in.AWSElasticBlockStore, out.AWSElasticBlockStore, s); err != nil {
|
|
| 2229 |
+ return err |
|
| 2230 |
+ } |
|
| 2231 |
+ } else {
|
|
| 2232 |
+ out.AWSElasticBlockStore = nil |
|
| 2233 |
+ } |
|
| 2234 |
+ if in.GitRepo != nil {
|
|
| 2235 |
+ out.GitRepo = new(GitRepoVolumeSource) |
|
| 2236 |
+ if err := convert_api_GitRepoVolumeSource_To_v1beta3_GitRepoVolumeSource(in.GitRepo, out.GitRepo, s); err != nil {
|
|
| 2237 |
+ return err |
|
| 2238 |
+ } |
|
| 2239 |
+ } else {
|
|
| 2240 |
+ out.GitRepo = nil |
|
| 2241 |
+ } |
|
| 2242 |
+ if in.Secret != nil {
|
|
| 2243 |
+ out.Secret = new(SecretVolumeSource) |
|
| 2244 |
+ if err := convert_api_SecretVolumeSource_To_v1beta3_SecretVolumeSource(in.Secret, out.Secret, s); err != nil {
|
|
| 2245 |
+ return err |
|
| 2246 |
+ } |
|
| 2247 |
+ } else {
|
|
| 2248 |
+ out.Secret = nil |
|
| 2249 |
+ } |
|
| 2250 |
+ if in.NFS != nil {
|
|
| 2251 |
+ out.NFS = new(NFSVolumeSource) |
|
| 2252 |
+ if err := convert_api_NFSVolumeSource_To_v1beta3_NFSVolumeSource(in.NFS, out.NFS, s); err != nil {
|
|
| 2253 |
+ return err |
|
| 2254 |
+ } |
|
| 2255 |
+ } else {
|
|
| 2256 |
+ out.NFS = nil |
|
| 2257 |
+ } |
|
| 2258 |
+ if in.ISCSI != nil {
|
|
| 2259 |
+ out.ISCSI = new(ISCSIVolumeSource) |
|
| 2260 |
+ if err := convert_api_ISCSIVolumeSource_To_v1beta3_ISCSIVolumeSource(in.ISCSI, out.ISCSI, s); err != nil {
|
|
| 2261 |
+ return err |
|
| 2262 |
+ } |
|
| 2263 |
+ } else {
|
|
| 2264 |
+ out.ISCSI = nil |
|
| 2265 |
+ } |
|
| 2266 |
+ if in.Glusterfs != nil {
|
|
| 2267 |
+ out.Glusterfs = new(GlusterfsVolumeSource) |
|
| 2268 |
+ if err := convert_api_GlusterfsVolumeSource_To_v1beta3_GlusterfsVolumeSource(in.Glusterfs, out.Glusterfs, s); err != nil {
|
|
| 2269 |
+ return err |
|
| 2270 |
+ } |
|
| 2271 |
+ } else {
|
|
| 2272 |
+ out.Glusterfs = nil |
|
| 2273 |
+ } |
|
| 2274 |
+ if in.PersistentVolumeClaim != nil {
|
|
| 2275 |
+ out.PersistentVolumeClaim = new(PersistentVolumeClaimVolumeSource) |
|
| 2276 |
+ if err := convert_api_PersistentVolumeClaimVolumeSource_To_v1beta3_PersistentVolumeClaimVolumeSource(in.PersistentVolumeClaim, out.PersistentVolumeClaim, s); err != nil {
|
|
| 2277 |
+ return err |
|
| 2278 |
+ } |
|
| 2279 |
+ } else {
|
|
| 2280 |
+ out.PersistentVolumeClaim = nil |
|
| 2281 |
+ } |
|
| 2282 |
+ if in.RBD != nil {
|
|
| 2283 |
+ out.RBD = new(RBDVolumeSource) |
|
| 2284 |
+ if err := convert_api_RBDVolumeSource_To_v1beta3_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
|
| 2285 |
+ return err |
|
| 2286 |
+ } |
|
| 2287 |
+ } else {
|
|
| 2288 |
+ out.RBD = nil |
|
| 2289 |
+ } |
|
| 2290 |
+ if in.CephFS != nil {
|
|
| 2291 |
+ out.CephFS = new(CephFSVolumeSource) |
|
| 2292 |
+ if err := convert_api_CephFSVolumeSource_To_v1beta3_CephFSVolumeSource(in.CephFS, out.CephFS, s); err != nil {
|
|
| 2293 |
+ return err |
|
| 2294 |
+ } |
|
| 2295 |
+ } else {
|
|
| 2296 |
+ out.CephFS = nil |
|
| 2297 |
+ } |
|
| 2298 |
+ if in.DownwardAPI != nil {
|
|
| 2299 |
+ out.DownwardAPI = new(DownwardAPIVolumeSource) |
|
| 2300 |
+ if err := convert_api_DownwardAPIVolumeSource_To_v1beta3_DownwardAPIVolumeSource(in.DownwardAPI, out.DownwardAPI, s); err != nil {
|
|
| 2301 |
+ return err |
|
| 2302 |
+ } |
|
| 2303 |
+ } else {
|
|
| 2304 |
+ out.DownwardAPI = nil |
|
| 2305 |
+ } |
|
| 2306 |
+ return nil |
|
| 2307 |
+} |
|
| 2308 |
+ |
|
| 2309 |
+func convert_v1beta3_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in *AWSElasticBlockStoreVolumeSource, out *api.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error {
|
|
| 2310 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2311 |
+ defaulting.(func(*AWSElasticBlockStoreVolumeSource))(in) |
|
| 2312 |
+ } |
|
| 2313 |
+ out.VolumeID = in.VolumeID |
|
| 2314 |
+ out.FSType = in.FSType |
|
| 2315 |
+ out.Partition = in.Partition |
|
| 2316 |
+ out.ReadOnly = in.ReadOnly |
|
| 2317 |
+ return nil |
|
| 2318 |
+} |
|
| 2319 |
+ |
|
| 2320 |
+func convert_v1beta3_Binding_To_api_Binding(in *Binding, out *api.Binding, s conversion.Scope) error {
|
|
| 2321 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2322 |
+ defaulting.(func(*Binding))(in) |
|
| 2323 |
+ } |
|
| 2324 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2325 |
+ return err |
|
| 2326 |
+ } |
|
| 2327 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2328 |
+ return err |
|
| 2329 |
+ } |
|
| 2330 |
+ if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(&in.Target, &out.Target, s); err != nil {
|
|
| 2331 |
+ return err |
|
| 2332 |
+ } |
|
| 2333 |
+ return nil |
|
| 2334 |
+} |
|
| 2335 |
+ |
|
| 2336 |
+func convert_v1beta3_Capabilities_To_api_Capabilities(in *Capabilities, out *api.Capabilities, s conversion.Scope) error {
|
|
| 2337 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2338 |
+ defaulting.(func(*Capabilities))(in) |
|
| 2339 |
+ } |
|
| 2340 |
+ if in.Add != nil {
|
|
| 2341 |
+ out.Add = make([]api.Capability, len(in.Add)) |
|
| 2342 |
+ for i := range in.Add {
|
|
| 2343 |
+ out.Add[i] = api.Capability(in.Add[i]) |
|
| 2344 |
+ } |
|
| 2345 |
+ } else {
|
|
| 2346 |
+ out.Add = nil |
|
| 2347 |
+ } |
|
| 2348 |
+ if in.Drop != nil {
|
|
| 2349 |
+ out.Drop = make([]api.Capability, len(in.Drop)) |
|
| 2350 |
+ for i := range in.Drop {
|
|
| 2351 |
+ out.Drop[i] = api.Capability(in.Drop[i]) |
|
| 2352 |
+ } |
|
| 2353 |
+ } else {
|
|
| 2354 |
+ out.Drop = nil |
|
| 2355 |
+ } |
|
| 2356 |
+ return nil |
|
| 2357 |
+} |
|
| 2358 |
+ |
|
| 2359 |
+func convert_v1beta3_CephFSVolumeSource_To_api_CephFSVolumeSource(in *CephFSVolumeSource, out *api.CephFSVolumeSource, s conversion.Scope) error {
|
|
| 2360 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2361 |
+ defaulting.(func(*CephFSVolumeSource))(in) |
|
| 2362 |
+ } |
|
| 2363 |
+ if in.Monitors != nil {
|
|
| 2364 |
+ out.Monitors = make([]string, len(in.Monitors)) |
|
| 2365 |
+ for i := range in.Monitors {
|
|
| 2366 |
+ out.Monitors[i] = in.Monitors[i] |
|
| 2367 |
+ } |
|
| 2368 |
+ } else {
|
|
| 2369 |
+ out.Monitors = nil |
|
| 2370 |
+ } |
|
| 2371 |
+ out.User = in.User |
|
| 2372 |
+ out.SecretFile = in.SecretFile |
|
| 2373 |
+ if in.SecretRef != nil {
|
|
| 2374 |
+ out.SecretRef = new(api.LocalObjectReference) |
|
| 2375 |
+ if err := convert_v1beta3_LocalObjectReference_To_api_LocalObjectReference(in.SecretRef, out.SecretRef, s); err != nil {
|
|
| 2376 |
+ return err |
|
| 2377 |
+ } |
|
| 2378 |
+ } else {
|
|
| 2379 |
+ out.SecretRef = nil |
|
| 2380 |
+ } |
|
| 2381 |
+ out.ReadOnly = in.ReadOnly |
|
| 2382 |
+ return nil |
|
| 2383 |
+} |
|
| 2384 |
+ |
|
| 2385 |
+func convert_v1beta3_CinderVolumeSource_To_api_CinderVolumeSource(in *CinderVolumeSource, out *api.CinderVolumeSource, s conversion.Scope) error {
|
|
| 2386 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2387 |
+ defaulting.(func(*CinderVolumeSource))(in) |
|
| 2388 |
+ } |
|
| 2389 |
+ out.VolumeID = in.VolumeID |
|
| 2390 |
+ out.FSType = in.FSType |
|
| 2391 |
+ out.ReadOnly = in.ReadOnly |
|
| 2392 |
+ return nil |
|
| 2393 |
+} |
|
| 2394 |
+ |
|
| 2395 |
+func convert_v1beta3_ComponentCondition_To_api_ComponentCondition(in *ComponentCondition, out *api.ComponentCondition, s conversion.Scope) error {
|
|
| 2396 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2397 |
+ defaulting.(func(*ComponentCondition))(in) |
|
| 2398 |
+ } |
|
| 2399 |
+ out.Type = api.ComponentConditionType(in.Type) |
|
| 2400 |
+ out.Status = api.ConditionStatus(in.Status) |
|
| 2401 |
+ out.Message = in.Message |
|
| 2402 |
+ out.Error = in.Error |
|
| 2403 |
+ return nil |
|
| 2404 |
+} |
|
| 2405 |
+ |
|
| 2406 |
+func convert_v1beta3_ComponentStatus_To_api_ComponentStatus(in *ComponentStatus, out *api.ComponentStatus, s conversion.Scope) error {
|
|
| 2407 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2408 |
+ defaulting.(func(*ComponentStatus))(in) |
|
| 2409 |
+ } |
|
| 2410 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2411 |
+ return err |
|
| 2412 |
+ } |
|
| 2413 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2414 |
+ return err |
|
| 2415 |
+ } |
|
| 2416 |
+ if in.Conditions != nil {
|
|
| 2417 |
+ out.Conditions = make([]api.ComponentCondition, len(in.Conditions)) |
|
| 2418 |
+ for i := range in.Conditions {
|
|
| 2419 |
+ if err := convert_v1beta3_ComponentCondition_To_api_ComponentCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
|
| 2420 |
+ return err |
|
| 2421 |
+ } |
|
| 2422 |
+ } |
|
| 2423 |
+ } else {
|
|
| 2424 |
+ out.Conditions = nil |
|
| 2425 |
+ } |
|
| 2426 |
+ return nil |
|
| 2427 |
+} |
|
| 2428 |
+ |
|
| 2429 |
+func convert_v1beta3_ComponentStatusList_To_api_ComponentStatusList(in *ComponentStatusList, out *api.ComponentStatusList, s conversion.Scope) error {
|
|
| 2430 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2431 |
+ defaulting.(func(*ComponentStatusList))(in) |
|
| 2432 |
+ } |
|
| 2433 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2434 |
+ return err |
|
| 2435 |
+ } |
|
| 2436 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2437 |
+ return err |
|
| 2438 |
+ } |
|
| 2439 |
+ if in.Items != nil {
|
|
| 2440 |
+ out.Items = make([]api.ComponentStatus, len(in.Items)) |
|
| 2441 |
+ for i := range in.Items {
|
|
| 2442 |
+ if err := convert_v1beta3_ComponentStatus_To_api_ComponentStatus(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2443 |
+ return err |
|
| 2444 |
+ } |
|
| 2445 |
+ } |
|
| 2446 |
+ } else {
|
|
| 2447 |
+ out.Items = nil |
|
| 2448 |
+ } |
|
| 2449 |
+ return nil |
|
| 2450 |
+} |
|
| 2451 |
+ |
|
| 2452 |
+func convert_v1beta3_ContainerPort_To_api_ContainerPort(in *ContainerPort, out *api.ContainerPort, s conversion.Scope) error {
|
|
| 2453 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2454 |
+ defaulting.(func(*ContainerPort))(in) |
|
| 2455 |
+ } |
|
| 2456 |
+ out.Name = in.Name |
|
| 2457 |
+ out.HostPort = in.HostPort |
|
| 2458 |
+ out.ContainerPort = in.ContainerPort |
|
| 2459 |
+ out.Protocol = api.Protocol(in.Protocol) |
|
| 2460 |
+ out.HostIP = in.HostIP |
|
| 2461 |
+ return nil |
|
| 2462 |
+} |
|
| 2463 |
+ |
|
| 2464 |
+func convert_v1beta3_ContainerStateRunning_To_api_ContainerStateRunning(in *ContainerStateRunning, out *api.ContainerStateRunning, s conversion.Scope) error {
|
|
| 2465 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2466 |
+ defaulting.(func(*ContainerStateRunning))(in) |
|
| 2467 |
+ } |
|
| 2468 |
+ if err := s.Convert(&in.StartedAt, &out.StartedAt, 0); err != nil {
|
|
| 2469 |
+ return err |
|
| 2470 |
+ } |
|
| 2471 |
+ return nil |
|
| 2472 |
+} |
|
| 2473 |
+ |
|
| 2474 |
+func convert_v1beta3_ContainerStateWaiting_To_api_ContainerStateWaiting(in *ContainerStateWaiting, out *api.ContainerStateWaiting, s conversion.Scope) error {
|
|
| 2475 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2476 |
+ defaulting.(func(*ContainerStateWaiting))(in) |
|
| 2477 |
+ } |
|
| 2478 |
+ out.Reason = in.Reason |
|
| 2479 |
+ return nil |
|
| 2480 |
+} |
|
| 2481 |
+ |
|
| 2482 |
+func convert_v1beta3_ContainerStatus_To_api_ContainerStatus(in *ContainerStatus, out *api.ContainerStatus, s conversion.Scope) error {
|
|
| 2483 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2484 |
+ defaulting.(func(*ContainerStatus))(in) |
|
| 2485 |
+ } |
|
| 2486 |
+ out.Name = in.Name |
|
| 2487 |
+ if err := convert_v1beta3_ContainerState_To_api_ContainerState(&in.State, &out.State, s); err != nil {
|
|
| 2488 |
+ return err |
|
| 2489 |
+ } |
|
| 2490 |
+ if err := convert_v1beta3_ContainerState_To_api_ContainerState(&in.LastTerminationState, &out.LastTerminationState, s); err != nil {
|
|
| 2491 |
+ return err |
|
| 2492 |
+ } |
|
| 2493 |
+ out.Ready = in.Ready |
|
| 2494 |
+ out.RestartCount = in.RestartCount |
|
| 2495 |
+ out.Image = in.Image |
|
| 2496 |
+ out.ImageID = in.ImageID |
|
| 2497 |
+ out.ContainerID = in.ContainerID |
|
| 2498 |
+ return nil |
|
| 2499 |
+} |
|
| 2500 |
+ |
|
| 2501 |
+func convert_v1beta3_DeleteOptions_To_api_DeleteOptions(in *DeleteOptions, out *api.DeleteOptions, s conversion.Scope) error {
|
|
| 2502 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2503 |
+ defaulting.(func(*DeleteOptions))(in) |
|
| 2504 |
+ } |
|
| 2505 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2506 |
+ return err |
|
| 2507 |
+ } |
|
| 2508 |
+ if in.GracePeriodSeconds != nil {
|
|
| 2509 |
+ out.GracePeriodSeconds = new(int64) |
|
| 2510 |
+ *out.GracePeriodSeconds = *in.GracePeriodSeconds |
|
| 2511 |
+ } else {
|
|
| 2512 |
+ out.GracePeriodSeconds = nil |
|
| 2513 |
+ } |
|
| 2514 |
+ return nil |
|
| 2515 |
+} |
|
| 2516 |
+ |
|
| 2517 |
+func convert_v1beta3_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error {
|
|
| 2518 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2519 |
+ defaulting.(func(*DownwardAPIVolumeFile))(in) |
|
| 2520 |
+ } |
|
| 2521 |
+ out.Path = in.Path |
|
| 2522 |
+ if err := convert_v1beta3_ObjectFieldSelector_To_api_ObjectFieldSelector(&in.FieldRef, &out.FieldRef, s); err != nil {
|
|
| 2523 |
+ return err |
|
| 2524 |
+ } |
|
| 2525 |
+ return nil |
|
| 2526 |
+} |
|
| 2527 |
+ |
|
| 2528 |
+func convert_v1beta3_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *DownwardAPIVolumeSource, out *api.DownwardAPIVolumeSource, s conversion.Scope) error {
|
|
| 2529 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2530 |
+ defaulting.(func(*DownwardAPIVolumeSource))(in) |
|
| 2531 |
+ } |
|
| 2532 |
+ if in.Items != nil {
|
|
| 2533 |
+ out.Items = make([]api.DownwardAPIVolumeFile, len(in.Items)) |
|
| 2534 |
+ for i := range in.Items {
|
|
| 2535 |
+ if err := convert_v1beta3_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2536 |
+ return err |
|
| 2537 |
+ } |
|
| 2538 |
+ } |
|
| 2539 |
+ } else {
|
|
| 2540 |
+ out.Items = nil |
|
| 2541 |
+ } |
|
| 2542 |
+ return nil |
|
| 2543 |
+} |
|
| 2544 |
+ |
|
| 2545 |
+func convert_v1beta3_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(in *EmptyDirVolumeSource, out *api.EmptyDirVolumeSource, s conversion.Scope) error {
|
|
| 2546 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2547 |
+ defaulting.(func(*EmptyDirVolumeSource))(in) |
|
| 2548 |
+ } |
|
| 2549 |
+ out.Medium = api.StorageMedium(in.Medium) |
|
| 2550 |
+ return nil |
|
| 2551 |
+} |
|
| 2552 |
+ |
|
| 2553 |
+func convert_v1beta3_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out *api.EndpointAddress, s conversion.Scope) error {
|
|
| 2554 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2555 |
+ defaulting.(func(*EndpointAddress))(in) |
|
| 2556 |
+ } |
|
| 2557 |
+ out.IP = in.IP |
|
| 2558 |
+ if in.TargetRef != nil {
|
|
| 2559 |
+ out.TargetRef = new(api.ObjectReference) |
|
| 2560 |
+ if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(in.TargetRef, out.TargetRef, s); err != nil {
|
|
| 2561 |
+ return err |
|
| 2562 |
+ } |
|
| 2563 |
+ } else {
|
|
| 2564 |
+ out.TargetRef = nil |
|
| 2565 |
+ } |
|
| 2566 |
+ return nil |
|
| 2567 |
+} |
|
| 2568 |
+ |
|
| 2569 |
+func convert_v1beta3_EndpointPort_To_api_EndpointPort(in *EndpointPort, out *api.EndpointPort, s conversion.Scope) error {
|
|
| 2570 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2571 |
+ defaulting.(func(*EndpointPort))(in) |
|
| 2572 |
+ } |
|
| 2573 |
+ out.Name = in.Name |
|
| 2574 |
+ out.Port = in.Port |
|
| 2575 |
+ out.Protocol = api.Protocol(in.Protocol) |
|
| 2576 |
+ return nil |
|
| 2577 |
+} |
|
| 2578 |
+ |
|
| 2579 |
+func convert_v1beta3_EndpointSubset_To_api_EndpointSubset(in *EndpointSubset, out *api.EndpointSubset, s conversion.Scope) error {
|
|
| 2580 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2581 |
+ defaulting.(func(*EndpointSubset))(in) |
|
| 2582 |
+ } |
|
| 2583 |
+ if in.Addresses != nil {
|
|
| 2584 |
+ out.Addresses = make([]api.EndpointAddress, len(in.Addresses)) |
|
| 2585 |
+ for i := range in.Addresses {
|
|
| 2586 |
+ if err := convert_v1beta3_EndpointAddress_To_api_EndpointAddress(&in.Addresses[i], &out.Addresses[i], s); err != nil {
|
|
| 2587 |
+ return err |
|
| 2588 |
+ } |
|
| 2589 |
+ } |
|
| 2590 |
+ } else {
|
|
| 2591 |
+ out.Addresses = nil |
|
| 2592 |
+ } |
|
| 2593 |
+ if in.Ports != nil {
|
|
| 2594 |
+ out.Ports = make([]api.EndpointPort, len(in.Ports)) |
|
| 2595 |
+ for i := range in.Ports {
|
|
| 2596 |
+ if err := convert_v1beta3_EndpointPort_To_api_EndpointPort(&in.Ports[i], &out.Ports[i], s); err != nil {
|
|
| 2597 |
+ return err |
|
| 2598 |
+ } |
|
| 2599 |
+ } |
|
| 2600 |
+ } else {
|
|
| 2601 |
+ out.Ports = nil |
|
| 2602 |
+ } |
|
| 2603 |
+ return nil |
|
| 2604 |
+} |
|
| 2605 |
+ |
|
| 2606 |
+func convert_v1beta3_Endpoints_To_api_Endpoints(in *Endpoints, out *api.Endpoints, s conversion.Scope) error {
|
|
| 2607 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2608 |
+ defaulting.(func(*Endpoints))(in) |
|
| 2609 |
+ } |
|
| 2610 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2611 |
+ return err |
|
| 2612 |
+ } |
|
| 2613 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2614 |
+ return err |
|
| 2615 |
+ } |
|
| 2616 |
+ if in.Subsets != nil {
|
|
| 2617 |
+ out.Subsets = make([]api.EndpointSubset, len(in.Subsets)) |
|
| 2618 |
+ for i := range in.Subsets {
|
|
| 2619 |
+ if err := convert_v1beta3_EndpointSubset_To_api_EndpointSubset(&in.Subsets[i], &out.Subsets[i], s); err != nil {
|
|
| 2620 |
+ return err |
|
| 2621 |
+ } |
|
| 2622 |
+ } |
|
| 2623 |
+ } else {
|
|
| 2624 |
+ out.Subsets = nil |
|
| 2625 |
+ } |
|
| 2626 |
+ return nil |
|
| 2627 |
+} |
|
| 2628 |
+ |
|
| 2629 |
+func convert_v1beta3_EndpointsList_To_api_EndpointsList(in *EndpointsList, out *api.EndpointsList, s conversion.Scope) error {
|
|
| 2630 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2631 |
+ defaulting.(func(*EndpointsList))(in) |
|
| 2632 |
+ } |
|
| 2633 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2634 |
+ return err |
|
| 2635 |
+ } |
|
| 2636 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2637 |
+ return err |
|
| 2638 |
+ } |
|
| 2639 |
+ if in.Items != nil {
|
|
| 2640 |
+ out.Items = make([]api.Endpoints, len(in.Items)) |
|
| 2641 |
+ for i := range in.Items {
|
|
| 2642 |
+ if err := convert_v1beta3_Endpoints_To_api_Endpoints(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2643 |
+ return err |
|
| 2644 |
+ } |
|
| 2645 |
+ } |
|
| 2646 |
+ } else {
|
|
| 2647 |
+ out.Items = nil |
|
| 2648 |
+ } |
|
| 2649 |
+ return nil |
|
| 2650 |
+} |
|
| 2651 |
+ |
|
| 2652 |
+func convert_v1beta3_EnvVar_To_api_EnvVar(in *EnvVar, out *api.EnvVar, s conversion.Scope) error {
|
|
| 2653 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2654 |
+ defaulting.(func(*EnvVar))(in) |
|
| 2655 |
+ } |
|
| 2656 |
+ out.Name = in.Name |
|
| 2657 |
+ out.Value = in.Value |
|
| 2658 |
+ if in.ValueFrom != nil {
|
|
| 2659 |
+ out.ValueFrom = new(api.EnvVarSource) |
|
| 2660 |
+ if err := convert_v1beta3_EnvVarSource_To_api_EnvVarSource(in.ValueFrom, out.ValueFrom, s); err != nil {
|
|
| 2661 |
+ return err |
|
| 2662 |
+ } |
|
| 2663 |
+ } else {
|
|
| 2664 |
+ out.ValueFrom = nil |
|
| 2665 |
+ } |
|
| 2666 |
+ return nil |
|
| 2667 |
+} |
|
| 2668 |
+ |
|
| 2669 |
+func convert_v1beta3_EnvVarSource_To_api_EnvVarSource(in *EnvVarSource, out *api.EnvVarSource, s conversion.Scope) error {
|
|
| 2670 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2671 |
+ defaulting.(func(*EnvVarSource))(in) |
|
| 2672 |
+ } |
|
| 2673 |
+ if in.FieldRef != nil {
|
|
| 2674 |
+ out.FieldRef = new(api.ObjectFieldSelector) |
|
| 2675 |
+ if err := convert_v1beta3_ObjectFieldSelector_To_api_ObjectFieldSelector(in.FieldRef, out.FieldRef, s); err != nil {
|
|
| 2676 |
+ return err |
|
| 2677 |
+ } |
|
| 2678 |
+ } else {
|
|
| 2679 |
+ out.FieldRef = nil |
|
| 2680 |
+ } |
|
| 2681 |
+ return nil |
|
| 2682 |
+} |
|
| 2683 |
+ |
|
| 2684 |
+func convert_v1beta3_Event_To_api_Event(in *Event, out *api.Event, s conversion.Scope) error {
|
|
| 2685 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2686 |
+ defaulting.(func(*Event))(in) |
|
| 2687 |
+ } |
|
| 2688 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2689 |
+ return err |
|
| 2690 |
+ } |
|
| 2691 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2692 |
+ return err |
|
| 2693 |
+ } |
|
| 2694 |
+ if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil {
|
|
| 2695 |
+ return err |
|
| 2696 |
+ } |
|
| 2697 |
+ out.Reason = in.Reason |
|
| 2698 |
+ out.Message = in.Message |
|
| 2699 |
+ if err := convert_v1beta3_EventSource_To_api_EventSource(&in.Source, &out.Source, s); err != nil {
|
|
| 2700 |
+ return err |
|
| 2701 |
+ } |
|
| 2702 |
+ if err := s.Convert(&in.FirstTimestamp, &out.FirstTimestamp, 0); err != nil {
|
|
| 2703 |
+ return err |
|
| 2704 |
+ } |
|
| 2705 |
+ if err := s.Convert(&in.LastTimestamp, &out.LastTimestamp, 0); err != nil {
|
|
| 2706 |
+ return err |
|
| 2707 |
+ } |
|
| 2708 |
+ out.Count = in.Count |
|
| 2709 |
+ return nil |
|
| 2710 |
+} |
|
| 2711 |
+ |
|
| 2712 |
+func convert_v1beta3_EventList_To_api_EventList(in *EventList, out *api.EventList, s conversion.Scope) error {
|
|
| 2713 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2714 |
+ defaulting.(func(*EventList))(in) |
|
| 2715 |
+ } |
|
| 2716 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2717 |
+ return err |
|
| 2718 |
+ } |
|
| 2719 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2720 |
+ return err |
|
| 2721 |
+ } |
|
| 2722 |
+ if in.Items != nil {
|
|
| 2723 |
+ out.Items = make([]api.Event, len(in.Items)) |
|
| 2724 |
+ for i := range in.Items {
|
|
| 2725 |
+ if err := convert_v1beta3_Event_To_api_Event(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2726 |
+ return err |
|
| 2727 |
+ } |
|
| 2728 |
+ } |
|
| 2729 |
+ } else {
|
|
| 2730 |
+ out.Items = nil |
|
| 2731 |
+ } |
|
| 2732 |
+ return nil |
|
| 2733 |
+} |
|
| 2734 |
+ |
|
| 2735 |
+func convert_v1beta3_EventSource_To_api_EventSource(in *EventSource, out *api.EventSource, s conversion.Scope) error {
|
|
| 2736 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2737 |
+ defaulting.(func(*EventSource))(in) |
|
| 2738 |
+ } |
|
| 2739 |
+ out.Component = in.Component |
|
| 2740 |
+ out.Host = in.Host |
|
| 2741 |
+ return nil |
|
| 2742 |
+} |
|
| 2743 |
+ |
|
| 2744 |
+func convert_v1beta3_ExecAction_To_api_ExecAction(in *ExecAction, out *api.ExecAction, s conversion.Scope) error {
|
|
| 2745 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2746 |
+ defaulting.(func(*ExecAction))(in) |
|
| 2747 |
+ } |
|
| 2748 |
+ if in.Command != nil {
|
|
| 2749 |
+ out.Command = make([]string, len(in.Command)) |
|
| 2750 |
+ for i := range in.Command {
|
|
| 2751 |
+ out.Command[i] = in.Command[i] |
|
| 2752 |
+ } |
|
| 2753 |
+ } else {
|
|
| 2754 |
+ out.Command = nil |
|
| 2755 |
+ } |
|
| 2756 |
+ return nil |
|
| 2757 |
+} |
|
| 2758 |
+ |
|
| 2759 |
+func convert_v1beta3_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(in *GCEPersistentDiskVolumeSource, out *api.GCEPersistentDiskVolumeSource, s conversion.Scope) error {
|
|
| 2760 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2761 |
+ defaulting.(func(*GCEPersistentDiskVolumeSource))(in) |
|
| 2762 |
+ } |
|
| 2763 |
+ out.PDName = in.PDName |
|
| 2764 |
+ out.FSType = in.FSType |
|
| 2765 |
+ out.Partition = in.Partition |
|
| 2766 |
+ out.ReadOnly = in.ReadOnly |
|
| 2767 |
+ return nil |
|
| 2768 |
+} |
|
| 2769 |
+ |
|
| 2770 |
+func convert_v1beta3_GitRepoVolumeSource_To_api_GitRepoVolumeSource(in *GitRepoVolumeSource, out *api.GitRepoVolumeSource, s conversion.Scope) error {
|
|
| 2771 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2772 |
+ defaulting.(func(*GitRepoVolumeSource))(in) |
|
| 2773 |
+ } |
|
| 2774 |
+ out.Repository = in.Repository |
|
| 2775 |
+ out.Revision = in.Revision |
|
| 2776 |
+ return nil |
|
| 2777 |
+} |
|
| 2778 |
+ |
|
| 2779 |
+func convert_v1beta3_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in *GlusterfsVolumeSource, out *api.GlusterfsVolumeSource, s conversion.Scope) error {
|
|
| 2780 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2781 |
+ defaulting.(func(*GlusterfsVolumeSource))(in) |
|
| 2782 |
+ } |
|
| 2783 |
+ out.EndpointsName = in.EndpointsName |
|
| 2784 |
+ out.Path = in.Path |
|
| 2785 |
+ out.ReadOnly = in.ReadOnly |
|
| 2786 |
+ return nil |
|
| 2787 |
+} |
|
| 2788 |
+ |
|
| 2789 |
+func convert_v1beta3_HTTPGetAction_To_api_HTTPGetAction(in *HTTPGetAction, out *api.HTTPGetAction, s conversion.Scope) error {
|
|
| 2790 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2791 |
+ defaulting.(func(*HTTPGetAction))(in) |
|
| 2792 |
+ } |
|
| 2793 |
+ out.Path = in.Path |
|
| 2794 |
+ if err := s.Convert(&in.Port, &out.Port, 0); err != nil {
|
|
| 2795 |
+ return err |
|
| 2796 |
+ } |
|
| 2797 |
+ out.Host = in.Host |
|
| 2798 |
+ out.Scheme = api.URIScheme(in.Scheme) |
|
| 2799 |
+ return nil |
|
| 2800 |
+} |
|
| 2801 |
+ |
|
| 2802 |
+func convert_v1beta3_Handler_To_api_Handler(in *Handler, out *api.Handler, s conversion.Scope) error {
|
|
| 2803 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2804 |
+ defaulting.(func(*Handler))(in) |
|
| 2805 |
+ } |
|
| 2806 |
+ if in.Exec != nil {
|
|
| 2807 |
+ out.Exec = new(api.ExecAction) |
|
| 2808 |
+ if err := convert_v1beta3_ExecAction_To_api_ExecAction(in.Exec, out.Exec, s); err != nil {
|
|
| 2809 |
+ return err |
|
| 2810 |
+ } |
|
| 2811 |
+ } else {
|
|
| 2812 |
+ out.Exec = nil |
|
| 2813 |
+ } |
|
| 2814 |
+ if in.HTTPGet != nil {
|
|
| 2815 |
+ out.HTTPGet = new(api.HTTPGetAction) |
|
| 2816 |
+ if err := convert_v1beta3_HTTPGetAction_To_api_HTTPGetAction(in.HTTPGet, out.HTTPGet, s); err != nil {
|
|
| 2817 |
+ return err |
|
| 2818 |
+ } |
|
| 2819 |
+ } else {
|
|
| 2820 |
+ out.HTTPGet = nil |
|
| 2821 |
+ } |
|
| 2822 |
+ if in.TCPSocket != nil {
|
|
| 2823 |
+ out.TCPSocket = new(api.TCPSocketAction) |
|
| 2824 |
+ if err := convert_v1beta3_TCPSocketAction_To_api_TCPSocketAction(in.TCPSocket, out.TCPSocket, s); err != nil {
|
|
| 2825 |
+ return err |
|
| 2826 |
+ } |
|
| 2827 |
+ } else {
|
|
| 2828 |
+ out.TCPSocket = nil |
|
| 2829 |
+ } |
|
| 2830 |
+ return nil |
|
| 2831 |
+} |
|
| 2832 |
+ |
|
| 2833 |
+func convert_v1beta3_HostPathVolumeSource_To_api_HostPathVolumeSource(in *HostPathVolumeSource, out *api.HostPathVolumeSource, s conversion.Scope) error {
|
|
| 2834 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2835 |
+ defaulting.(func(*HostPathVolumeSource))(in) |
|
| 2836 |
+ } |
|
| 2837 |
+ out.Path = in.Path |
|
| 2838 |
+ return nil |
|
| 2839 |
+} |
|
| 2840 |
+ |
|
| 2841 |
+func convert_v1beta3_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in *ISCSIVolumeSource, out *api.ISCSIVolumeSource, s conversion.Scope) error {
|
|
| 2842 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2843 |
+ defaulting.(func(*ISCSIVolumeSource))(in) |
|
| 2844 |
+ } |
|
| 2845 |
+ out.TargetPortal = in.TargetPortal |
|
| 2846 |
+ out.IQN = in.IQN |
|
| 2847 |
+ out.Lun = in.Lun |
|
| 2848 |
+ out.FSType = in.FSType |
|
| 2849 |
+ out.ReadOnly = in.ReadOnly |
|
| 2850 |
+ return nil |
|
| 2851 |
+} |
|
| 2852 |
+ |
|
| 2853 |
+func convert_v1beta3_Lifecycle_To_api_Lifecycle(in *Lifecycle, out *api.Lifecycle, s conversion.Scope) error {
|
|
| 2854 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2855 |
+ defaulting.(func(*Lifecycle))(in) |
|
| 2856 |
+ } |
|
| 2857 |
+ if in.PostStart != nil {
|
|
| 2858 |
+ out.PostStart = new(api.Handler) |
|
| 2859 |
+ if err := convert_v1beta3_Handler_To_api_Handler(in.PostStart, out.PostStart, s); err != nil {
|
|
| 2860 |
+ return err |
|
| 2861 |
+ } |
|
| 2862 |
+ } else {
|
|
| 2863 |
+ out.PostStart = nil |
|
| 2864 |
+ } |
|
| 2865 |
+ if in.PreStop != nil {
|
|
| 2866 |
+ out.PreStop = new(api.Handler) |
|
| 2867 |
+ if err := convert_v1beta3_Handler_To_api_Handler(in.PreStop, out.PreStop, s); err != nil {
|
|
| 2868 |
+ return err |
|
| 2869 |
+ } |
|
| 2870 |
+ } else {
|
|
| 2871 |
+ out.PreStop = nil |
|
| 2872 |
+ } |
|
| 2873 |
+ return nil |
|
| 2874 |
+} |
|
| 2875 |
+ |
|
| 2876 |
+func convert_v1beta3_LimitRange_To_api_LimitRange(in *LimitRange, out *api.LimitRange, s conversion.Scope) error {
|
|
| 2877 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2878 |
+ defaulting.(func(*LimitRange))(in) |
|
| 2879 |
+ } |
|
| 2880 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2881 |
+ return err |
|
| 2882 |
+ } |
|
| 2883 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 2884 |
+ return err |
|
| 2885 |
+ } |
|
| 2886 |
+ if err := convert_v1beta3_LimitRangeSpec_To_api_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 2887 |
+ return err |
|
| 2888 |
+ } |
|
| 2889 |
+ return nil |
|
| 2890 |
+} |
|
| 2891 |
+ |
|
| 2892 |
+func convert_v1beta3_LimitRangeItem_To_api_LimitRangeItem(in *LimitRangeItem, out *api.LimitRangeItem, s conversion.Scope) error {
|
|
| 2893 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2894 |
+ defaulting.(func(*LimitRangeItem))(in) |
|
| 2895 |
+ } |
|
| 2896 |
+ out.Type = api.LimitType(in.Type) |
|
| 2897 |
+ if in.Max != nil {
|
|
| 2898 |
+ out.Max = make(api.ResourceList) |
|
| 2899 |
+ for key, val := range in.Max {
|
|
| 2900 |
+ newVal := resource.Quantity{}
|
|
| 2901 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 2902 |
+ return err |
|
| 2903 |
+ } |
|
| 2904 |
+ out.Max[api.ResourceName(key)] = newVal |
|
| 2905 |
+ } |
|
| 2906 |
+ } else {
|
|
| 2907 |
+ out.Max = nil |
|
| 2908 |
+ } |
|
| 2909 |
+ if in.Min != nil {
|
|
| 2910 |
+ out.Min = make(api.ResourceList) |
|
| 2911 |
+ for key, val := range in.Min {
|
|
| 2912 |
+ newVal := resource.Quantity{}
|
|
| 2913 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 2914 |
+ return err |
|
| 2915 |
+ } |
|
| 2916 |
+ out.Min[api.ResourceName(key)] = newVal |
|
| 2917 |
+ } |
|
| 2918 |
+ } else {
|
|
| 2919 |
+ out.Min = nil |
|
| 2920 |
+ } |
|
| 2921 |
+ if in.Default != nil {
|
|
| 2922 |
+ out.Default = make(api.ResourceList) |
|
| 2923 |
+ for key, val := range in.Default {
|
|
| 2924 |
+ newVal := resource.Quantity{}
|
|
| 2925 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 2926 |
+ return err |
|
| 2927 |
+ } |
|
| 2928 |
+ out.Default[api.ResourceName(key)] = newVal |
|
| 2929 |
+ } |
|
| 2930 |
+ } else {
|
|
| 2931 |
+ out.Default = nil |
|
| 2932 |
+ } |
|
| 2933 |
+ if in.DefaultRequest != nil {
|
|
| 2934 |
+ out.DefaultRequest = make(api.ResourceList) |
|
| 2935 |
+ for key, val := range in.DefaultRequest {
|
|
| 2936 |
+ newVal := resource.Quantity{}
|
|
| 2937 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 2938 |
+ return err |
|
| 2939 |
+ } |
|
| 2940 |
+ out.DefaultRequest[api.ResourceName(key)] = newVal |
|
| 2941 |
+ } |
|
| 2942 |
+ } else {
|
|
| 2943 |
+ out.DefaultRequest = nil |
|
| 2944 |
+ } |
|
| 2945 |
+ if in.MaxLimitRequestRatio != nil {
|
|
| 2946 |
+ out.MaxLimitRequestRatio = make(api.ResourceList) |
|
| 2947 |
+ for key, val := range in.MaxLimitRequestRatio {
|
|
| 2948 |
+ newVal := resource.Quantity{}
|
|
| 2949 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 2950 |
+ return err |
|
| 2951 |
+ } |
|
| 2952 |
+ out.MaxLimitRequestRatio[api.ResourceName(key)] = newVal |
|
| 2953 |
+ } |
|
| 2954 |
+ } else {
|
|
| 2955 |
+ out.MaxLimitRequestRatio = nil |
|
| 2956 |
+ } |
|
| 2957 |
+ return nil |
|
| 2958 |
+} |
|
| 2959 |
+ |
|
| 2960 |
+func convert_v1beta3_LimitRangeList_To_api_LimitRangeList(in *LimitRangeList, out *api.LimitRangeList, s conversion.Scope) error {
|
|
| 2961 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2962 |
+ defaulting.(func(*LimitRangeList))(in) |
|
| 2963 |
+ } |
|
| 2964 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 2965 |
+ return err |
|
| 2966 |
+ } |
|
| 2967 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 2968 |
+ return err |
|
| 2969 |
+ } |
|
| 2970 |
+ if in.Items != nil {
|
|
| 2971 |
+ out.Items = make([]api.LimitRange, len(in.Items)) |
|
| 2972 |
+ for i := range in.Items {
|
|
| 2973 |
+ if err := convert_v1beta3_LimitRange_To_api_LimitRange(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 2974 |
+ return err |
|
| 2975 |
+ } |
|
| 2976 |
+ } |
|
| 2977 |
+ } else {
|
|
| 2978 |
+ out.Items = nil |
|
| 2979 |
+ } |
|
| 2980 |
+ return nil |
|
| 2981 |
+} |
|
| 2982 |
+ |
|
| 2983 |
+func convert_v1beta3_LimitRangeSpec_To_api_LimitRangeSpec(in *LimitRangeSpec, out *api.LimitRangeSpec, s conversion.Scope) error {
|
|
| 2984 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 2985 |
+ defaulting.(func(*LimitRangeSpec))(in) |
|
| 2986 |
+ } |
|
| 2987 |
+ if in.Limits != nil {
|
|
| 2988 |
+ out.Limits = make([]api.LimitRangeItem, len(in.Limits)) |
|
| 2989 |
+ for i := range in.Limits {
|
|
| 2990 |
+ if err := convert_v1beta3_LimitRangeItem_To_api_LimitRangeItem(&in.Limits[i], &out.Limits[i], s); err != nil {
|
|
| 2991 |
+ return err |
|
| 2992 |
+ } |
|
| 2993 |
+ } |
|
| 2994 |
+ } else {
|
|
| 2995 |
+ out.Limits = nil |
|
| 2996 |
+ } |
|
| 2997 |
+ return nil |
|
| 2998 |
+} |
|
| 2999 |
+ |
|
| 3000 |
+func convert_v1beta3_List_To_api_List(in *List, out *api.List, s conversion.Scope) error {
|
|
| 3001 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3002 |
+ defaulting.(func(*List))(in) |
|
| 3003 |
+ } |
|
| 3004 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3005 |
+ return err |
|
| 3006 |
+ } |
|
| 3007 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3008 |
+ return err |
|
| 3009 |
+ } |
|
| 3010 |
+ if err := s.Convert(&in.Items, &out.Items, 0); err != nil {
|
|
| 3011 |
+ return err |
|
| 3012 |
+ } |
|
| 3013 |
+ return nil |
|
| 3014 |
+} |
|
| 3015 |
+ |
|
| 3016 |
+func convert_v1beta3_ListMeta_To_api_ListMeta(in *ListMeta, out *api.ListMeta, s conversion.Scope) error {
|
|
| 3017 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3018 |
+ defaulting.(func(*ListMeta))(in) |
|
| 3019 |
+ } |
|
| 3020 |
+ out.SelfLink = in.SelfLink |
|
| 3021 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 3022 |
+ return nil |
|
| 3023 |
+} |
|
| 3024 |
+ |
|
| 3025 |
+func convert_v1beta3_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error {
|
|
| 3026 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3027 |
+ defaulting.(func(*ListOptions))(in) |
|
| 3028 |
+ } |
|
| 3029 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3030 |
+ return err |
|
| 3031 |
+ } |
|
| 3032 |
+ if err := s.Convert(&in.LabelSelector, &out.LabelSelector, 0); err != nil {
|
|
| 3033 |
+ return err |
|
| 3034 |
+ } |
|
| 3035 |
+ if err := s.Convert(&in.FieldSelector, &out.FieldSelector, 0); err != nil {
|
|
| 3036 |
+ return err |
|
| 3037 |
+ } |
|
| 3038 |
+ out.Watch = in.Watch |
|
| 3039 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 3040 |
+ return nil |
|
| 3041 |
+} |
|
| 3042 |
+ |
|
| 3043 |
+func convert_v1beta3_LoadBalancerIngress_To_api_LoadBalancerIngress(in *LoadBalancerIngress, out *api.LoadBalancerIngress, s conversion.Scope) error {
|
|
| 3044 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3045 |
+ defaulting.(func(*LoadBalancerIngress))(in) |
|
| 3046 |
+ } |
|
| 3047 |
+ out.IP = in.IP |
|
| 3048 |
+ out.Hostname = in.Hostname |
|
| 3049 |
+ return nil |
|
| 3050 |
+} |
|
| 3051 |
+ |
|
| 3052 |
+func convert_v1beta3_LoadBalancerStatus_To_api_LoadBalancerStatus(in *LoadBalancerStatus, out *api.LoadBalancerStatus, s conversion.Scope) error {
|
|
| 3053 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3054 |
+ defaulting.(func(*LoadBalancerStatus))(in) |
|
| 3055 |
+ } |
|
| 3056 |
+ if in.Ingress != nil {
|
|
| 3057 |
+ out.Ingress = make([]api.LoadBalancerIngress, len(in.Ingress)) |
|
| 3058 |
+ for i := range in.Ingress {
|
|
| 3059 |
+ if err := convert_v1beta3_LoadBalancerIngress_To_api_LoadBalancerIngress(&in.Ingress[i], &out.Ingress[i], s); err != nil {
|
|
| 3060 |
+ return err |
|
| 3061 |
+ } |
|
| 3062 |
+ } |
|
| 3063 |
+ } else {
|
|
| 3064 |
+ out.Ingress = nil |
|
| 3065 |
+ } |
|
| 3066 |
+ return nil |
|
| 3067 |
+} |
|
| 3068 |
+ |
|
| 3069 |
+func convert_v1beta3_LocalObjectReference_To_api_LocalObjectReference(in *LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error {
|
|
| 3070 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3071 |
+ defaulting.(func(*LocalObjectReference))(in) |
|
| 3072 |
+ } |
|
| 3073 |
+ out.Name = in.Name |
|
| 3074 |
+ return nil |
|
| 3075 |
+} |
|
| 3076 |
+ |
|
| 3077 |
+func convert_v1beta3_NFSVolumeSource_To_api_NFSVolumeSource(in *NFSVolumeSource, out *api.NFSVolumeSource, s conversion.Scope) error {
|
|
| 3078 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3079 |
+ defaulting.(func(*NFSVolumeSource))(in) |
|
| 3080 |
+ } |
|
| 3081 |
+ out.Server = in.Server |
|
| 3082 |
+ out.Path = in.Path |
|
| 3083 |
+ out.ReadOnly = in.ReadOnly |
|
| 3084 |
+ return nil |
|
| 3085 |
+} |
|
| 3086 |
+ |
|
| 3087 |
+func convert_v1beta3_Namespace_To_api_Namespace(in *Namespace, out *api.Namespace, s conversion.Scope) error {
|
|
| 3088 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3089 |
+ defaulting.(func(*Namespace))(in) |
|
| 3090 |
+ } |
|
| 3091 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3092 |
+ return err |
|
| 3093 |
+ } |
|
| 3094 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3095 |
+ return err |
|
| 3096 |
+ } |
|
| 3097 |
+ if err := convert_v1beta3_NamespaceSpec_To_api_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3098 |
+ return err |
|
| 3099 |
+ } |
|
| 3100 |
+ if err := convert_v1beta3_NamespaceStatus_To_api_NamespaceStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3101 |
+ return err |
|
| 3102 |
+ } |
|
| 3103 |
+ return nil |
|
| 3104 |
+} |
|
| 3105 |
+ |
|
| 3106 |
+func convert_v1beta3_NamespaceList_To_api_NamespaceList(in *NamespaceList, out *api.NamespaceList, s conversion.Scope) error {
|
|
| 3107 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3108 |
+ defaulting.(func(*NamespaceList))(in) |
|
| 3109 |
+ } |
|
| 3110 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3111 |
+ return err |
|
| 3112 |
+ } |
|
| 3113 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3114 |
+ return err |
|
| 3115 |
+ } |
|
| 3116 |
+ if in.Items != nil {
|
|
| 3117 |
+ out.Items = make([]api.Namespace, len(in.Items)) |
|
| 3118 |
+ for i := range in.Items {
|
|
| 3119 |
+ if err := convert_v1beta3_Namespace_To_api_Namespace(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3120 |
+ return err |
|
| 3121 |
+ } |
|
| 3122 |
+ } |
|
| 3123 |
+ } else {
|
|
| 3124 |
+ out.Items = nil |
|
| 3125 |
+ } |
|
| 3126 |
+ return nil |
|
| 3127 |
+} |
|
| 3128 |
+ |
|
| 3129 |
+func convert_v1beta3_NamespaceSpec_To_api_NamespaceSpec(in *NamespaceSpec, out *api.NamespaceSpec, s conversion.Scope) error {
|
|
| 3130 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3131 |
+ defaulting.(func(*NamespaceSpec))(in) |
|
| 3132 |
+ } |
|
| 3133 |
+ if in.Finalizers != nil {
|
|
| 3134 |
+ out.Finalizers = make([]api.FinalizerName, len(in.Finalizers)) |
|
| 3135 |
+ for i := range in.Finalizers {
|
|
| 3136 |
+ out.Finalizers[i] = api.FinalizerName(in.Finalizers[i]) |
|
| 3137 |
+ } |
|
| 3138 |
+ } else {
|
|
| 3139 |
+ out.Finalizers = nil |
|
| 3140 |
+ } |
|
| 3141 |
+ return nil |
|
| 3142 |
+} |
|
| 3143 |
+ |
|
| 3144 |
+func convert_v1beta3_NamespaceStatus_To_api_NamespaceStatus(in *NamespaceStatus, out *api.NamespaceStatus, s conversion.Scope) error {
|
|
| 3145 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3146 |
+ defaulting.(func(*NamespaceStatus))(in) |
|
| 3147 |
+ } |
|
| 3148 |
+ out.Phase = api.NamespacePhase(in.Phase) |
|
| 3149 |
+ return nil |
|
| 3150 |
+} |
|
| 3151 |
+ |
|
| 3152 |
+func convert_v1beta3_Node_To_api_Node(in *Node, out *api.Node, s conversion.Scope) error {
|
|
| 3153 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3154 |
+ defaulting.(func(*Node))(in) |
|
| 3155 |
+ } |
|
| 3156 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3157 |
+ return err |
|
| 3158 |
+ } |
|
| 3159 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3160 |
+ return err |
|
| 3161 |
+ } |
|
| 3162 |
+ if err := convert_v1beta3_NodeSpec_To_api_NodeSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3163 |
+ return err |
|
| 3164 |
+ } |
|
| 3165 |
+ if err := convert_v1beta3_NodeStatus_To_api_NodeStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3166 |
+ return err |
|
| 3167 |
+ } |
|
| 3168 |
+ return nil |
|
| 3169 |
+} |
|
| 3170 |
+ |
|
| 3171 |
+func convert_v1beta3_NodeAddress_To_api_NodeAddress(in *NodeAddress, out *api.NodeAddress, s conversion.Scope) error {
|
|
| 3172 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3173 |
+ defaulting.(func(*NodeAddress))(in) |
|
| 3174 |
+ } |
|
| 3175 |
+ out.Type = api.NodeAddressType(in.Type) |
|
| 3176 |
+ out.Address = in.Address |
|
| 3177 |
+ return nil |
|
| 3178 |
+} |
|
| 3179 |
+ |
|
| 3180 |
+func convert_v1beta3_NodeCondition_To_api_NodeCondition(in *NodeCondition, out *api.NodeCondition, s conversion.Scope) error {
|
|
| 3181 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3182 |
+ defaulting.(func(*NodeCondition))(in) |
|
| 3183 |
+ } |
|
| 3184 |
+ out.Type = api.NodeConditionType(in.Type) |
|
| 3185 |
+ out.Status = api.ConditionStatus(in.Status) |
|
| 3186 |
+ if err := s.Convert(&in.LastHeartbeatTime, &out.LastHeartbeatTime, 0); err != nil {
|
|
| 3187 |
+ return err |
|
| 3188 |
+ } |
|
| 3189 |
+ if err := s.Convert(&in.LastTransitionTime, &out.LastTransitionTime, 0); err != nil {
|
|
| 3190 |
+ return err |
|
| 3191 |
+ } |
|
| 3192 |
+ out.Reason = in.Reason |
|
| 3193 |
+ out.Message = in.Message |
|
| 3194 |
+ return nil |
|
| 3195 |
+} |
|
| 3196 |
+ |
|
| 3197 |
+func convert_v1beta3_NodeList_To_api_NodeList(in *NodeList, out *api.NodeList, s conversion.Scope) error {
|
|
| 3198 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3199 |
+ defaulting.(func(*NodeList))(in) |
|
| 3200 |
+ } |
|
| 3201 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3202 |
+ return err |
|
| 3203 |
+ } |
|
| 3204 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3205 |
+ return err |
|
| 3206 |
+ } |
|
| 3207 |
+ if in.Items != nil {
|
|
| 3208 |
+ out.Items = make([]api.Node, len(in.Items)) |
|
| 3209 |
+ for i := range in.Items {
|
|
| 3210 |
+ if err := convert_v1beta3_Node_To_api_Node(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3211 |
+ return err |
|
| 3212 |
+ } |
|
| 3213 |
+ } |
|
| 3214 |
+ } else {
|
|
| 3215 |
+ out.Items = nil |
|
| 3216 |
+ } |
|
| 3217 |
+ return nil |
|
| 3218 |
+} |
|
| 3219 |
+ |
|
| 3220 |
+func convert_v1beta3_NodeSpec_To_api_NodeSpec(in *NodeSpec, out *api.NodeSpec, s conversion.Scope) error {
|
|
| 3221 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3222 |
+ defaulting.(func(*NodeSpec))(in) |
|
| 3223 |
+ } |
|
| 3224 |
+ out.PodCIDR = in.PodCIDR |
|
| 3225 |
+ out.ExternalID = in.ExternalID |
|
| 3226 |
+ out.ProviderID = in.ProviderID |
|
| 3227 |
+ out.Unschedulable = in.Unschedulable |
|
| 3228 |
+ return nil |
|
| 3229 |
+} |
|
| 3230 |
+ |
|
| 3231 |
+func convert_v1beta3_NodeStatus_To_api_NodeStatus(in *NodeStatus, out *api.NodeStatus, s conversion.Scope) error {
|
|
| 3232 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3233 |
+ defaulting.(func(*NodeStatus))(in) |
|
| 3234 |
+ } |
|
| 3235 |
+ if in.Capacity != nil {
|
|
| 3236 |
+ out.Capacity = make(api.ResourceList) |
|
| 3237 |
+ for key, val := range in.Capacity {
|
|
| 3238 |
+ newVal := resource.Quantity{}
|
|
| 3239 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 3240 |
+ return err |
|
| 3241 |
+ } |
|
| 3242 |
+ out.Capacity[api.ResourceName(key)] = newVal |
|
| 3243 |
+ } |
|
| 3244 |
+ } else {
|
|
| 3245 |
+ out.Capacity = nil |
|
| 3246 |
+ } |
|
| 3247 |
+ out.Phase = api.NodePhase(in.Phase) |
|
| 3248 |
+ if in.Conditions != nil {
|
|
| 3249 |
+ out.Conditions = make([]api.NodeCondition, len(in.Conditions)) |
|
| 3250 |
+ for i := range in.Conditions {
|
|
| 3251 |
+ if err := convert_v1beta3_NodeCondition_To_api_NodeCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
|
| 3252 |
+ return err |
|
| 3253 |
+ } |
|
| 3254 |
+ } |
|
| 3255 |
+ } else {
|
|
| 3256 |
+ out.Conditions = nil |
|
| 3257 |
+ } |
|
| 3258 |
+ if in.Addresses != nil {
|
|
| 3259 |
+ out.Addresses = make([]api.NodeAddress, len(in.Addresses)) |
|
| 3260 |
+ for i := range in.Addresses {
|
|
| 3261 |
+ if err := convert_v1beta3_NodeAddress_To_api_NodeAddress(&in.Addresses[i], &out.Addresses[i], s); err != nil {
|
|
| 3262 |
+ return err |
|
| 3263 |
+ } |
|
| 3264 |
+ } |
|
| 3265 |
+ } else {
|
|
| 3266 |
+ out.Addresses = nil |
|
| 3267 |
+ } |
|
| 3268 |
+ if err := convert_v1beta3_NodeSystemInfo_To_api_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil {
|
|
| 3269 |
+ return err |
|
| 3270 |
+ } |
|
| 3271 |
+ return nil |
|
| 3272 |
+} |
|
| 3273 |
+ |
|
| 3274 |
+func convert_v1beta3_NodeSystemInfo_To_api_NodeSystemInfo(in *NodeSystemInfo, out *api.NodeSystemInfo, s conversion.Scope) error {
|
|
| 3275 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3276 |
+ defaulting.(func(*NodeSystemInfo))(in) |
|
| 3277 |
+ } |
|
| 3278 |
+ out.MachineID = in.MachineID |
|
| 3279 |
+ out.SystemUUID = in.SystemUUID |
|
| 3280 |
+ out.BootID = in.BootID |
|
| 3281 |
+ out.KernelVersion = in.KernelVersion |
|
| 3282 |
+ out.OsImage = in.OsImage |
|
| 3283 |
+ out.ContainerRuntimeVersion = in.ContainerRuntimeVersion |
|
| 3284 |
+ out.KubeletVersion = in.KubeletVersion |
|
| 3285 |
+ out.KubeProxyVersion = in.KubeProxyVersion |
|
| 3286 |
+ return nil |
|
| 3287 |
+} |
|
| 3288 |
+ |
|
| 3289 |
+func convert_v1beta3_ObjectFieldSelector_To_api_ObjectFieldSelector(in *ObjectFieldSelector, out *api.ObjectFieldSelector, s conversion.Scope) error {
|
|
| 3290 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3291 |
+ defaulting.(func(*ObjectFieldSelector))(in) |
|
| 3292 |
+ } |
|
| 3293 |
+ out.APIVersion = in.APIVersion |
|
| 3294 |
+ out.FieldPath = in.FieldPath |
|
| 3295 |
+ return nil |
|
| 3296 |
+} |
|
| 3297 |
+ |
|
| 3298 |
+func convert_v1beta3_ObjectMeta_To_api_ObjectMeta(in *ObjectMeta, out *api.ObjectMeta, s conversion.Scope) error {
|
|
| 3299 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3300 |
+ defaulting.(func(*ObjectMeta))(in) |
|
| 3301 |
+ } |
|
| 3302 |
+ out.Name = in.Name |
|
| 3303 |
+ out.GenerateName = in.GenerateName |
|
| 3304 |
+ out.Namespace = in.Namespace |
|
| 3305 |
+ out.SelfLink = in.SelfLink |
|
| 3306 |
+ out.UID = in.UID |
|
| 3307 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 3308 |
+ out.Generation = in.Generation |
|
| 3309 |
+ if err := s.Convert(&in.CreationTimestamp, &out.CreationTimestamp, 0); err != nil {
|
|
| 3310 |
+ return err |
|
| 3311 |
+ } |
|
| 3312 |
+ if in.DeletionTimestamp != nil {
|
|
| 3313 |
+ if err := s.Convert(&in.DeletionTimestamp, &out.DeletionTimestamp, 0); err != nil {
|
|
| 3314 |
+ return err |
|
| 3315 |
+ } |
|
| 3316 |
+ } else {
|
|
| 3317 |
+ out.DeletionTimestamp = nil |
|
| 3318 |
+ } |
|
| 3319 |
+ if in.DeletionGracePeriodSeconds != nil {
|
|
| 3320 |
+ out.DeletionGracePeriodSeconds = new(int64) |
|
| 3321 |
+ *out.DeletionGracePeriodSeconds = *in.DeletionGracePeriodSeconds |
|
| 3322 |
+ } else {
|
|
| 3323 |
+ out.DeletionGracePeriodSeconds = nil |
|
| 3324 |
+ } |
|
| 3325 |
+ if in.Labels != nil {
|
|
| 3326 |
+ out.Labels = make(map[string]string) |
|
| 3327 |
+ for key, val := range in.Labels {
|
|
| 3328 |
+ out.Labels[key] = val |
|
| 3329 |
+ } |
|
| 3330 |
+ } else {
|
|
| 3331 |
+ out.Labels = nil |
|
| 3332 |
+ } |
|
| 3333 |
+ if in.Annotations != nil {
|
|
| 3334 |
+ out.Annotations = make(map[string]string) |
|
| 3335 |
+ for key, val := range in.Annotations {
|
|
| 3336 |
+ out.Annotations[key] = val |
|
| 3337 |
+ } |
|
| 3338 |
+ } else {
|
|
| 3339 |
+ out.Annotations = nil |
|
| 3340 |
+ } |
|
| 3341 |
+ return nil |
|
| 3342 |
+} |
|
| 3343 |
+ |
|
| 3344 |
+func convert_v1beta3_ObjectReference_To_api_ObjectReference(in *ObjectReference, out *api.ObjectReference, s conversion.Scope) error {
|
|
| 3345 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3346 |
+ defaulting.(func(*ObjectReference))(in) |
|
| 3347 |
+ } |
|
| 3348 |
+ out.Kind = in.Kind |
|
| 3349 |
+ out.Namespace = in.Namespace |
|
| 3350 |
+ out.Name = in.Name |
|
| 3351 |
+ out.UID = in.UID |
|
| 3352 |
+ out.APIVersion = in.APIVersion |
|
| 3353 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 3354 |
+ out.FieldPath = in.FieldPath |
|
| 3355 |
+ return nil |
|
| 3356 |
+} |
|
| 3357 |
+ |
|
| 3358 |
+func convert_v1beta3_PersistentVolume_To_api_PersistentVolume(in *PersistentVolume, out *api.PersistentVolume, s conversion.Scope) error {
|
|
| 3359 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3360 |
+ defaulting.(func(*PersistentVolume))(in) |
|
| 3361 |
+ } |
|
| 3362 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3363 |
+ return err |
|
| 3364 |
+ } |
|
| 3365 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3366 |
+ return err |
|
| 3367 |
+ } |
|
| 3368 |
+ if err := convert_v1beta3_PersistentVolumeSpec_To_api_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3369 |
+ return err |
|
| 3370 |
+ } |
|
| 3371 |
+ if err := convert_v1beta3_PersistentVolumeStatus_To_api_PersistentVolumeStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3372 |
+ return err |
|
| 3373 |
+ } |
|
| 3374 |
+ return nil |
|
| 3375 |
+} |
|
| 3376 |
+ |
|
| 3377 |
+func convert_v1beta3_PersistentVolumeClaim_To_api_PersistentVolumeClaim(in *PersistentVolumeClaim, out *api.PersistentVolumeClaim, s conversion.Scope) error {
|
|
| 3378 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3379 |
+ defaulting.(func(*PersistentVolumeClaim))(in) |
|
| 3380 |
+ } |
|
| 3381 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3382 |
+ return err |
|
| 3383 |
+ } |
|
| 3384 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3385 |
+ return err |
|
| 3386 |
+ } |
|
| 3387 |
+ if err := convert_v1beta3_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3388 |
+ return err |
|
| 3389 |
+ } |
|
| 3390 |
+ if err := convert_v1beta3_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3391 |
+ return err |
|
| 3392 |
+ } |
|
| 3393 |
+ return nil |
|
| 3394 |
+} |
|
| 3395 |
+ |
|
| 3396 |
+func convert_v1beta3_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList(in *PersistentVolumeClaimList, out *api.PersistentVolumeClaimList, s conversion.Scope) error {
|
|
| 3397 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3398 |
+ defaulting.(func(*PersistentVolumeClaimList))(in) |
|
| 3399 |
+ } |
|
| 3400 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3401 |
+ return err |
|
| 3402 |
+ } |
|
| 3403 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3404 |
+ return err |
|
| 3405 |
+ } |
|
| 3406 |
+ if in.Items != nil {
|
|
| 3407 |
+ out.Items = make([]api.PersistentVolumeClaim, len(in.Items)) |
|
| 3408 |
+ for i := range in.Items {
|
|
| 3409 |
+ if err := convert_v1beta3_PersistentVolumeClaim_To_api_PersistentVolumeClaim(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3410 |
+ return err |
|
| 3411 |
+ } |
|
| 3412 |
+ } |
|
| 3413 |
+ } else {
|
|
| 3414 |
+ out.Items = nil |
|
| 3415 |
+ } |
|
| 3416 |
+ return nil |
|
| 3417 |
+} |
|
| 3418 |
+ |
|
| 3419 |
+func convert_v1beta3_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(in *PersistentVolumeClaimSpec, out *api.PersistentVolumeClaimSpec, s conversion.Scope) error {
|
|
| 3420 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3421 |
+ defaulting.(func(*PersistentVolumeClaimSpec))(in) |
|
| 3422 |
+ } |
|
| 3423 |
+ if in.AccessModes != nil {
|
|
| 3424 |
+ out.AccessModes = make([]api.PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 3425 |
+ for i := range in.AccessModes {
|
|
| 3426 |
+ out.AccessModes[i] = api.PersistentVolumeAccessMode(in.AccessModes[i]) |
|
| 3427 |
+ } |
|
| 3428 |
+ } else {
|
|
| 3429 |
+ out.AccessModes = nil |
|
| 3430 |
+ } |
|
| 3431 |
+ if err := convert_v1beta3_ResourceRequirements_To_api_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil {
|
|
| 3432 |
+ return err |
|
| 3433 |
+ } |
|
| 3434 |
+ out.VolumeName = in.VolumeName |
|
| 3435 |
+ return nil |
|
| 3436 |
+} |
|
| 3437 |
+ |
|
| 3438 |
+func convert_v1beta3_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(in *PersistentVolumeClaimStatus, out *api.PersistentVolumeClaimStatus, s conversion.Scope) error {
|
|
| 3439 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3440 |
+ defaulting.(func(*PersistentVolumeClaimStatus))(in) |
|
| 3441 |
+ } |
|
| 3442 |
+ out.Phase = api.PersistentVolumeClaimPhase(in.Phase) |
|
| 3443 |
+ if in.AccessModes != nil {
|
|
| 3444 |
+ out.AccessModes = make([]api.PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 3445 |
+ for i := range in.AccessModes {
|
|
| 3446 |
+ out.AccessModes[i] = api.PersistentVolumeAccessMode(in.AccessModes[i]) |
|
| 3447 |
+ } |
|
| 3448 |
+ } else {
|
|
| 3449 |
+ out.AccessModes = nil |
|
| 3450 |
+ } |
|
| 3451 |
+ if in.Capacity != nil {
|
|
| 3452 |
+ out.Capacity = make(api.ResourceList) |
|
| 3453 |
+ for key, val := range in.Capacity {
|
|
| 3454 |
+ newVal := resource.Quantity{}
|
|
| 3455 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 3456 |
+ return err |
|
| 3457 |
+ } |
|
| 3458 |
+ out.Capacity[api.ResourceName(key)] = newVal |
|
| 3459 |
+ } |
|
| 3460 |
+ } else {
|
|
| 3461 |
+ out.Capacity = nil |
|
| 3462 |
+ } |
|
| 3463 |
+ return nil |
|
| 3464 |
+} |
|
| 3465 |
+ |
|
| 3466 |
+func convert_v1beta3_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *api.PersistentVolumeClaimVolumeSource, s conversion.Scope) error {
|
|
| 3467 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3468 |
+ defaulting.(func(*PersistentVolumeClaimVolumeSource))(in) |
|
| 3469 |
+ } |
|
| 3470 |
+ out.ClaimName = in.ClaimName |
|
| 3471 |
+ out.ReadOnly = in.ReadOnly |
|
| 3472 |
+ return nil |
|
| 3473 |
+} |
|
| 3474 |
+ |
|
| 3475 |
+func convert_v1beta3_PersistentVolumeList_To_api_PersistentVolumeList(in *PersistentVolumeList, out *api.PersistentVolumeList, s conversion.Scope) error {
|
|
| 3476 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3477 |
+ defaulting.(func(*PersistentVolumeList))(in) |
|
| 3478 |
+ } |
|
| 3479 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3480 |
+ return err |
|
| 3481 |
+ } |
|
| 3482 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3483 |
+ return err |
|
| 3484 |
+ } |
|
| 3485 |
+ if in.Items != nil {
|
|
| 3486 |
+ out.Items = make([]api.PersistentVolume, len(in.Items)) |
|
| 3487 |
+ for i := range in.Items {
|
|
| 3488 |
+ if err := convert_v1beta3_PersistentVolume_To_api_PersistentVolume(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3489 |
+ return err |
|
| 3490 |
+ } |
|
| 3491 |
+ } |
|
| 3492 |
+ } else {
|
|
| 3493 |
+ out.Items = nil |
|
| 3494 |
+ } |
|
| 3495 |
+ return nil |
|
| 3496 |
+} |
|
| 3497 |
+ |
|
| 3498 |
+func convert_v1beta3_PersistentVolumeSource_To_api_PersistentVolumeSource(in *PersistentVolumeSource, out *api.PersistentVolumeSource, s conversion.Scope) error {
|
|
| 3499 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3500 |
+ defaulting.(func(*PersistentVolumeSource))(in) |
|
| 3501 |
+ } |
|
| 3502 |
+ if in.GCEPersistentDisk != nil {
|
|
| 3503 |
+ out.GCEPersistentDisk = new(api.GCEPersistentDiskVolumeSource) |
|
| 3504 |
+ if err := convert_v1beta3_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(in.GCEPersistentDisk, out.GCEPersistentDisk, s); err != nil {
|
|
| 3505 |
+ return err |
|
| 3506 |
+ } |
|
| 3507 |
+ } else {
|
|
| 3508 |
+ out.GCEPersistentDisk = nil |
|
| 3509 |
+ } |
|
| 3510 |
+ if in.AWSElasticBlockStore != nil {
|
|
| 3511 |
+ out.AWSElasticBlockStore = new(api.AWSElasticBlockStoreVolumeSource) |
|
| 3512 |
+ if err := convert_v1beta3_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in.AWSElasticBlockStore, out.AWSElasticBlockStore, s); err != nil {
|
|
| 3513 |
+ return err |
|
| 3514 |
+ } |
|
| 3515 |
+ } else {
|
|
| 3516 |
+ out.AWSElasticBlockStore = nil |
|
| 3517 |
+ } |
|
| 3518 |
+ if in.HostPath != nil {
|
|
| 3519 |
+ out.HostPath = new(api.HostPathVolumeSource) |
|
| 3520 |
+ if err := convert_v1beta3_HostPathVolumeSource_To_api_HostPathVolumeSource(in.HostPath, out.HostPath, s); err != nil {
|
|
| 3521 |
+ return err |
|
| 3522 |
+ } |
|
| 3523 |
+ } else {
|
|
| 3524 |
+ out.HostPath = nil |
|
| 3525 |
+ } |
|
| 3526 |
+ if in.Glusterfs != nil {
|
|
| 3527 |
+ out.Glusterfs = new(api.GlusterfsVolumeSource) |
|
| 3528 |
+ if err := convert_v1beta3_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in.Glusterfs, out.Glusterfs, s); err != nil {
|
|
| 3529 |
+ return err |
|
| 3530 |
+ } |
|
| 3531 |
+ } else {
|
|
| 3532 |
+ out.Glusterfs = nil |
|
| 3533 |
+ } |
|
| 3534 |
+ if in.NFS != nil {
|
|
| 3535 |
+ out.NFS = new(api.NFSVolumeSource) |
|
| 3536 |
+ if err := convert_v1beta3_NFSVolumeSource_To_api_NFSVolumeSource(in.NFS, out.NFS, s); err != nil {
|
|
| 3537 |
+ return err |
|
| 3538 |
+ } |
|
| 3539 |
+ } else {
|
|
| 3540 |
+ out.NFS = nil |
|
| 3541 |
+ } |
|
| 3542 |
+ if in.RBD != nil {
|
|
| 3543 |
+ out.RBD = new(api.RBDVolumeSource) |
|
| 3544 |
+ if err := convert_v1beta3_RBDVolumeSource_To_api_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
|
| 3545 |
+ return err |
|
| 3546 |
+ } |
|
| 3547 |
+ } else {
|
|
| 3548 |
+ out.RBD = nil |
|
| 3549 |
+ } |
|
| 3550 |
+ if in.ISCSI != nil {
|
|
| 3551 |
+ out.ISCSI = new(api.ISCSIVolumeSource) |
|
| 3552 |
+ if err := convert_v1beta3_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in.ISCSI, out.ISCSI, s); err != nil {
|
|
| 3553 |
+ return err |
|
| 3554 |
+ } |
|
| 3555 |
+ } else {
|
|
| 3556 |
+ out.ISCSI = nil |
|
| 3557 |
+ } |
|
| 3558 |
+ if in.CephFS != nil {
|
|
| 3559 |
+ out.CephFS = new(api.CephFSVolumeSource) |
|
| 3560 |
+ if err := convert_v1beta3_CephFSVolumeSource_To_api_CephFSVolumeSource(in.CephFS, out.CephFS, s); err != nil {
|
|
| 3561 |
+ return err |
|
| 3562 |
+ } |
|
| 3563 |
+ } else {
|
|
| 3564 |
+ out.CephFS = nil |
|
| 3565 |
+ } |
|
| 3566 |
+ if in.Cinder != nil {
|
|
| 3567 |
+ out.Cinder = new(api.CinderVolumeSource) |
|
| 3568 |
+ if err := convert_v1beta3_CinderVolumeSource_To_api_CinderVolumeSource(in.Cinder, out.Cinder, s); err != nil {
|
|
| 3569 |
+ return err |
|
| 3570 |
+ } |
|
| 3571 |
+ } else {
|
|
| 3572 |
+ out.Cinder = nil |
|
| 3573 |
+ } |
|
| 3574 |
+ return nil |
|
| 3575 |
+} |
|
| 3576 |
+ |
|
| 3577 |
+func convert_v1beta3_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *PersistentVolumeSpec, out *api.PersistentVolumeSpec, s conversion.Scope) error {
|
|
| 3578 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3579 |
+ defaulting.(func(*PersistentVolumeSpec))(in) |
|
| 3580 |
+ } |
|
| 3581 |
+ if in.Capacity != nil {
|
|
| 3582 |
+ out.Capacity = make(api.ResourceList) |
|
| 3583 |
+ for key, val := range in.Capacity {
|
|
| 3584 |
+ newVal := resource.Quantity{}
|
|
| 3585 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 3586 |
+ return err |
|
| 3587 |
+ } |
|
| 3588 |
+ out.Capacity[api.ResourceName(key)] = newVal |
|
| 3589 |
+ } |
|
| 3590 |
+ } else {
|
|
| 3591 |
+ out.Capacity = nil |
|
| 3592 |
+ } |
|
| 3593 |
+ if err := convert_v1beta3_PersistentVolumeSource_To_api_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil {
|
|
| 3594 |
+ return err |
|
| 3595 |
+ } |
|
| 3596 |
+ if in.AccessModes != nil {
|
|
| 3597 |
+ out.AccessModes = make([]api.PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 3598 |
+ for i := range in.AccessModes {
|
|
| 3599 |
+ out.AccessModes[i] = api.PersistentVolumeAccessMode(in.AccessModes[i]) |
|
| 3600 |
+ } |
|
| 3601 |
+ } else {
|
|
| 3602 |
+ out.AccessModes = nil |
|
| 3603 |
+ } |
|
| 3604 |
+ if in.ClaimRef != nil {
|
|
| 3605 |
+ out.ClaimRef = new(api.ObjectReference) |
|
| 3606 |
+ if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(in.ClaimRef, out.ClaimRef, s); err != nil {
|
|
| 3607 |
+ return err |
|
| 3608 |
+ } |
|
| 3609 |
+ } else {
|
|
| 3610 |
+ out.ClaimRef = nil |
|
| 3611 |
+ } |
|
| 3612 |
+ out.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) |
|
| 3613 |
+ return nil |
|
| 3614 |
+} |
|
| 3615 |
+ |
|
| 3616 |
+func convert_v1beta3_PersistentVolumeStatus_To_api_PersistentVolumeStatus(in *PersistentVolumeStatus, out *api.PersistentVolumeStatus, s conversion.Scope) error {
|
|
| 3617 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3618 |
+ defaulting.(func(*PersistentVolumeStatus))(in) |
|
| 3619 |
+ } |
|
| 3620 |
+ out.Phase = api.PersistentVolumePhase(in.Phase) |
|
| 3621 |
+ out.Message = in.Message |
|
| 3622 |
+ out.Reason = in.Reason |
|
| 3623 |
+ return nil |
|
| 3624 |
+} |
|
| 3625 |
+ |
|
| 3626 |
+func convert_v1beta3_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error {
|
|
| 3627 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3628 |
+ defaulting.(func(*Pod))(in) |
|
| 3629 |
+ } |
|
| 3630 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3631 |
+ return err |
|
| 3632 |
+ } |
|
| 3633 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3634 |
+ return err |
|
| 3635 |
+ } |
|
| 3636 |
+ if err := convert_v1beta3_PodSpec_To_api_PodSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3637 |
+ return err |
|
| 3638 |
+ } |
|
| 3639 |
+ if err := convert_v1beta3_PodStatus_To_api_PodStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3640 |
+ return err |
|
| 3641 |
+ } |
|
| 3642 |
+ return nil |
|
| 3643 |
+} |
|
| 3644 |
+ |
|
| 3645 |
+func convert_v1beta3_PodCondition_To_api_PodCondition(in *PodCondition, out *api.PodCondition, s conversion.Scope) error {
|
|
| 3646 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3647 |
+ defaulting.(func(*PodCondition))(in) |
|
| 3648 |
+ } |
|
| 3649 |
+ out.Type = api.PodConditionType(in.Type) |
|
| 3650 |
+ out.Status = api.ConditionStatus(in.Status) |
|
| 3651 |
+ return nil |
|
| 3652 |
+} |
|
| 3653 |
+ |
|
| 3654 |
+func convert_v1beta3_PodExecOptions_To_api_PodExecOptions(in *PodExecOptions, out *api.PodExecOptions, s conversion.Scope) error {
|
|
| 3655 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3656 |
+ defaulting.(func(*PodExecOptions))(in) |
|
| 3657 |
+ } |
|
| 3658 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3659 |
+ return err |
|
| 3660 |
+ } |
|
| 3661 |
+ out.Stdin = in.Stdin |
|
| 3662 |
+ out.Stdout = in.Stdout |
|
| 3663 |
+ out.Stderr = in.Stderr |
|
| 3664 |
+ out.TTY = in.TTY |
|
| 3665 |
+ out.Container = in.Container |
|
| 3666 |
+ if in.Command != nil {
|
|
| 3667 |
+ out.Command = make([]string, len(in.Command)) |
|
| 3668 |
+ for i := range in.Command {
|
|
| 3669 |
+ out.Command[i] = in.Command[i] |
|
| 3670 |
+ } |
|
| 3671 |
+ } else {
|
|
| 3672 |
+ out.Command = nil |
|
| 3673 |
+ } |
|
| 3674 |
+ return nil |
|
| 3675 |
+} |
|
| 3676 |
+ |
|
| 3677 |
+func convert_v1beta3_PodList_To_api_PodList(in *PodList, out *api.PodList, s conversion.Scope) error {
|
|
| 3678 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3679 |
+ defaulting.(func(*PodList))(in) |
|
| 3680 |
+ } |
|
| 3681 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3682 |
+ return err |
|
| 3683 |
+ } |
|
| 3684 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3685 |
+ return err |
|
| 3686 |
+ } |
|
| 3687 |
+ if in.Items != nil {
|
|
| 3688 |
+ out.Items = make([]api.Pod, len(in.Items)) |
|
| 3689 |
+ for i := range in.Items {
|
|
| 3690 |
+ if err := convert_v1beta3_Pod_To_api_Pod(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3691 |
+ return err |
|
| 3692 |
+ } |
|
| 3693 |
+ } |
|
| 3694 |
+ } else {
|
|
| 3695 |
+ out.Items = nil |
|
| 3696 |
+ } |
|
| 3697 |
+ return nil |
|
| 3698 |
+} |
|
| 3699 |
+ |
|
| 3700 |
+func convert_v1beta3_PodLogOptions_To_api_PodLogOptions(in *PodLogOptions, out *api.PodLogOptions, s conversion.Scope) error {
|
|
| 3701 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3702 |
+ defaulting.(func(*PodLogOptions))(in) |
|
| 3703 |
+ } |
|
| 3704 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3705 |
+ return err |
|
| 3706 |
+ } |
|
| 3707 |
+ out.Container = in.Container |
|
| 3708 |
+ out.Follow = in.Follow |
|
| 3709 |
+ out.Previous = in.Previous |
|
| 3710 |
+ return nil |
|
| 3711 |
+} |
|
| 3712 |
+ |
|
| 3713 |
+func convert_v1beta3_PodProxyOptions_To_api_PodProxyOptions(in *PodProxyOptions, out *api.PodProxyOptions, s conversion.Scope) error {
|
|
| 3714 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3715 |
+ defaulting.(func(*PodProxyOptions))(in) |
|
| 3716 |
+ } |
|
| 3717 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3718 |
+ return err |
|
| 3719 |
+ } |
|
| 3720 |
+ out.Path = in.Path |
|
| 3721 |
+ return nil |
|
| 3722 |
+} |
|
| 3723 |
+ |
|
| 3724 |
+func convert_v1beta3_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus, s conversion.Scope) error {
|
|
| 3725 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3726 |
+ defaulting.(func(*PodStatus))(in) |
|
| 3727 |
+ } |
|
| 3728 |
+ out.Phase = api.PodPhase(in.Phase) |
|
| 3729 |
+ if in.Conditions != nil {
|
|
| 3730 |
+ out.Conditions = make([]api.PodCondition, len(in.Conditions)) |
|
| 3731 |
+ for i := range in.Conditions {
|
|
| 3732 |
+ if err := convert_v1beta3_PodCondition_To_api_PodCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
|
| 3733 |
+ return err |
|
| 3734 |
+ } |
|
| 3735 |
+ } |
|
| 3736 |
+ } else {
|
|
| 3737 |
+ out.Conditions = nil |
|
| 3738 |
+ } |
|
| 3739 |
+ out.Message = in.Message |
|
| 3740 |
+ out.Reason = in.Reason |
|
| 3741 |
+ out.HostIP = in.HostIP |
|
| 3742 |
+ out.PodIP = in.PodIP |
|
| 3743 |
+ if in.StartTime != nil {
|
|
| 3744 |
+ if err := s.Convert(&in.StartTime, &out.StartTime, 0); err != nil {
|
|
| 3745 |
+ return err |
|
| 3746 |
+ } |
|
| 3747 |
+ } else {
|
|
| 3748 |
+ out.StartTime = nil |
|
| 3749 |
+ } |
|
| 3750 |
+ if in.ContainerStatuses != nil {
|
|
| 3751 |
+ out.ContainerStatuses = make([]api.ContainerStatus, len(in.ContainerStatuses)) |
|
| 3752 |
+ for i := range in.ContainerStatuses {
|
|
| 3753 |
+ if err := convert_v1beta3_ContainerStatus_To_api_ContainerStatus(&in.ContainerStatuses[i], &out.ContainerStatuses[i], s); err != nil {
|
|
| 3754 |
+ return err |
|
| 3755 |
+ } |
|
| 3756 |
+ } |
|
| 3757 |
+ } else {
|
|
| 3758 |
+ out.ContainerStatuses = nil |
|
| 3759 |
+ } |
|
| 3760 |
+ return nil |
|
| 3761 |
+} |
|
| 3762 |
+ |
|
| 3763 |
+func convert_v1beta3_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult, out *api.PodStatusResult, s conversion.Scope) error {
|
|
| 3764 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3765 |
+ defaulting.(func(*PodStatusResult))(in) |
|
| 3766 |
+ } |
|
| 3767 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3768 |
+ return err |
|
| 3769 |
+ } |
|
| 3770 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3771 |
+ return err |
|
| 3772 |
+ } |
|
| 3773 |
+ if err := convert_v1beta3_PodStatus_To_api_PodStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3774 |
+ return err |
|
| 3775 |
+ } |
|
| 3776 |
+ return nil |
|
| 3777 |
+} |
|
| 3778 |
+ |
|
| 3779 |
+func convert_v1beta3_PodTemplate_To_api_PodTemplate(in *PodTemplate, out *api.PodTemplate, s conversion.Scope) error {
|
|
| 3780 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3781 |
+ defaulting.(func(*PodTemplate))(in) |
|
| 3782 |
+ } |
|
| 3783 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3784 |
+ return err |
|
| 3785 |
+ } |
|
| 3786 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3787 |
+ return err |
|
| 3788 |
+ } |
|
| 3789 |
+ if err := convert_v1beta3_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
|
|
| 3790 |
+ return err |
|
| 3791 |
+ } |
|
| 3792 |
+ return nil |
|
| 3793 |
+} |
|
| 3794 |
+ |
|
| 3795 |
+func convert_v1beta3_PodTemplateList_To_api_PodTemplateList(in *PodTemplateList, out *api.PodTemplateList, s conversion.Scope) error {
|
|
| 3796 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3797 |
+ defaulting.(func(*PodTemplateList))(in) |
|
| 3798 |
+ } |
|
| 3799 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3800 |
+ return err |
|
| 3801 |
+ } |
|
| 3802 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3803 |
+ return err |
|
| 3804 |
+ } |
|
| 3805 |
+ if in.Items != nil {
|
|
| 3806 |
+ out.Items = make([]api.PodTemplate, len(in.Items)) |
|
| 3807 |
+ for i := range in.Items {
|
|
| 3808 |
+ if err := convert_v1beta3_PodTemplate_To_api_PodTemplate(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3809 |
+ return err |
|
| 3810 |
+ } |
|
| 3811 |
+ } |
|
| 3812 |
+ } else {
|
|
| 3813 |
+ out.Items = nil |
|
| 3814 |
+ } |
|
| 3815 |
+ return nil |
|
| 3816 |
+} |
|
| 3817 |
+ |
|
| 3818 |
+func convert_v1beta3_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out *api.PodTemplateSpec, s conversion.Scope) error {
|
|
| 3819 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3820 |
+ defaulting.(func(*PodTemplateSpec))(in) |
|
| 3821 |
+ } |
|
| 3822 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3823 |
+ return err |
|
| 3824 |
+ } |
|
| 3825 |
+ if err := convert_v1beta3_PodSpec_To_api_PodSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3826 |
+ return err |
|
| 3827 |
+ } |
|
| 3828 |
+ return nil |
|
| 3829 |
+} |
|
| 3830 |
+ |
|
| 3831 |
+func convert_v1beta3_Probe_To_api_Probe(in *Probe, out *api.Probe, s conversion.Scope) error {
|
|
| 3832 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3833 |
+ defaulting.(func(*Probe))(in) |
|
| 3834 |
+ } |
|
| 3835 |
+ if err := convert_v1beta3_Handler_To_api_Handler(&in.Handler, &out.Handler, s); err != nil {
|
|
| 3836 |
+ return err |
|
| 3837 |
+ } |
|
| 3838 |
+ out.InitialDelaySeconds = in.InitialDelaySeconds |
|
| 3839 |
+ out.TimeoutSeconds = in.TimeoutSeconds |
|
| 3840 |
+ return nil |
|
| 3841 |
+} |
|
| 3842 |
+ |
|
| 3843 |
+func convert_v1beta3_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out *api.RBDVolumeSource, s conversion.Scope) error {
|
|
| 3844 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3845 |
+ defaulting.(func(*RBDVolumeSource))(in) |
|
| 3846 |
+ } |
|
| 3847 |
+ if in.CephMonitors != nil {
|
|
| 3848 |
+ out.CephMonitors = make([]string, len(in.CephMonitors)) |
|
| 3849 |
+ for i := range in.CephMonitors {
|
|
| 3850 |
+ out.CephMonitors[i] = in.CephMonitors[i] |
|
| 3851 |
+ } |
|
| 3852 |
+ } else {
|
|
| 3853 |
+ out.CephMonitors = nil |
|
| 3854 |
+ } |
|
| 3855 |
+ out.RBDImage = in.RBDImage |
|
| 3856 |
+ out.FSType = in.FSType |
|
| 3857 |
+ out.RBDPool = in.RBDPool |
|
| 3858 |
+ out.RadosUser = in.RadosUser |
|
| 3859 |
+ out.Keyring = in.Keyring |
|
| 3860 |
+ if in.SecretRef != nil {
|
|
| 3861 |
+ out.SecretRef = new(api.LocalObjectReference) |
|
| 3862 |
+ if err := convert_v1beta3_LocalObjectReference_To_api_LocalObjectReference(in.SecretRef, out.SecretRef, s); err != nil {
|
|
| 3863 |
+ return err |
|
| 3864 |
+ } |
|
| 3865 |
+ } else {
|
|
| 3866 |
+ out.SecretRef = nil |
|
| 3867 |
+ } |
|
| 3868 |
+ out.ReadOnly = in.ReadOnly |
|
| 3869 |
+ return nil |
|
| 3870 |
+} |
|
| 3871 |
+ |
|
| 3872 |
+func convert_v1beta3_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out *api.RangeAllocation, s conversion.Scope) error {
|
|
| 3873 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3874 |
+ defaulting.(func(*RangeAllocation))(in) |
|
| 3875 |
+ } |
|
| 3876 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3877 |
+ return err |
|
| 3878 |
+ } |
|
| 3879 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3880 |
+ return err |
|
| 3881 |
+ } |
|
| 3882 |
+ out.Range = in.Range |
|
| 3883 |
+ if err := s.Convert(&in.Data, &out.Data, 0); err != nil {
|
|
| 3884 |
+ return err |
|
| 3885 |
+ } |
|
| 3886 |
+ return nil |
|
| 3887 |
+} |
|
| 3888 |
+ |
|
| 3889 |
+func convert_v1beta3_ReplicationController_To_api_ReplicationController(in *ReplicationController, out *api.ReplicationController, s conversion.Scope) error {
|
|
| 3890 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3891 |
+ defaulting.(func(*ReplicationController))(in) |
|
| 3892 |
+ } |
|
| 3893 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3894 |
+ return err |
|
| 3895 |
+ } |
|
| 3896 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3897 |
+ return err |
|
| 3898 |
+ } |
|
| 3899 |
+ if err := convert_v1beta3_ReplicationControllerSpec_To_api_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3900 |
+ return err |
|
| 3901 |
+ } |
|
| 3902 |
+ if err := convert_v1beta3_ReplicationControllerStatus_To_api_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3903 |
+ return err |
|
| 3904 |
+ } |
|
| 3905 |
+ return nil |
|
| 3906 |
+} |
|
| 3907 |
+ |
|
| 3908 |
+func convert_v1beta3_ReplicationControllerList_To_api_ReplicationControllerList(in *ReplicationControllerList, out *api.ReplicationControllerList, s conversion.Scope) error {
|
|
| 3909 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3910 |
+ defaulting.(func(*ReplicationControllerList))(in) |
|
| 3911 |
+ } |
|
| 3912 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3913 |
+ return err |
|
| 3914 |
+ } |
|
| 3915 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3916 |
+ return err |
|
| 3917 |
+ } |
|
| 3918 |
+ if in.Items != nil {
|
|
| 3919 |
+ out.Items = make([]api.ReplicationController, len(in.Items)) |
|
| 3920 |
+ for i := range in.Items {
|
|
| 3921 |
+ if err := convert_v1beta3_ReplicationController_To_api_ReplicationController(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3922 |
+ return err |
|
| 3923 |
+ } |
|
| 3924 |
+ } |
|
| 3925 |
+ } else {
|
|
| 3926 |
+ out.Items = nil |
|
| 3927 |
+ } |
|
| 3928 |
+ return nil |
|
| 3929 |
+} |
|
| 3930 |
+ |
|
| 3931 |
+func convert_v1beta3_ReplicationControllerStatus_To_api_ReplicationControllerStatus(in *ReplicationControllerStatus, out *api.ReplicationControllerStatus, s conversion.Scope) error {
|
|
| 3932 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3933 |
+ defaulting.(func(*ReplicationControllerStatus))(in) |
|
| 3934 |
+ } |
|
| 3935 |
+ out.Replicas = in.Replicas |
|
| 3936 |
+ out.ObservedGeneration = in.ObservedGeneration |
|
| 3937 |
+ return nil |
|
| 3938 |
+} |
|
| 3939 |
+ |
|
| 3940 |
+func convert_v1beta3_ResourceQuota_To_api_ResourceQuota(in *ResourceQuota, out *api.ResourceQuota, s conversion.Scope) error {
|
|
| 3941 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3942 |
+ defaulting.(func(*ResourceQuota))(in) |
|
| 3943 |
+ } |
|
| 3944 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3945 |
+ return err |
|
| 3946 |
+ } |
|
| 3947 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 3948 |
+ return err |
|
| 3949 |
+ } |
|
| 3950 |
+ if err := convert_v1beta3_ResourceQuotaSpec_To_api_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 3951 |
+ return err |
|
| 3952 |
+ } |
|
| 3953 |
+ if err := convert_v1beta3_ResourceQuotaStatus_To_api_ResourceQuotaStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 3954 |
+ return err |
|
| 3955 |
+ } |
|
| 3956 |
+ return nil |
|
| 3957 |
+} |
|
| 3958 |
+ |
|
| 3959 |
+func convert_v1beta3_ResourceQuotaList_To_api_ResourceQuotaList(in *ResourceQuotaList, out *api.ResourceQuotaList, s conversion.Scope) error {
|
|
| 3960 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3961 |
+ defaulting.(func(*ResourceQuotaList))(in) |
|
| 3962 |
+ } |
|
| 3963 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 3964 |
+ return err |
|
| 3965 |
+ } |
|
| 3966 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 3967 |
+ return err |
|
| 3968 |
+ } |
|
| 3969 |
+ if in.Items != nil {
|
|
| 3970 |
+ out.Items = make([]api.ResourceQuota, len(in.Items)) |
|
| 3971 |
+ for i := range in.Items {
|
|
| 3972 |
+ if err := convert_v1beta3_ResourceQuota_To_api_ResourceQuota(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 3973 |
+ return err |
|
| 3974 |
+ } |
|
| 3975 |
+ } |
|
| 3976 |
+ } else {
|
|
| 3977 |
+ out.Items = nil |
|
| 3978 |
+ } |
|
| 3979 |
+ return nil |
|
| 3980 |
+} |
|
| 3981 |
+ |
|
| 3982 |
+func convert_v1beta3_ResourceQuotaSpec_To_api_ResourceQuotaSpec(in *ResourceQuotaSpec, out *api.ResourceQuotaSpec, s conversion.Scope) error {
|
|
| 3983 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 3984 |
+ defaulting.(func(*ResourceQuotaSpec))(in) |
|
| 3985 |
+ } |
|
| 3986 |
+ if in.Hard != nil {
|
|
| 3987 |
+ out.Hard = make(api.ResourceList) |
|
| 3988 |
+ for key, val := range in.Hard {
|
|
| 3989 |
+ newVal := resource.Quantity{}
|
|
| 3990 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 3991 |
+ return err |
|
| 3992 |
+ } |
|
| 3993 |
+ out.Hard[api.ResourceName(key)] = newVal |
|
| 3994 |
+ } |
|
| 3995 |
+ } else {
|
|
| 3996 |
+ out.Hard = nil |
|
| 3997 |
+ } |
|
| 3998 |
+ return nil |
|
| 3999 |
+} |
|
| 4000 |
+ |
|
| 4001 |
+func convert_v1beta3_ResourceQuotaStatus_To_api_ResourceQuotaStatus(in *ResourceQuotaStatus, out *api.ResourceQuotaStatus, s conversion.Scope) error {
|
|
| 4002 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4003 |
+ defaulting.(func(*ResourceQuotaStatus))(in) |
|
| 4004 |
+ } |
|
| 4005 |
+ if in.Hard != nil {
|
|
| 4006 |
+ out.Hard = make(api.ResourceList) |
|
| 4007 |
+ for key, val := range in.Hard {
|
|
| 4008 |
+ newVal := resource.Quantity{}
|
|
| 4009 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 4010 |
+ return err |
|
| 4011 |
+ } |
|
| 4012 |
+ out.Hard[api.ResourceName(key)] = newVal |
|
| 4013 |
+ } |
|
| 4014 |
+ } else {
|
|
| 4015 |
+ out.Hard = nil |
|
| 4016 |
+ } |
|
| 4017 |
+ if in.Used != nil {
|
|
| 4018 |
+ out.Used = make(api.ResourceList) |
|
| 4019 |
+ for key, val := range in.Used {
|
|
| 4020 |
+ newVal := resource.Quantity{}
|
|
| 4021 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 4022 |
+ return err |
|
| 4023 |
+ } |
|
| 4024 |
+ out.Used[api.ResourceName(key)] = newVal |
|
| 4025 |
+ } |
|
| 4026 |
+ } else {
|
|
| 4027 |
+ out.Used = nil |
|
| 4028 |
+ } |
|
| 4029 |
+ return nil |
|
| 4030 |
+} |
|
| 4031 |
+ |
|
| 4032 |
+func convert_v1beta3_ResourceRequirements_To_api_ResourceRequirements(in *ResourceRequirements, out *api.ResourceRequirements, s conversion.Scope) error {
|
|
| 4033 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4034 |
+ defaulting.(func(*ResourceRequirements))(in) |
|
| 4035 |
+ } |
|
| 4036 |
+ if in.Limits != nil {
|
|
| 4037 |
+ out.Limits = make(api.ResourceList) |
|
| 4038 |
+ for key, val := range in.Limits {
|
|
| 4039 |
+ newVal := resource.Quantity{}
|
|
| 4040 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 4041 |
+ return err |
|
| 4042 |
+ } |
|
| 4043 |
+ out.Limits[api.ResourceName(key)] = newVal |
|
| 4044 |
+ } |
|
| 4045 |
+ } else {
|
|
| 4046 |
+ out.Limits = nil |
|
| 4047 |
+ } |
|
| 4048 |
+ if in.Requests != nil {
|
|
| 4049 |
+ out.Requests = make(api.ResourceList) |
|
| 4050 |
+ for key, val := range in.Requests {
|
|
| 4051 |
+ newVal := resource.Quantity{}
|
|
| 4052 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 4053 |
+ return err |
|
| 4054 |
+ } |
|
| 4055 |
+ out.Requests[api.ResourceName(key)] = newVal |
|
| 4056 |
+ } |
|
| 4057 |
+ } else {
|
|
| 4058 |
+ out.Requests = nil |
|
| 4059 |
+ } |
|
| 4060 |
+ return nil |
|
| 4061 |
+} |
|
| 4062 |
+ |
|
| 4063 |
+func convert_v1beta3_RunAsUserStrategyOptions_To_api_RunAsUserStrategyOptions(in *RunAsUserStrategyOptions, out *api.RunAsUserStrategyOptions, s conversion.Scope) error {
|
|
| 4064 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4065 |
+ defaulting.(func(*RunAsUserStrategyOptions))(in) |
|
| 4066 |
+ } |
|
| 4067 |
+ out.Type = api.RunAsUserStrategyType(in.Type) |
|
| 4068 |
+ if in.UID != nil {
|
|
| 4069 |
+ out.UID = new(int64) |
|
| 4070 |
+ *out.UID = *in.UID |
|
| 4071 |
+ } else {
|
|
| 4072 |
+ out.UID = nil |
|
| 4073 |
+ } |
|
| 4074 |
+ if in.UIDRangeMin != nil {
|
|
| 4075 |
+ out.UIDRangeMin = new(int64) |
|
| 4076 |
+ *out.UIDRangeMin = *in.UIDRangeMin |
|
| 4077 |
+ } else {
|
|
| 4078 |
+ out.UIDRangeMin = nil |
|
| 4079 |
+ } |
|
| 4080 |
+ if in.UIDRangeMax != nil {
|
|
| 4081 |
+ out.UIDRangeMax = new(int64) |
|
| 4082 |
+ *out.UIDRangeMax = *in.UIDRangeMax |
|
| 4083 |
+ } else {
|
|
| 4084 |
+ out.UIDRangeMax = nil |
|
| 4085 |
+ } |
|
| 4086 |
+ return nil |
|
| 4087 |
+} |
|
| 4088 |
+ |
|
| 4089 |
+func convert_v1beta3_SELinuxContextStrategyOptions_To_api_SELinuxContextStrategyOptions(in *SELinuxContextStrategyOptions, out *api.SELinuxContextStrategyOptions, s conversion.Scope) error {
|
|
| 4090 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4091 |
+ defaulting.(func(*SELinuxContextStrategyOptions))(in) |
|
| 4092 |
+ } |
|
| 4093 |
+ out.Type = api.SELinuxContextStrategyType(in.Type) |
|
| 4094 |
+ if in.SELinuxOptions != nil {
|
|
| 4095 |
+ out.SELinuxOptions = new(api.SELinuxOptions) |
|
| 4096 |
+ if err := convert_v1beta3_SELinuxOptions_To_api_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil {
|
|
| 4097 |
+ return err |
|
| 4098 |
+ } |
|
| 4099 |
+ } else {
|
|
| 4100 |
+ out.SELinuxOptions = nil |
|
| 4101 |
+ } |
|
| 4102 |
+ return nil |
|
| 4103 |
+} |
|
| 4104 |
+ |
|
| 4105 |
+func convert_v1beta3_SELinuxOptions_To_api_SELinuxOptions(in *SELinuxOptions, out *api.SELinuxOptions, s conversion.Scope) error {
|
|
| 4106 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4107 |
+ defaulting.(func(*SELinuxOptions))(in) |
|
| 4108 |
+ } |
|
| 4109 |
+ out.User = in.User |
|
| 4110 |
+ out.Role = in.Role |
|
| 4111 |
+ out.Type = in.Type |
|
| 4112 |
+ out.Level = in.Level |
|
| 4113 |
+ return nil |
|
| 4114 |
+} |
|
| 4115 |
+ |
|
| 4116 |
+func convert_v1beta3_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversion.Scope) error {
|
|
| 4117 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4118 |
+ defaulting.(func(*Secret))(in) |
|
| 4119 |
+ } |
|
| 4120 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4121 |
+ return err |
|
| 4122 |
+ } |
|
| 4123 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 4124 |
+ return err |
|
| 4125 |
+ } |
|
| 4126 |
+ if in.Data != nil {
|
|
| 4127 |
+ out.Data = make(map[string][]uint8) |
|
| 4128 |
+ for key, val := range in.Data {
|
|
| 4129 |
+ newVal := []uint8{}
|
|
| 4130 |
+ if err := s.Convert(&val, &newVal, 0); err != nil {
|
|
| 4131 |
+ return err |
|
| 4132 |
+ } |
|
| 4133 |
+ out.Data[key] = newVal |
|
| 4134 |
+ } |
|
| 4135 |
+ } else {
|
|
| 4136 |
+ out.Data = nil |
|
| 4137 |
+ } |
|
| 4138 |
+ out.Type = api.SecretType(in.Type) |
|
| 4139 |
+ return nil |
|
| 4140 |
+} |
|
| 4141 |
+ |
|
| 4142 |
+func convert_v1beta3_SecretList_To_api_SecretList(in *SecretList, out *api.SecretList, s conversion.Scope) error {
|
|
| 4143 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4144 |
+ defaulting.(func(*SecretList))(in) |
|
| 4145 |
+ } |
|
| 4146 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4147 |
+ return err |
|
| 4148 |
+ } |
|
| 4149 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 4150 |
+ return err |
|
| 4151 |
+ } |
|
| 4152 |
+ if in.Items != nil {
|
|
| 4153 |
+ out.Items = make([]api.Secret, len(in.Items)) |
|
| 4154 |
+ for i := range in.Items {
|
|
| 4155 |
+ if err := convert_v1beta3_Secret_To_api_Secret(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 4156 |
+ return err |
|
| 4157 |
+ } |
|
| 4158 |
+ } |
|
| 4159 |
+ } else {
|
|
| 4160 |
+ out.Items = nil |
|
| 4161 |
+ } |
|
| 4162 |
+ return nil |
|
| 4163 |
+} |
|
| 4164 |
+ |
|
| 4165 |
+func convert_v1beta3_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSource, out *api.SecretVolumeSource, s conversion.Scope) error {
|
|
| 4166 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4167 |
+ defaulting.(func(*SecretVolumeSource))(in) |
|
| 4168 |
+ } |
|
| 4169 |
+ out.SecretName = in.SecretName |
|
| 4170 |
+ return nil |
|
| 4171 |
+} |
|
| 4172 |
+ |
|
| 4173 |
+func convert_v1beta3_SecurityContext_To_api_SecurityContext(in *SecurityContext, out *api.SecurityContext, s conversion.Scope) error {
|
|
| 4174 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4175 |
+ defaulting.(func(*SecurityContext))(in) |
|
| 4176 |
+ } |
|
| 4177 |
+ if in.Capabilities != nil {
|
|
| 4178 |
+ out.Capabilities = new(api.Capabilities) |
|
| 4179 |
+ if err := convert_v1beta3_Capabilities_To_api_Capabilities(in.Capabilities, out.Capabilities, s); err != nil {
|
|
| 4180 |
+ return err |
|
| 4181 |
+ } |
|
| 4182 |
+ } else {
|
|
| 4183 |
+ out.Capabilities = nil |
|
| 4184 |
+ } |
|
| 4185 |
+ if in.Privileged != nil {
|
|
| 4186 |
+ out.Privileged = new(bool) |
|
| 4187 |
+ *out.Privileged = *in.Privileged |
|
| 4188 |
+ } else {
|
|
| 4189 |
+ out.Privileged = nil |
|
| 4190 |
+ } |
|
| 4191 |
+ if in.SELinuxOptions != nil {
|
|
| 4192 |
+ out.SELinuxOptions = new(api.SELinuxOptions) |
|
| 4193 |
+ if err := convert_v1beta3_SELinuxOptions_To_api_SELinuxOptions(in.SELinuxOptions, out.SELinuxOptions, s); err != nil {
|
|
| 4194 |
+ return err |
|
| 4195 |
+ } |
|
| 4196 |
+ } else {
|
|
| 4197 |
+ out.SELinuxOptions = nil |
|
| 4198 |
+ } |
|
| 4199 |
+ if in.RunAsUser != nil {
|
|
| 4200 |
+ out.RunAsUser = new(int64) |
|
| 4201 |
+ *out.RunAsUser = *in.RunAsUser |
|
| 4202 |
+ } else {
|
|
| 4203 |
+ out.RunAsUser = nil |
|
| 4204 |
+ } |
|
| 4205 |
+ out.RunAsNonRoot = in.RunAsNonRoot |
|
| 4206 |
+ return nil |
|
| 4207 |
+} |
|
| 4208 |
+ |
|
| 4209 |
+func convert_v1beta3_SecurityContextConstraints_To_api_SecurityContextConstraints(in *SecurityContextConstraints, out *api.SecurityContextConstraints, s conversion.Scope) error {
|
|
| 4210 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4211 |
+ defaulting.(func(*SecurityContextConstraints))(in) |
|
| 4212 |
+ } |
|
| 4213 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4214 |
+ return err |
|
| 4215 |
+ } |
|
| 4216 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 4217 |
+ return err |
|
| 4218 |
+ } |
|
| 4219 |
+ out.AllowPrivilegedContainer = in.AllowPrivilegedContainer |
|
| 4220 |
+ if in.AllowedCapabilities != nil {
|
|
| 4221 |
+ out.AllowedCapabilities = make([]api.Capability, len(in.AllowedCapabilities)) |
|
| 4222 |
+ for i := range in.AllowedCapabilities {
|
|
| 4223 |
+ out.AllowedCapabilities[i] = api.Capability(in.AllowedCapabilities[i]) |
|
| 4224 |
+ } |
|
| 4225 |
+ } else {
|
|
| 4226 |
+ out.AllowedCapabilities = nil |
|
| 4227 |
+ } |
|
| 4228 |
+ out.AllowHostDirVolumePlugin = in.AllowHostDirVolumePlugin |
|
| 4229 |
+ out.AllowHostNetwork = in.AllowHostNetwork |
|
| 4230 |
+ out.AllowHostPorts = in.AllowHostPorts |
|
| 4231 |
+ if err := convert_v1beta3_SELinuxContextStrategyOptions_To_api_SELinuxContextStrategyOptions(&in.SELinuxContext, &out.SELinuxContext, s); err != nil {
|
|
| 4232 |
+ return err |
|
| 4233 |
+ } |
|
| 4234 |
+ if err := convert_v1beta3_RunAsUserStrategyOptions_To_api_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, s); err != nil {
|
|
| 4235 |
+ return err |
|
| 4236 |
+ } |
|
| 4237 |
+ if in.Users != nil {
|
|
| 4238 |
+ out.Users = make([]string, len(in.Users)) |
|
| 4239 |
+ for i := range in.Users {
|
|
| 4240 |
+ out.Users[i] = in.Users[i] |
|
| 4241 |
+ } |
|
| 4242 |
+ } else {
|
|
| 4243 |
+ out.Users = nil |
|
| 4244 |
+ } |
|
| 4245 |
+ if in.Groups != nil {
|
|
| 4246 |
+ out.Groups = make([]string, len(in.Groups)) |
|
| 4247 |
+ for i := range in.Groups {
|
|
| 4248 |
+ out.Groups[i] = in.Groups[i] |
|
| 4249 |
+ } |
|
| 4250 |
+ } else {
|
|
| 4251 |
+ out.Groups = nil |
|
| 4252 |
+ } |
|
| 4253 |
+ return nil |
|
| 4254 |
+} |
|
| 4255 |
+ |
|
| 4256 |
+func convert_v1beta3_SecurityContextConstraintsList_To_api_SecurityContextConstraintsList(in *SecurityContextConstraintsList, out *api.SecurityContextConstraintsList, s conversion.Scope) error {
|
|
| 4257 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4258 |
+ defaulting.(func(*SecurityContextConstraintsList))(in) |
|
| 4259 |
+ } |
|
| 4260 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4261 |
+ return err |
|
| 4262 |
+ } |
|
| 4263 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 4264 |
+ return err |
|
| 4265 |
+ } |
|
| 4266 |
+ if in.Items != nil {
|
|
| 4267 |
+ out.Items = make([]api.SecurityContextConstraints, len(in.Items)) |
|
| 4268 |
+ for i := range in.Items {
|
|
| 4269 |
+ if err := convert_v1beta3_SecurityContextConstraints_To_api_SecurityContextConstraints(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 4270 |
+ return err |
|
| 4271 |
+ } |
|
| 4272 |
+ } |
|
| 4273 |
+ } else {
|
|
| 4274 |
+ out.Items = nil |
|
| 4275 |
+ } |
|
| 4276 |
+ return nil |
|
| 4277 |
+} |
|
| 4278 |
+ |
|
| 4279 |
+func convert_v1beta3_SerializedReference_To_api_SerializedReference(in *SerializedReference, out *api.SerializedReference, s conversion.Scope) error {
|
|
| 4280 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4281 |
+ defaulting.(func(*SerializedReference))(in) |
|
| 4282 |
+ } |
|
| 4283 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4284 |
+ return err |
|
| 4285 |
+ } |
|
| 4286 |
+ if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(&in.Reference, &out.Reference, s); err != nil {
|
|
| 4287 |
+ return err |
|
| 4288 |
+ } |
|
| 4289 |
+ return nil |
|
| 4290 |
+} |
|
| 4291 |
+ |
|
| 4292 |
+func convert_v1beta3_Service_To_api_Service(in *Service, out *api.Service, s conversion.Scope) error {
|
|
| 4293 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4294 |
+ defaulting.(func(*Service))(in) |
|
| 4295 |
+ } |
|
| 4296 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4297 |
+ return err |
|
| 4298 |
+ } |
|
| 4299 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 4300 |
+ return err |
|
| 4301 |
+ } |
|
| 4302 |
+ if err := convert_v1beta3_ServiceSpec_To_api_ServiceSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
| 4303 |
+ return err |
|
| 4304 |
+ } |
|
| 4305 |
+ if err := convert_v1beta3_ServiceStatus_To_api_ServiceStatus(&in.Status, &out.Status, s); err != nil {
|
|
| 4306 |
+ return err |
|
| 4307 |
+ } |
|
| 4308 |
+ return nil |
|
| 4309 |
+} |
|
| 4310 |
+ |
|
| 4311 |
+func convert_v1beta3_ServiceAccount_To_api_ServiceAccount(in *ServiceAccount, out *api.ServiceAccount, s conversion.Scope) error {
|
|
| 4312 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4313 |
+ defaulting.(func(*ServiceAccount))(in) |
|
| 4314 |
+ } |
|
| 4315 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4316 |
+ return err |
|
| 4317 |
+ } |
|
| 4318 |
+ if err := convert_v1beta3_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
|
| 4319 |
+ return err |
|
| 4320 |
+ } |
|
| 4321 |
+ if in.Secrets != nil {
|
|
| 4322 |
+ out.Secrets = make([]api.ObjectReference, len(in.Secrets)) |
|
| 4323 |
+ for i := range in.Secrets {
|
|
| 4324 |
+ if err := convert_v1beta3_ObjectReference_To_api_ObjectReference(&in.Secrets[i], &out.Secrets[i], s); err != nil {
|
|
| 4325 |
+ return err |
|
| 4326 |
+ } |
|
| 4327 |
+ } |
|
| 4328 |
+ } else {
|
|
| 4329 |
+ out.Secrets = nil |
|
| 4330 |
+ } |
|
| 4331 |
+ if in.ImagePullSecrets != nil {
|
|
| 4332 |
+ out.ImagePullSecrets = make([]api.LocalObjectReference, len(in.ImagePullSecrets)) |
|
| 4333 |
+ for i := range in.ImagePullSecrets {
|
|
| 4334 |
+ if err := convert_v1beta3_LocalObjectReference_To_api_LocalObjectReference(&in.ImagePullSecrets[i], &out.ImagePullSecrets[i], s); err != nil {
|
|
| 4335 |
+ return err |
|
| 4336 |
+ } |
|
| 4337 |
+ } |
|
| 4338 |
+ } else {
|
|
| 4339 |
+ out.ImagePullSecrets = nil |
|
| 4340 |
+ } |
|
| 4341 |
+ return nil |
|
| 4342 |
+} |
|
| 4343 |
+ |
|
| 4344 |
+func convert_v1beta3_ServiceAccountList_To_api_ServiceAccountList(in *ServiceAccountList, out *api.ServiceAccountList, s conversion.Scope) error {
|
|
| 4345 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4346 |
+ defaulting.(func(*ServiceAccountList))(in) |
|
| 4347 |
+ } |
|
| 4348 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4349 |
+ return err |
|
| 4350 |
+ } |
|
| 4351 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 4352 |
+ return err |
|
| 4353 |
+ } |
|
| 4354 |
+ if in.Items != nil {
|
|
| 4355 |
+ out.Items = make([]api.ServiceAccount, len(in.Items)) |
|
| 4356 |
+ for i := range in.Items {
|
|
| 4357 |
+ if err := convert_v1beta3_ServiceAccount_To_api_ServiceAccount(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 4358 |
+ return err |
|
| 4359 |
+ } |
|
| 4360 |
+ } |
|
| 4361 |
+ } else {
|
|
| 4362 |
+ out.Items = nil |
|
| 4363 |
+ } |
|
| 4364 |
+ return nil |
|
| 4365 |
+} |
|
| 4366 |
+ |
|
| 4367 |
+func convert_v1beta3_ServiceList_To_api_ServiceList(in *ServiceList, out *api.ServiceList, s conversion.Scope) error {
|
|
| 4368 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4369 |
+ defaulting.(func(*ServiceList))(in) |
|
| 4370 |
+ } |
|
| 4371 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4372 |
+ return err |
|
| 4373 |
+ } |
|
| 4374 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 4375 |
+ return err |
|
| 4376 |
+ } |
|
| 4377 |
+ if in.Items != nil {
|
|
| 4378 |
+ out.Items = make([]api.Service, len(in.Items)) |
|
| 4379 |
+ for i := range in.Items {
|
|
| 4380 |
+ if err := convert_v1beta3_Service_To_api_Service(&in.Items[i], &out.Items[i], s); err != nil {
|
|
| 4381 |
+ return err |
|
| 4382 |
+ } |
|
| 4383 |
+ } |
|
| 4384 |
+ } else {
|
|
| 4385 |
+ out.Items = nil |
|
| 4386 |
+ } |
|
| 4387 |
+ return nil |
|
| 4388 |
+} |
|
| 4389 |
+ |
|
| 4390 |
+func convert_v1beta3_ServicePort_To_api_ServicePort(in *ServicePort, out *api.ServicePort, s conversion.Scope) error {
|
|
| 4391 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4392 |
+ defaulting.(func(*ServicePort))(in) |
|
| 4393 |
+ } |
|
| 4394 |
+ out.Name = in.Name |
|
| 4395 |
+ out.Protocol = api.Protocol(in.Protocol) |
|
| 4396 |
+ out.Port = in.Port |
|
| 4397 |
+ if err := s.Convert(&in.TargetPort, &out.TargetPort, 0); err != nil {
|
|
| 4398 |
+ return err |
|
| 4399 |
+ } |
|
| 4400 |
+ out.NodePort = in.NodePort |
|
| 4401 |
+ return nil |
|
| 4402 |
+} |
|
| 4403 |
+ |
|
| 4404 |
+func convert_v1beta3_ServiceStatus_To_api_ServiceStatus(in *ServiceStatus, out *api.ServiceStatus, s conversion.Scope) error {
|
|
| 4405 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4406 |
+ defaulting.(func(*ServiceStatus))(in) |
|
| 4407 |
+ } |
|
| 4408 |
+ if err := convert_v1beta3_LoadBalancerStatus_To_api_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil {
|
|
| 4409 |
+ return err |
|
| 4410 |
+ } |
|
| 4411 |
+ return nil |
|
| 4412 |
+} |
|
| 4413 |
+ |
|
| 4414 |
+func convert_v1beta3_Status_To_api_Status(in *Status, out *api.Status, s conversion.Scope) error {
|
|
| 4415 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4416 |
+ defaulting.(func(*Status))(in) |
|
| 4417 |
+ } |
|
| 4418 |
+ if err := convert_v1beta3_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
| 4419 |
+ return err |
|
| 4420 |
+ } |
|
| 4421 |
+ if err := convert_v1beta3_ListMeta_To_api_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
| 4422 |
+ return err |
|
| 4423 |
+ } |
|
| 4424 |
+ out.Status = in.Status |
|
| 4425 |
+ out.Message = in.Message |
|
| 4426 |
+ out.Reason = api.StatusReason(in.Reason) |
|
| 4427 |
+ if in.Details != nil {
|
|
| 4428 |
+ out.Details = new(api.StatusDetails) |
|
| 4429 |
+ if err := convert_v1beta3_StatusDetails_To_api_StatusDetails(in.Details, out.Details, s); err != nil {
|
|
| 4430 |
+ return err |
|
| 4431 |
+ } |
|
| 4432 |
+ } else {
|
|
| 4433 |
+ out.Details = nil |
|
| 4434 |
+ } |
|
| 4435 |
+ out.Code = in.Code |
|
| 4436 |
+ return nil |
|
| 4437 |
+} |
|
| 4438 |
+ |
|
| 4439 |
+func convert_v1beta3_TCPSocketAction_To_api_TCPSocketAction(in *TCPSocketAction, out *api.TCPSocketAction, s conversion.Scope) error {
|
|
| 4440 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4441 |
+ defaulting.(func(*TCPSocketAction))(in) |
|
| 4442 |
+ } |
|
| 4443 |
+ if err := s.Convert(&in.Port, &out.Port, 0); err != nil {
|
|
| 4444 |
+ return err |
|
| 4445 |
+ } |
|
| 4446 |
+ return nil |
|
| 4447 |
+} |
|
| 4448 |
+ |
|
| 4449 |
+func convert_v1beta3_TypeMeta_To_api_TypeMeta(in *TypeMeta, out *api.TypeMeta, s conversion.Scope) error {
|
|
| 4450 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4451 |
+ defaulting.(func(*TypeMeta))(in) |
|
| 4452 |
+ } |
|
| 4453 |
+ out.Kind = in.Kind |
|
| 4454 |
+ out.APIVersion = in.APIVersion |
|
| 4455 |
+ return nil |
|
| 4456 |
+} |
|
| 4457 |
+ |
|
| 4458 |
+func convert_v1beta3_Volume_To_api_Volume(in *Volume, out *api.Volume, s conversion.Scope) error {
|
|
| 4459 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4460 |
+ defaulting.(func(*Volume))(in) |
|
| 4461 |
+ } |
|
| 4462 |
+ out.Name = in.Name |
|
| 4463 |
+ if err := convert_v1beta3_VolumeSource_To_api_VolumeSource(&in.VolumeSource, &out.VolumeSource, s); err != nil {
|
|
| 4464 |
+ return err |
|
| 4465 |
+ } |
|
| 4466 |
+ return nil |
|
| 4467 |
+} |
|
| 4468 |
+ |
|
| 4469 |
+func convert_v1beta3_VolumeMount_To_api_VolumeMount(in *VolumeMount, out *api.VolumeMount, s conversion.Scope) error {
|
|
| 4470 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4471 |
+ defaulting.(func(*VolumeMount))(in) |
|
| 4472 |
+ } |
|
| 4473 |
+ out.Name = in.Name |
|
| 4474 |
+ out.ReadOnly = in.ReadOnly |
|
| 4475 |
+ out.MountPath = in.MountPath |
|
| 4476 |
+ return nil |
|
| 4477 |
+} |
|
| 4478 |
+ |
|
| 4479 |
+func convert_v1beta3_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.VolumeSource, s conversion.Scope) error {
|
|
| 4480 |
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
|
| 4481 |
+ defaulting.(func(*VolumeSource))(in) |
|
| 4482 |
+ } |
|
| 4483 |
+ if in.HostPath != nil {
|
|
| 4484 |
+ out.HostPath = new(api.HostPathVolumeSource) |
|
| 4485 |
+ if err := convert_v1beta3_HostPathVolumeSource_To_api_HostPathVolumeSource(in.HostPath, out.HostPath, s); err != nil {
|
|
| 4486 |
+ return err |
|
| 4487 |
+ } |
|
| 4488 |
+ } else {
|
|
| 4489 |
+ out.HostPath = nil |
|
| 4490 |
+ } |
|
| 4491 |
+ if in.EmptyDir != nil {
|
|
| 4492 |
+ out.EmptyDir = new(api.EmptyDirVolumeSource) |
|
| 4493 |
+ if err := convert_v1beta3_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(in.EmptyDir, out.EmptyDir, s); err != nil {
|
|
| 4494 |
+ return err |
|
| 4495 |
+ } |
|
| 4496 |
+ } else {
|
|
| 4497 |
+ out.EmptyDir = nil |
|
| 4498 |
+ } |
|
| 4499 |
+ if in.GCEPersistentDisk != nil {
|
|
| 4500 |
+ out.GCEPersistentDisk = new(api.GCEPersistentDiskVolumeSource) |
|
| 4501 |
+ if err := convert_v1beta3_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(in.GCEPersistentDisk, out.GCEPersistentDisk, s); err != nil {
|
|
| 4502 |
+ return err |
|
| 4503 |
+ } |
|
| 4504 |
+ } else {
|
|
| 4505 |
+ out.GCEPersistentDisk = nil |
|
| 4506 |
+ } |
|
| 4507 |
+ if in.AWSElasticBlockStore != nil {
|
|
| 4508 |
+ out.AWSElasticBlockStore = new(api.AWSElasticBlockStoreVolumeSource) |
|
| 4509 |
+ if err := convert_v1beta3_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in.AWSElasticBlockStore, out.AWSElasticBlockStore, s); err != nil {
|
|
| 4510 |
+ return err |
|
| 4511 |
+ } |
|
| 4512 |
+ } else {
|
|
| 4513 |
+ out.AWSElasticBlockStore = nil |
|
| 4514 |
+ } |
|
| 4515 |
+ if in.GitRepo != nil {
|
|
| 4516 |
+ out.GitRepo = new(api.GitRepoVolumeSource) |
|
| 4517 |
+ if err := convert_v1beta3_GitRepoVolumeSource_To_api_GitRepoVolumeSource(in.GitRepo, out.GitRepo, s); err != nil {
|
|
| 4518 |
+ return err |
|
| 4519 |
+ } |
|
| 4520 |
+ } else {
|
|
| 4521 |
+ out.GitRepo = nil |
|
| 4522 |
+ } |
|
| 4523 |
+ if in.Secret != nil {
|
|
| 4524 |
+ out.Secret = new(api.SecretVolumeSource) |
|
| 4525 |
+ if err := convert_v1beta3_SecretVolumeSource_To_api_SecretVolumeSource(in.Secret, out.Secret, s); err != nil {
|
|
| 4526 |
+ return err |
|
| 4527 |
+ } |
|
| 4528 |
+ } else {
|
|
| 4529 |
+ out.Secret = nil |
|
| 4530 |
+ } |
|
| 4531 |
+ if in.NFS != nil {
|
|
| 4532 |
+ out.NFS = new(api.NFSVolumeSource) |
|
| 4533 |
+ if err := convert_v1beta3_NFSVolumeSource_To_api_NFSVolumeSource(in.NFS, out.NFS, s); err != nil {
|
|
| 4534 |
+ return err |
|
| 4535 |
+ } |
|
| 4536 |
+ } else {
|
|
| 4537 |
+ out.NFS = nil |
|
| 4538 |
+ } |
|
| 4539 |
+ if in.ISCSI != nil {
|
|
| 4540 |
+ out.ISCSI = new(api.ISCSIVolumeSource) |
|
| 4541 |
+ if err := convert_v1beta3_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in.ISCSI, out.ISCSI, s); err != nil {
|
|
| 4542 |
+ return err |
|
| 4543 |
+ } |
|
| 4544 |
+ } else {
|
|
| 4545 |
+ out.ISCSI = nil |
|
| 4546 |
+ } |
|
| 4547 |
+ if in.Glusterfs != nil {
|
|
| 4548 |
+ out.Glusterfs = new(api.GlusterfsVolumeSource) |
|
| 4549 |
+ if err := convert_v1beta3_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in.Glusterfs, out.Glusterfs, s); err != nil {
|
|
| 4550 |
+ return err |
|
| 4551 |
+ } |
|
| 4552 |
+ } else {
|
|
| 4553 |
+ out.Glusterfs = nil |
|
| 4554 |
+ } |
|
| 4555 |
+ if in.PersistentVolumeClaim != nil {
|
|
| 4556 |
+ out.PersistentVolumeClaim = new(api.PersistentVolumeClaimVolumeSource) |
|
| 4557 |
+ if err := convert_v1beta3_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(in.PersistentVolumeClaim, out.PersistentVolumeClaim, s); err != nil {
|
|
| 4558 |
+ return err |
|
| 4559 |
+ } |
|
| 4560 |
+ } else {
|
|
| 4561 |
+ out.PersistentVolumeClaim = nil |
|
| 4562 |
+ } |
|
| 4563 |
+ if in.RBD != nil {
|
|
| 4564 |
+ out.RBD = new(api.RBDVolumeSource) |
|
| 4565 |
+ if err := convert_v1beta3_RBDVolumeSource_To_api_RBDVolumeSource(in.RBD, out.RBD, s); err != nil {
|
|
| 4566 |
+ return err |
|
| 4567 |
+ } |
|
| 4568 |
+ } else {
|
|
| 4569 |
+ out.RBD = nil |
|
| 4570 |
+ } |
|
| 4571 |
+ if in.CephFS != nil {
|
|
| 4572 |
+ out.CephFS = new(api.CephFSVolumeSource) |
|
| 4573 |
+ if err := convert_v1beta3_CephFSVolumeSource_To_api_CephFSVolumeSource(in.CephFS, out.CephFS, s); err != nil {
|
|
| 4574 |
+ return err |
|
| 4575 |
+ } |
|
| 4576 |
+ } else {
|
|
| 4577 |
+ out.CephFS = nil |
|
| 4578 |
+ } |
|
| 4579 |
+ if in.DownwardAPI != nil {
|
|
| 4580 |
+ out.DownwardAPI = new(api.DownwardAPIVolumeSource) |
|
| 4581 |
+ if err := convert_v1beta3_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in.DownwardAPI, out.DownwardAPI, s); err != nil {
|
|
| 4582 |
+ return err |
|
| 4583 |
+ } |
|
| 4584 |
+ } else {
|
|
| 4585 |
+ out.DownwardAPI = nil |
|
| 4586 |
+ } |
|
| 4587 |
+ return nil |
|
| 4588 |
+} |
|
| 4589 |
+ |
|
| 4590 |
+func init() {
|
|
| 4591 |
+ err := api.Scheme.AddGeneratedConversionFuncs( |
|
| 4592 |
+ convert_api_AWSElasticBlockStoreVolumeSource_To_v1beta3_AWSElasticBlockStoreVolumeSource, |
|
| 4593 |
+ convert_api_Binding_To_v1beta3_Binding, |
|
| 4594 |
+ convert_api_Capabilities_To_v1beta3_Capabilities, |
|
| 4595 |
+ convert_api_CephFSVolumeSource_To_v1beta3_CephFSVolumeSource, |
|
| 4596 |
+ convert_api_CinderVolumeSource_To_v1beta3_CinderVolumeSource, |
|
| 4597 |
+ convert_api_ComponentCondition_To_v1beta3_ComponentCondition, |
|
| 4598 |
+ convert_api_ComponentStatusList_To_v1beta3_ComponentStatusList, |
|
| 4599 |
+ convert_api_ComponentStatus_To_v1beta3_ComponentStatus, |
|
| 4600 |
+ convert_api_ContainerPort_To_v1beta3_ContainerPort, |
|
| 4601 |
+ convert_api_ContainerStateRunning_To_v1beta3_ContainerStateRunning, |
|
| 4602 |
+ convert_api_ContainerStateWaiting_To_v1beta3_ContainerStateWaiting, |
|
| 4603 |
+ convert_api_ContainerStatus_To_v1beta3_ContainerStatus, |
|
| 4604 |
+ convert_api_DeleteOptions_To_v1beta3_DeleteOptions, |
|
| 4605 |
+ convert_api_DownwardAPIVolumeFile_To_v1beta3_DownwardAPIVolumeFile, |
|
| 4606 |
+ convert_api_DownwardAPIVolumeSource_To_v1beta3_DownwardAPIVolumeSource, |
|
| 4607 |
+ convert_api_EmptyDirVolumeSource_To_v1beta3_EmptyDirVolumeSource, |
|
| 4608 |
+ convert_api_EndpointAddress_To_v1beta3_EndpointAddress, |
|
| 4609 |
+ convert_api_EndpointPort_To_v1beta3_EndpointPort, |
|
| 4610 |
+ convert_api_EndpointSubset_To_v1beta3_EndpointSubset, |
|
| 4611 |
+ convert_api_EndpointsList_To_v1beta3_EndpointsList, |
|
| 4612 |
+ convert_api_Endpoints_To_v1beta3_Endpoints, |
|
| 4613 |
+ convert_api_EnvVarSource_To_v1beta3_EnvVarSource, |
|
| 4614 |
+ convert_api_EnvVar_To_v1beta3_EnvVar, |
|
| 4615 |
+ convert_api_EventList_To_v1beta3_EventList, |
|
| 4616 |
+ convert_api_EventSource_To_v1beta3_EventSource, |
|
| 4617 |
+ convert_api_Event_To_v1beta3_Event, |
|
| 4618 |
+ convert_api_ExecAction_To_v1beta3_ExecAction, |
|
| 4619 |
+ convert_api_GCEPersistentDiskVolumeSource_To_v1beta3_GCEPersistentDiskVolumeSource, |
|
| 4620 |
+ convert_api_GitRepoVolumeSource_To_v1beta3_GitRepoVolumeSource, |
|
| 4621 |
+ convert_api_GlusterfsVolumeSource_To_v1beta3_GlusterfsVolumeSource, |
|
| 4622 |
+ convert_api_HTTPGetAction_To_v1beta3_HTTPGetAction, |
|
| 4623 |
+ convert_api_Handler_To_v1beta3_Handler, |
|
| 4624 |
+ convert_api_HostPathVolumeSource_To_v1beta3_HostPathVolumeSource, |
|
| 4625 |
+ convert_api_ISCSIVolumeSource_To_v1beta3_ISCSIVolumeSource, |
|
| 4626 |
+ convert_api_Lifecycle_To_v1beta3_Lifecycle, |
|
| 4627 |
+ convert_api_LimitRangeItem_To_v1beta3_LimitRangeItem, |
|
| 4628 |
+ convert_api_LimitRangeList_To_v1beta3_LimitRangeList, |
|
| 4629 |
+ convert_api_LimitRangeSpec_To_v1beta3_LimitRangeSpec, |
|
| 4630 |
+ convert_api_LimitRange_To_v1beta3_LimitRange, |
|
| 4631 |
+ convert_api_ListMeta_To_v1beta3_ListMeta, |
|
| 4632 |
+ convert_api_ListOptions_To_v1beta3_ListOptions, |
|
| 4633 |
+ convert_api_List_To_v1beta3_List, |
|
| 4634 |
+ convert_api_LoadBalancerIngress_To_v1beta3_LoadBalancerIngress, |
|
| 4635 |
+ convert_api_LoadBalancerStatus_To_v1beta3_LoadBalancerStatus, |
|
| 4636 |
+ convert_api_LocalObjectReference_To_v1beta3_LocalObjectReference, |
|
| 4637 |
+ convert_api_NFSVolumeSource_To_v1beta3_NFSVolumeSource, |
|
| 4638 |
+ convert_api_NamespaceList_To_v1beta3_NamespaceList, |
|
| 4639 |
+ convert_api_NamespaceSpec_To_v1beta3_NamespaceSpec, |
|
| 4640 |
+ convert_api_NamespaceStatus_To_v1beta3_NamespaceStatus, |
|
| 4641 |
+ convert_api_Namespace_To_v1beta3_Namespace, |
|
| 4642 |
+ convert_api_NodeAddress_To_v1beta3_NodeAddress, |
|
| 4643 |
+ convert_api_NodeCondition_To_v1beta3_NodeCondition, |
|
| 4644 |
+ convert_api_NodeList_To_v1beta3_NodeList, |
|
| 4645 |
+ convert_api_NodeSpec_To_v1beta3_NodeSpec, |
|
| 4646 |
+ convert_api_NodeStatus_To_v1beta3_NodeStatus, |
|
| 4647 |
+ convert_api_NodeSystemInfo_To_v1beta3_NodeSystemInfo, |
|
| 4648 |
+ convert_api_Node_To_v1beta3_Node, |
|
| 4649 |
+ convert_api_ObjectFieldSelector_To_v1beta3_ObjectFieldSelector, |
|
| 4650 |
+ convert_api_ObjectMeta_To_v1beta3_ObjectMeta, |
|
| 4651 |
+ convert_api_ObjectReference_To_v1beta3_ObjectReference, |
|
| 4652 |
+ convert_api_PersistentVolumeClaimList_To_v1beta3_PersistentVolumeClaimList, |
|
| 4653 |
+ convert_api_PersistentVolumeClaimSpec_To_v1beta3_PersistentVolumeClaimSpec, |
|
| 4654 |
+ convert_api_PersistentVolumeClaimStatus_To_v1beta3_PersistentVolumeClaimStatus, |
|
| 4655 |
+ convert_api_PersistentVolumeClaimVolumeSource_To_v1beta3_PersistentVolumeClaimVolumeSource, |
|
| 4656 |
+ convert_api_PersistentVolumeClaim_To_v1beta3_PersistentVolumeClaim, |
|
| 4657 |
+ convert_api_PersistentVolumeList_To_v1beta3_PersistentVolumeList, |
|
| 4658 |
+ convert_api_PersistentVolumeSource_To_v1beta3_PersistentVolumeSource, |
|
| 4659 |
+ convert_api_PersistentVolumeSpec_To_v1beta3_PersistentVolumeSpec, |
|
| 4660 |
+ convert_api_PersistentVolumeStatus_To_v1beta3_PersistentVolumeStatus, |
|
| 4661 |
+ convert_api_PersistentVolume_To_v1beta3_PersistentVolume, |
|
| 4662 |
+ convert_api_PodCondition_To_v1beta3_PodCondition, |
|
| 4663 |
+ convert_api_PodExecOptions_To_v1beta3_PodExecOptions, |
|
| 4664 |
+ convert_api_PodList_To_v1beta3_PodList, |
|
| 4665 |
+ convert_api_PodLogOptions_To_v1beta3_PodLogOptions, |
|
| 4666 |
+ convert_api_PodProxyOptions_To_v1beta3_PodProxyOptions, |
|
| 4667 |
+ convert_api_PodStatusResult_To_v1beta3_PodStatusResult, |
|
| 4668 |
+ convert_api_PodStatus_To_v1beta3_PodStatus, |
|
| 4669 |
+ convert_api_PodTemplateList_To_v1beta3_PodTemplateList, |
|
| 4670 |
+ convert_api_PodTemplateSpec_To_v1beta3_PodTemplateSpec, |
|
| 4671 |
+ convert_api_PodTemplate_To_v1beta3_PodTemplate, |
|
| 4672 |
+ convert_api_Pod_To_v1beta3_Pod, |
|
| 4673 |
+ convert_api_Probe_To_v1beta3_Probe, |
|
| 4674 |
+ convert_api_RBDVolumeSource_To_v1beta3_RBDVolumeSource, |
|
| 4675 |
+ convert_api_RangeAllocation_To_v1beta3_RangeAllocation, |
|
| 4676 |
+ convert_api_ReplicationControllerList_To_v1beta3_ReplicationControllerList, |
|
| 4677 |
+ convert_api_ReplicationControllerStatus_To_v1beta3_ReplicationControllerStatus, |
|
| 4678 |
+ convert_api_ReplicationController_To_v1beta3_ReplicationController, |
|
| 4679 |
+ convert_api_ResourceQuotaList_To_v1beta3_ResourceQuotaList, |
|
| 4680 |
+ convert_api_ResourceQuotaSpec_To_v1beta3_ResourceQuotaSpec, |
|
| 4681 |
+ convert_api_ResourceQuotaStatus_To_v1beta3_ResourceQuotaStatus, |
|
| 4682 |
+ convert_api_ResourceQuota_To_v1beta3_ResourceQuota, |
|
| 4683 |
+ convert_api_ResourceRequirements_To_v1beta3_ResourceRequirements, |
|
| 4684 |
+ convert_api_RunAsUserStrategyOptions_To_v1beta3_RunAsUserStrategyOptions, |
|
| 4685 |
+ convert_api_SELinuxContextStrategyOptions_To_v1beta3_SELinuxContextStrategyOptions, |
|
| 4686 |
+ convert_api_SELinuxOptions_To_v1beta3_SELinuxOptions, |
|
| 4687 |
+ convert_api_SecretList_To_v1beta3_SecretList, |
|
| 4688 |
+ convert_api_SecretVolumeSource_To_v1beta3_SecretVolumeSource, |
|
| 4689 |
+ convert_api_Secret_To_v1beta3_Secret, |
|
| 4690 |
+ convert_api_SecurityContextConstraintsList_To_v1beta3_SecurityContextConstraintsList, |
|
| 4691 |
+ convert_api_SecurityContextConstraints_To_v1beta3_SecurityContextConstraints, |
|
| 4692 |
+ convert_api_SecurityContext_To_v1beta3_SecurityContext, |
|
| 4693 |
+ convert_api_SerializedReference_To_v1beta3_SerializedReference, |
|
| 4694 |
+ convert_api_ServiceAccountList_To_v1beta3_ServiceAccountList, |
|
| 4695 |
+ convert_api_ServiceAccount_To_v1beta3_ServiceAccount, |
|
| 4696 |
+ convert_api_ServiceList_To_v1beta3_ServiceList, |
|
| 4697 |
+ convert_api_ServicePort_To_v1beta3_ServicePort, |
|
| 4698 |
+ convert_api_ServiceStatus_To_v1beta3_ServiceStatus, |
|
| 4699 |
+ convert_api_Service_To_v1beta3_Service, |
|
| 4700 |
+ convert_api_Status_To_v1beta3_Status, |
|
| 4701 |
+ convert_api_TCPSocketAction_To_v1beta3_TCPSocketAction, |
|
| 4702 |
+ convert_api_TypeMeta_To_v1beta3_TypeMeta, |
|
| 4703 |
+ convert_api_VolumeMount_To_v1beta3_VolumeMount, |
|
| 4704 |
+ convert_api_VolumeSource_To_v1beta3_VolumeSource, |
|
| 4705 |
+ convert_api_Volume_To_v1beta3_Volume, |
|
| 4706 |
+ convert_v1beta3_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource, |
|
| 4707 |
+ convert_v1beta3_Binding_To_api_Binding, |
|
| 4708 |
+ convert_v1beta3_Capabilities_To_api_Capabilities, |
|
| 4709 |
+ convert_v1beta3_CephFSVolumeSource_To_api_CephFSVolumeSource, |
|
| 4710 |
+ convert_v1beta3_CinderVolumeSource_To_api_CinderVolumeSource, |
|
| 4711 |
+ convert_v1beta3_ComponentCondition_To_api_ComponentCondition, |
|
| 4712 |
+ convert_v1beta3_ComponentStatusList_To_api_ComponentStatusList, |
|
| 4713 |
+ convert_v1beta3_ComponentStatus_To_api_ComponentStatus, |
|
| 4714 |
+ convert_v1beta3_ContainerPort_To_api_ContainerPort, |
|
| 4715 |
+ convert_v1beta3_ContainerStateRunning_To_api_ContainerStateRunning, |
|
| 4716 |
+ convert_v1beta3_ContainerStateWaiting_To_api_ContainerStateWaiting, |
|
| 4717 |
+ convert_v1beta3_ContainerStatus_To_api_ContainerStatus, |
|
| 4718 |
+ convert_v1beta3_DeleteOptions_To_api_DeleteOptions, |
|
| 4719 |
+ convert_v1beta3_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile, |
|
| 4720 |
+ convert_v1beta3_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource, |
|
| 4721 |
+ convert_v1beta3_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource, |
|
| 4722 |
+ convert_v1beta3_EndpointAddress_To_api_EndpointAddress, |
|
| 4723 |
+ convert_v1beta3_EndpointPort_To_api_EndpointPort, |
|
| 4724 |
+ convert_v1beta3_EndpointSubset_To_api_EndpointSubset, |
|
| 4725 |
+ convert_v1beta3_EndpointsList_To_api_EndpointsList, |
|
| 4726 |
+ convert_v1beta3_Endpoints_To_api_Endpoints, |
|
| 4727 |
+ convert_v1beta3_EnvVarSource_To_api_EnvVarSource, |
|
| 4728 |
+ convert_v1beta3_EnvVar_To_api_EnvVar, |
|
| 4729 |
+ convert_v1beta3_EventList_To_api_EventList, |
|
| 4730 |
+ convert_v1beta3_EventSource_To_api_EventSource, |
|
| 4731 |
+ convert_v1beta3_Event_To_api_Event, |
|
| 4732 |
+ convert_v1beta3_ExecAction_To_api_ExecAction, |
|
| 4733 |
+ convert_v1beta3_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource, |
|
| 4734 |
+ convert_v1beta3_GitRepoVolumeSource_To_api_GitRepoVolumeSource, |
|
| 4735 |
+ convert_v1beta3_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource, |
|
| 4736 |
+ convert_v1beta3_HTTPGetAction_To_api_HTTPGetAction, |
|
| 4737 |
+ convert_v1beta3_Handler_To_api_Handler, |
|
| 4738 |
+ convert_v1beta3_HostPathVolumeSource_To_api_HostPathVolumeSource, |
|
| 4739 |
+ convert_v1beta3_ISCSIVolumeSource_To_api_ISCSIVolumeSource, |
|
| 4740 |
+ convert_v1beta3_Lifecycle_To_api_Lifecycle, |
|
| 4741 |
+ convert_v1beta3_LimitRangeItem_To_api_LimitRangeItem, |
|
| 4742 |
+ convert_v1beta3_LimitRangeList_To_api_LimitRangeList, |
|
| 4743 |
+ convert_v1beta3_LimitRangeSpec_To_api_LimitRangeSpec, |
|
| 4744 |
+ convert_v1beta3_LimitRange_To_api_LimitRange, |
|
| 4745 |
+ convert_v1beta3_ListMeta_To_api_ListMeta, |
|
| 4746 |
+ convert_v1beta3_ListOptions_To_api_ListOptions, |
|
| 4747 |
+ convert_v1beta3_List_To_api_List, |
|
| 4748 |
+ convert_v1beta3_LoadBalancerIngress_To_api_LoadBalancerIngress, |
|
| 4749 |
+ convert_v1beta3_LoadBalancerStatus_To_api_LoadBalancerStatus, |
|
| 4750 |
+ convert_v1beta3_LocalObjectReference_To_api_LocalObjectReference, |
|
| 4751 |
+ convert_v1beta3_NFSVolumeSource_To_api_NFSVolumeSource, |
|
| 4752 |
+ convert_v1beta3_NamespaceList_To_api_NamespaceList, |
|
| 4753 |
+ convert_v1beta3_NamespaceSpec_To_api_NamespaceSpec, |
|
| 4754 |
+ convert_v1beta3_NamespaceStatus_To_api_NamespaceStatus, |
|
| 4755 |
+ convert_v1beta3_Namespace_To_api_Namespace, |
|
| 4756 |
+ convert_v1beta3_NodeAddress_To_api_NodeAddress, |
|
| 4757 |
+ convert_v1beta3_NodeCondition_To_api_NodeCondition, |
|
| 4758 |
+ convert_v1beta3_NodeList_To_api_NodeList, |
|
| 4759 |
+ convert_v1beta3_NodeSpec_To_api_NodeSpec, |
|
| 4760 |
+ convert_v1beta3_NodeStatus_To_api_NodeStatus, |
|
| 4761 |
+ convert_v1beta3_NodeSystemInfo_To_api_NodeSystemInfo, |
|
| 4762 |
+ convert_v1beta3_Node_To_api_Node, |
|
| 4763 |
+ convert_v1beta3_ObjectFieldSelector_To_api_ObjectFieldSelector, |
|
| 4764 |
+ convert_v1beta3_ObjectMeta_To_api_ObjectMeta, |
|
| 4765 |
+ convert_v1beta3_ObjectReference_To_api_ObjectReference, |
|
| 4766 |
+ convert_v1beta3_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList, |
|
| 4767 |
+ convert_v1beta3_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec, |
|
| 4768 |
+ convert_v1beta3_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus, |
|
| 4769 |
+ convert_v1beta3_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource, |
|
| 4770 |
+ convert_v1beta3_PersistentVolumeClaim_To_api_PersistentVolumeClaim, |
|
| 4771 |
+ convert_v1beta3_PersistentVolumeList_To_api_PersistentVolumeList, |
|
| 4772 |
+ convert_v1beta3_PersistentVolumeSource_To_api_PersistentVolumeSource, |
|
| 4773 |
+ convert_v1beta3_PersistentVolumeSpec_To_api_PersistentVolumeSpec, |
|
| 4774 |
+ convert_v1beta3_PersistentVolumeStatus_To_api_PersistentVolumeStatus, |
|
| 4775 |
+ convert_v1beta3_PersistentVolume_To_api_PersistentVolume, |
|
| 4776 |
+ convert_v1beta3_PodCondition_To_api_PodCondition, |
|
| 4777 |
+ convert_v1beta3_PodExecOptions_To_api_PodExecOptions, |
|
| 4778 |
+ convert_v1beta3_PodList_To_api_PodList, |
|
| 4779 |
+ convert_v1beta3_PodLogOptions_To_api_PodLogOptions, |
|
| 4780 |
+ convert_v1beta3_PodProxyOptions_To_api_PodProxyOptions, |
|
| 4781 |
+ convert_v1beta3_PodStatusResult_To_api_PodStatusResult, |
|
| 4782 |
+ convert_v1beta3_PodStatus_To_api_PodStatus, |
|
| 4783 |
+ convert_v1beta3_PodTemplateList_To_api_PodTemplateList, |
|
| 4784 |
+ convert_v1beta3_PodTemplateSpec_To_api_PodTemplateSpec, |
|
| 4785 |
+ convert_v1beta3_PodTemplate_To_api_PodTemplate, |
|
| 4786 |
+ convert_v1beta3_Pod_To_api_Pod, |
|
| 4787 |
+ convert_v1beta3_Probe_To_api_Probe, |
|
| 4788 |
+ convert_v1beta3_RBDVolumeSource_To_api_RBDVolumeSource, |
|
| 4789 |
+ convert_v1beta3_RangeAllocation_To_api_RangeAllocation, |
|
| 4790 |
+ convert_v1beta3_ReplicationControllerList_To_api_ReplicationControllerList, |
|
| 4791 |
+ convert_v1beta3_ReplicationControllerStatus_To_api_ReplicationControllerStatus, |
|
| 4792 |
+ convert_v1beta3_ReplicationController_To_api_ReplicationController, |
|
| 4793 |
+ convert_v1beta3_ResourceQuotaList_To_api_ResourceQuotaList, |
|
| 4794 |
+ convert_v1beta3_ResourceQuotaSpec_To_api_ResourceQuotaSpec, |
|
| 4795 |
+ convert_v1beta3_ResourceQuotaStatus_To_api_ResourceQuotaStatus, |
|
| 4796 |
+ convert_v1beta3_ResourceQuota_To_api_ResourceQuota, |
|
| 4797 |
+ convert_v1beta3_ResourceRequirements_To_api_ResourceRequirements, |
|
| 4798 |
+ convert_v1beta3_RunAsUserStrategyOptions_To_api_RunAsUserStrategyOptions, |
|
| 4799 |
+ convert_v1beta3_SELinuxContextStrategyOptions_To_api_SELinuxContextStrategyOptions, |
|
| 4800 |
+ convert_v1beta3_SELinuxOptions_To_api_SELinuxOptions, |
|
| 4801 |
+ convert_v1beta3_SecretList_To_api_SecretList, |
|
| 4802 |
+ convert_v1beta3_SecretVolumeSource_To_api_SecretVolumeSource, |
|
| 4803 |
+ convert_v1beta3_Secret_To_api_Secret, |
|
| 4804 |
+ convert_v1beta3_SecurityContextConstraintsList_To_api_SecurityContextConstraintsList, |
|
| 4805 |
+ convert_v1beta3_SecurityContextConstraints_To_api_SecurityContextConstraints, |
|
| 4806 |
+ convert_v1beta3_SecurityContext_To_api_SecurityContext, |
|
| 4807 |
+ convert_v1beta3_SerializedReference_To_api_SerializedReference, |
|
| 4808 |
+ convert_v1beta3_ServiceAccountList_To_api_ServiceAccountList, |
|
| 4809 |
+ convert_v1beta3_ServiceAccount_To_api_ServiceAccount, |
|
| 4810 |
+ convert_v1beta3_ServiceList_To_api_ServiceList, |
|
| 4811 |
+ convert_v1beta3_ServicePort_To_api_ServicePort, |
|
| 4812 |
+ convert_v1beta3_ServiceStatus_To_api_ServiceStatus, |
|
| 4813 |
+ convert_v1beta3_Service_To_api_Service, |
|
| 4814 |
+ convert_v1beta3_Status_To_api_Status, |
|
| 4815 |
+ convert_v1beta3_TCPSocketAction_To_api_TCPSocketAction, |
|
| 4816 |
+ convert_v1beta3_TypeMeta_To_api_TypeMeta, |
|
| 4817 |
+ convert_v1beta3_VolumeMount_To_api_VolumeMount, |
|
| 4818 |
+ convert_v1beta3_VolumeSource_To_api_VolumeSource, |
|
| 4819 |
+ convert_v1beta3_Volume_To_api_Volume, |
|
| 4820 |
+ ) |
|
| 4821 |
+ if err != nil {
|
|
| 4822 |
+ // If one of the conversion functions is malformed, detect it immediately. |
|
| 4823 |
+ panic(err) |
|
| 4824 |
+ } |
|
| 4825 |
+} |
| 0 | 4826 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,139 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2014 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+package v1beta3_test |
|
| 17 |
+ |
|
| 18 |
+import ( |
|
| 19 |
+ "testing" |
|
| 20 |
+ |
|
| 21 |
+ "k8s.io/kubernetes/pkg/api" |
|
| 22 |
+ "k8s.io/kubernetes/pkg/api/resource" |
|
| 23 |
+ versioned "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 24 |
+) |
|
| 25 |
+ |
|
| 26 |
+func TestResourceQuotaStatusConversion(t *testing.T) {
|
|
| 27 |
+ // should serialize as "0" |
|
| 28 |
+ expected := resource.NewQuantity(int64(0), resource.DecimalSI) |
|
| 29 |
+ if "0" != expected.String() {
|
|
| 30 |
+ t.Errorf("Expected: 0, Actual: %v, do not require units", expected.String())
|
|
| 31 |
+ } |
|
| 32 |
+ |
|
| 33 |
+ parsed := resource.MustParse("0")
|
|
| 34 |
+ if "0" != parsed.String() {
|
|
| 35 |
+ t.Errorf("Expected: 0, Actual: %v, do not require units", parsed.String())
|
|
| 36 |
+ } |
|
| 37 |
+ |
|
| 38 |
+ quota := &api.ResourceQuota{}
|
|
| 39 |
+ quota.Status = api.ResourceQuotaStatus{}
|
|
| 40 |
+ quota.Status.Hard = api.ResourceList{}
|
|
| 41 |
+ quota.Status.Used = api.ResourceList{}
|
|
| 42 |
+ quota.Status.Hard[api.ResourcePods] = *expected |
|
| 43 |
+ |
|
| 44 |
+ // round-trip the object |
|
| 45 |
+ data, _ := versioned.Codec.Encode(quota) |
|
| 46 |
+ object, _ := versioned.Codec.Decode(data) |
|
| 47 |
+ after := object.(*api.ResourceQuota) |
|
| 48 |
+ actualQuantity := after.Status.Hard[api.ResourcePods] |
|
| 49 |
+ actual := &actualQuantity |
|
| 50 |
+ |
|
| 51 |
+ // should be "0", but was "0m" |
|
| 52 |
+ if expected.String() != actual.String() {
|
|
| 53 |
+ t.Errorf("Expected %v, Actual %v", expected.String(), actual.String())
|
|
| 54 |
+ } |
|
| 55 |
+} |
|
| 56 |
+ |
|
| 57 |
+func TestNodeConversion(t *testing.T) {
|
|
| 58 |
+ obj, err := versioned.Codec.Decode([]byte(`{"kind":"Minion","apiVersion":"v1beta3"}`))
|
|
| 59 |
+ if err != nil {
|
|
| 60 |
+ t.Fatalf("unexpected error: %v", err)
|
|
| 61 |
+ } |
|
| 62 |
+ if _, ok := obj.(*api.Node); !ok {
|
|
| 63 |
+ t.Errorf("unexpected type: %#v", obj)
|
|
| 64 |
+ } |
|
| 65 |
+ |
|
| 66 |
+ obj, err = versioned.Codec.Decode([]byte(`{"kind":"MinionList","apiVersion":"v1beta3"}`))
|
|
| 67 |
+ if err != nil {
|
|
| 68 |
+ t.Fatalf("unexpected error: %v", err)
|
|
| 69 |
+ } |
|
| 70 |
+ if _, ok := obj.(*api.NodeList); !ok {
|
|
| 71 |
+ t.Errorf("unexpected type: %#v", obj)
|
|
| 72 |
+ } |
|
| 73 |
+ |
|
| 74 |
+ obj = &api.Node{}
|
|
| 75 |
+ if err := versioned.Codec.DecodeInto([]byte(`{"kind":"Minion","apiVersion":"v1beta3"}`), obj); err != nil {
|
|
| 76 |
+ t.Fatalf("unexpected error: %v", err)
|
|
| 77 |
+ } |
|
| 78 |
+} |
|
| 79 |
+ |
|
| 80 |
+func TestBadSecurityContextConversion(t *testing.T) {
|
|
| 81 |
+ priv := false |
|
| 82 |
+ testCases := map[string]struct {
|
|
| 83 |
+ c *versioned.Container |
|
| 84 |
+ err string |
|
| 85 |
+ }{
|
|
| 86 |
+ // this use case must use true for the container and false for the sc. Otherwise the defaulter |
|
| 87 |
+ // will assume privileged was left undefined (since it is the default value) and copy the |
|
| 88 |
+ // sc setting upwards |
|
| 89 |
+ "mismatched privileged": {
|
|
| 90 |
+ c: &versioned.Container{
|
|
| 91 |
+ Privileged: true, |
|
| 92 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 93 |
+ Privileged: &priv, |
|
| 94 |
+ }, |
|
| 95 |
+ }, |
|
| 96 |
+ err: "container privileged settings do not match security context settings, cannot convert", |
|
| 97 |
+ }, |
|
| 98 |
+ "mismatched caps add": {
|
|
| 99 |
+ c: &versioned.Container{
|
|
| 100 |
+ Capabilities: versioned.Capabilities{
|
|
| 101 |
+ Add: []versioned.Capability{"foo"},
|
|
| 102 |
+ }, |
|
| 103 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 104 |
+ Capabilities: &versioned.Capabilities{
|
|
| 105 |
+ Add: []versioned.Capability{"bar"},
|
|
| 106 |
+ }, |
|
| 107 |
+ }, |
|
| 108 |
+ }, |
|
| 109 |
+ err: "container capability settings do not match security context settings, cannot convert", |
|
| 110 |
+ }, |
|
| 111 |
+ "mismatched caps drop": {
|
|
| 112 |
+ c: &versioned.Container{
|
|
| 113 |
+ Capabilities: versioned.Capabilities{
|
|
| 114 |
+ Drop: []versioned.Capability{"foo"},
|
|
| 115 |
+ }, |
|
| 116 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 117 |
+ Capabilities: &versioned.Capabilities{
|
|
| 118 |
+ Drop: []versioned.Capability{"bar"},
|
|
| 119 |
+ }, |
|
| 120 |
+ }, |
|
| 121 |
+ }, |
|
| 122 |
+ err: "container capability settings do not match security context settings, cannot convert", |
|
| 123 |
+ }, |
|
| 124 |
+ } |
|
| 125 |
+ |
|
| 126 |
+ for k, v := range testCases {
|
|
| 127 |
+ got := api.Container{}
|
|
| 128 |
+ err := api.Scheme.Convert(v.c, &got) |
|
| 129 |
+ if err == nil {
|
|
| 130 |
+ t.Errorf("expected error for case %s but got none", k)
|
|
| 131 |
+ } else {
|
|
| 132 |
+ if err.Error() != v.err {
|
|
| 133 |
+ t.Errorf("unexpected error for case %s. Expected: %s but got: %s", k, v.err, err.Error())
|
|
| 134 |
+ } |
|
| 135 |
+ } |
|
| 136 |
+ } |
|
| 137 |
+ |
|
| 138 |
+} |
| 0 | 139 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,2480 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2015 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-deep-copies.sh. |
|
| 17 |
+ |
|
| 18 |
+package v1beta3 |
|
| 19 |
+ |
|
| 20 |
+import ( |
|
| 21 |
+ time "time" |
|
| 22 |
+ |
|
| 23 |
+ api "k8s.io/kubernetes/pkg/api" |
|
| 24 |
+ resource "k8s.io/kubernetes/pkg/api/resource" |
|
| 25 |
+ conversion "k8s.io/kubernetes/pkg/conversion" |
|
| 26 |
+ runtime "k8s.io/kubernetes/pkg/runtime" |
|
| 27 |
+ util "k8s.io/kubernetes/pkg/util" |
|
| 28 |
+ inf "speter.net/go/exp/math/dec/inf" |
|
| 29 |
+) |
|
| 30 |
+ |
|
| 31 |
+func deepCopy_resource_Quantity(in resource.Quantity, out *resource.Quantity, c *conversion.Cloner) error {
|
|
| 32 |
+ if in.Amount != nil {
|
|
| 33 |
+ if newVal, err := c.DeepCopy(in.Amount); err != nil {
|
|
| 34 |
+ return err |
|
| 35 |
+ } else if newVal == nil {
|
|
| 36 |
+ out.Amount = nil |
|
| 37 |
+ } else {
|
|
| 38 |
+ out.Amount = newVal.(*inf.Dec) |
|
| 39 |
+ } |
|
| 40 |
+ } else {
|
|
| 41 |
+ out.Amount = nil |
|
| 42 |
+ } |
|
| 43 |
+ out.Format = in.Format |
|
| 44 |
+ return nil |
|
| 45 |
+} |
|
| 46 |
+ |
|
| 47 |
+func deepCopy_v1beta3_AWSElasticBlockStoreVolumeSource(in AWSElasticBlockStoreVolumeSource, out *AWSElasticBlockStoreVolumeSource, c *conversion.Cloner) error {
|
|
| 48 |
+ out.VolumeID = in.VolumeID |
|
| 49 |
+ out.FSType = in.FSType |
|
| 50 |
+ out.Partition = in.Partition |
|
| 51 |
+ out.ReadOnly = in.ReadOnly |
|
| 52 |
+ return nil |
|
| 53 |
+} |
|
| 54 |
+ |
|
| 55 |
+func deepCopy_v1beta3_Binding(in Binding, out *Binding, c *conversion.Cloner) error {
|
|
| 56 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 57 |
+ return err |
|
| 58 |
+ } |
|
| 59 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 60 |
+ return err |
|
| 61 |
+ } |
|
| 62 |
+ if err := deepCopy_v1beta3_ObjectReference(in.Target, &out.Target, c); err != nil {
|
|
| 63 |
+ return err |
|
| 64 |
+ } |
|
| 65 |
+ return nil |
|
| 66 |
+} |
|
| 67 |
+ |
|
| 68 |
+func deepCopy_v1beta3_Capabilities(in Capabilities, out *Capabilities, c *conversion.Cloner) error {
|
|
| 69 |
+ if in.Add != nil {
|
|
| 70 |
+ out.Add = make([]Capability, len(in.Add)) |
|
| 71 |
+ for i := range in.Add {
|
|
| 72 |
+ out.Add[i] = in.Add[i] |
|
| 73 |
+ } |
|
| 74 |
+ } else {
|
|
| 75 |
+ out.Add = nil |
|
| 76 |
+ } |
|
| 77 |
+ if in.Drop != nil {
|
|
| 78 |
+ out.Drop = make([]Capability, len(in.Drop)) |
|
| 79 |
+ for i := range in.Drop {
|
|
| 80 |
+ out.Drop[i] = in.Drop[i] |
|
| 81 |
+ } |
|
| 82 |
+ } else {
|
|
| 83 |
+ out.Drop = nil |
|
| 84 |
+ } |
|
| 85 |
+ return nil |
|
| 86 |
+} |
|
| 87 |
+ |
|
| 88 |
+func deepCopy_v1beta3_CephFSVolumeSource(in CephFSVolumeSource, out *CephFSVolumeSource, c *conversion.Cloner) error {
|
|
| 89 |
+ if in.Monitors != nil {
|
|
| 90 |
+ out.Monitors = make([]string, len(in.Monitors)) |
|
| 91 |
+ for i := range in.Monitors {
|
|
| 92 |
+ out.Monitors[i] = in.Monitors[i] |
|
| 93 |
+ } |
|
| 94 |
+ } else {
|
|
| 95 |
+ out.Monitors = nil |
|
| 96 |
+ } |
|
| 97 |
+ out.User = in.User |
|
| 98 |
+ out.SecretFile = in.SecretFile |
|
| 99 |
+ if in.SecretRef != nil {
|
|
| 100 |
+ out.SecretRef = new(LocalObjectReference) |
|
| 101 |
+ if err := deepCopy_v1beta3_LocalObjectReference(*in.SecretRef, out.SecretRef, c); err != nil {
|
|
| 102 |
+ return err |
|
| 103 |
+ } |
|
| 104 |
+ } else {
|
|
| 105 |
+ out.SecretRef = nil |
|
| 106 |
+ } |
|
| 107 |
+ out.ReadOnly = in.ReadOnly |
|
| 108 |
+ return nil |
|
| 109 |
+} |
|
| 110 |
+ |
|
| 111 |
+func deepCopy_v1beta3_CinderVolumeSource(in CinderVolumeSource, out *CinderVolumeSource, c *conversion.Cloner) error {
|
|
| 112 |
+ out.VolumeID = in.VolumeID |
|
| 113 |
+ out.FSType = in.FSType |
|
| 114 |
+ out.ReadOnly = in.ReadOnly |
|
| 115 |
+ return nil |
|
| 116 |
+} |
|
| 117 |
+ |
|
| 118 |
+func deepCopy_v1beta3_ComponentCondition(in ComponentCondition, out *ComponentCondition, c *conversion.Cloner) error {
|
|
| 119 |
+ out.Type = in.Type |
|
| 120 |
+ out.Status = in.Status |
|
| 121 |
+ out.Message = in.Message |
|
| 122 |
+ out.Error = in.Error |
|
| 123 |
+ return nil |
|
| 124 |
+} |
|
| 125 |
+ |
|
| 126 |
+func deepCopy_v1beta3_ComponentStatus(in ComponentStatus, out *ComponentStatus, c *conversion.Cloner) error {
|
|
| 127 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 128 |
+ return err |
|
| 129 |
+ } |
|
| 130 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 131 |
+ return err |
|
| 132 |
+ } |
|
| 133 |
+ if in.Conditions != nil {
|
|
| 134 |
+ out.Conditions = make([]ComponentCondition, len(in.Conditions)) |
|
| 135 |
+ for i := range in.Conditions {
|
|
| 136 |
+ if err := deepCopy_v1beta3_ComponentCondition(in.Conditions[i], &out.Conditions[i], c); err != nil {
|
|
| 137 |
+ return err |
|
| 138 |
+ } |
|
| 139 |
+ } |
|
| 140 |
+ } else {
|
|
| 141 |
+ out.Conditions = nil |
|
| 142 |
+ } |
|
| 143 |
+ return nil |
|
| 144 |
+} |
|
| 145 |
+ |
|
| 146 |
+func deepCopy_v1beta3_ComponentStatusList(in ComponentStatusList, out *ComponentStatusList, c *conversion.Cloner) error {
|
|
| 147 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 148 |
+ return err |
|
| 149 |
+ } |
|
| 150 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 151 |
+ return err |
|
| 152 |
+ } |
|
| 153 |
+ if in.Items != nil {
|
|
| 154 |
+ out.Items = make([]ComponentStatus, len(in.Items)) |
|
| 155 |
+ for i := range in.Items {
|
|
| 156 |
+ if err := deepCopy_v1beta3_ComponentStatus(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 157 |
+ return err |
|
| 158 |
+ } |
|
| 159 |
+ } |
|
| 160 |
+ } else {
|
|
| 161 |
+ out.Items = nil |
|
| 162 |
+ } |
|
| 163 |
+ return nil |
|
| 164 |
+} |
|
| 165 |
+ |
|
| 166 |
+func deepCopy_v1beta3_Container(in Container, out *Container, c *conversion.Cloner) error {
|
|
| 167 |
+ out.Name = in.Name |
|
| 168 |
+ out.Image = in.Image |
|
| 169 |
+ if in.Command != nil {
|
|
| 170 |
+ out.Command = make([]string, len(in.Command)) |
|
| 171 |
+ for i := range in.Command {
|
|
| 172 |
+ out.Command[i] = in.Command[i] |
|
| 173 |
+ } |
|
| 174 |
+ } else {
|
|
| 175 |
+ out.Command = nil |
|
| 176 |
+ } |
|
| 177 |
+ if in.Args != nil {
|
|
| 178 |
+ out.Args = make([]string, len(in.Args)) |
|
| 179 |
+ for i := range in.Args {
|
|
| 180 |
+ out.Args[i] = in.Args[i] |
|
| 181 |
+ } |
|
| 182 |
+ } else {
|
|
| 183 |
+ out.Args = nil |
|
| 184 |
+ } |
|
| 185 |
+ out.WorkingDir = in.WorkingDir |
|
| 186 |
+ if in.Ports != nil {
|
|
| 187 |
+ out.Ports = make([]ContainerPort, len(in.Ports)) |
|
| 188 |
+ for i := range in.Ports {
|
|
| 189 |
+ if err := deepCopy_v1beta3_ContainerPort(in.Ports[i], &out.Ports[i], c); err != nil {
|
|
| 190 |
+ return err |
|
| 191 |
+ } |
|
| 192 |
+ } |
|
| 193 |
+ } else {
|
|
| 194 |
+ out.Ports = nil |
|
| 195 |
+ } |
|
| 196 |
+ if in.Env != nil {
|
|
| 197 |
+ out.Env = make([]EnvVar, len(in.Env)) |
|
| 198 |
+ for i := range in.Env {
|
|
| 199 |
+ if err := deepCopy_v1beta3_EnvVar(in.Env[i], &out.Env[i], c); err != nil {
|
|
| 200 |
+ return err |
|
| 201 |
+ } |
|
| 202 |
+ } |
|
| 203 |
+ } else {
|
|
| 204 |
+ out.Env = nil |
|
| 205 |
+ } |
|
| 206 |
+ if err := deepCopy_v1beta3_ResourceRequirements(in.Resources, &out.Resources, c); err != nil {
|
|
| 207 |
+ return err |
|
| 208 |
+ } |
|
| 209 |
+ if in.VolumeMounts != nil {
|
|
| 210 |
+ out.VolumeMounts = make([]VolumeMount, len(in.VolumeMounts)) |
|
| 211 |
+ for i := range in.VolumeMounts {
|
|
| 212 |
+ if err := deepCopy_v1beta3_VolumeMount(in.VolumeMounts[i], &out.VolumeMounts[i], c); err != nil {
|
|
| 213 |
+ return err |
|
| 214 |
+ } |
|
| 215 |
+ } |
|
| 216 |
+ } else {
|
|
| 217 |
+ out.VolumeMounts = nil |
|
| 218 |
+ } |
|
| 219 |
+ if in.LivenessProbe != nil {
|
|
| 220 |
+ out.LivenessProbe = new(Probe) |
|
| 221 |
+ if err := deepCopy_v1beta3_Probe(*in.LivenessProbe, out.LivenessProbe, c); err != nil {
|
|
| 222 |
+ return err |
|
| 223 |
+ } |
|
| 224 |
+ } else {
|
|
| 225 |
+ out.LivenessProbe = nil |
|
| 226 |
+ } |
|
| 227 |
+ if in.ReadinessProbe != nil {
|
|
| 228 |
+ out.ReadinessProbe = new(Probe) |
|
| 229 |
+ if err := deepCopy_v1beta3_Probe(*in.ReadinessProbe, out.ReadinessProbe, c); err != nil {
|
|
| 230 |
+ return err |
|
| 231 |
+ } |
|
| 232 |
+ } else {
|
|
| 233 |
+ out.ReadinessProbe = nil |
|
| 234 |
+ } |
|
| 235 |
+ if in.Lifecycle != nil {
|
|
| 236 |
+ out.Lifecycle = new(Lifecycle) |
|
| 237 |
+ if err := deepCopy_v1beta3_Lifecycle(*in.Lifecycle, out.Lifecycle, c); err != nil {
|
|
| 238 |
+ return err |
|
| 239 |
+ } |
|
| 240 |
+ } else {
|
|
| 241 |
+ out.Lifecycle = nil |
|
| 242 |
+ } |
|
| 243 |
+ out.TerminationMessagePath = in.TerminationMessagePath |
|
| 244 |
+ out.Privileged = in.Privileged |
|
| 245 |
+ out.ImagePullPolicy = in.ImagePullPolicy |
|
| 246 |
+ if err := deepCopy_v1beta3_Capabilities(in.Capabilities, &out.Capabilities, c); err != nil {
|
|
| 247 |
+ return err |
|
| 248 |
+ } |
|
| 249 |
+ if in.SecurityContext != nil {
|
|
| 250 |
+ out.SecurityContext = new(SecurityContext) |
|
| 251 |
+ if err := deepCopy_v1beta3_SecurityContext(*in.SecurityContext, out.SecurityContext, c); err != nil {
|
|
| 252 |
+ return err |
|
| 253 |
+ } |
|
| 254 |
+ } else {
|
|
| 255 |
+ out.SecurityContext = nil |
|
| 256 |
+ } |
|
| 257 |
+ out.Stdin = in.Stdin |
|
| 258 |
+ out.TTY = in.TTY |
|
| 259 |
+ return nil |
|
| 260 |
+} |
|
| 261 |
+ |
|
| 262 |
+func deepCopy_v1beta3_ContainerPort(in ContainerPort, out *ContainerPort, c *conversion.Cloner) error {
|
|
| 263 |
+ out.Name = in.Name |
|
| 264 |
+ out.HostPort = in.HostPort |
|
| 265 |
+ out.ContainerPort = in.ContainerPort |
|
| 266 |
+ out.Protocol = in.Protocol |
|
| 267 |
+ out.HostIP = in.HostIP |
|
| 268 |
+ return nil |
|
| 269 |
+} |
|
| 270 |
+ |
|
| 271 |
+func deepCopy_v1beta3_ContainerState(in ContainerState, out *ContainerState, c *conversion.Cloner) error {
|
|
| 272 |
+ if in.Waiting != nil {
|
|
| 273 |
+ out.Waiting = new(ContainerStateWaiting) |
|
| 274 |
+ if err := deepCopy_v1beta3_ContainerStateWaiting(*in.Waiting, out.Waiting, c); err != nil {
|
|
| 275 |
+ return err |
|
| 276 |
+ } |
|
| 277 |
+ } else {
|
|
| 278 |
+ out.Waiting = nil |
|
| 279 |
+ } |
|
| 280 |
+ if in.Running != nil {
|
|
| 281 |
+ out.Running = new(ContainerStateRunning) |
|
| 282 |
+ if err := deepCopy_v1beta3_ContainerStateRunning(*in.Running, out.Running, c); err != nil {
|
|
| 283 |
+ return err |
|
| 284 |
+ } |
|
| 285 |
+ } else {
|
|
| 286 |
+ out.Running = nil |
|
| 287 |
+ } |
|
| 288 |
+ if in.Termination != nil {
|
|
| 289 |
+ out.Termination = new(ContainerStateTerminated) |
|
| 290 |
+ if err := deepCopy_v1beta3_ContainerStateTerminated(*in.Termination, out.Termination, c); err != nil {
|
|
| 291 |
+ return err |
|
| 292 |
+ } |
|
| 293 |
+ } else {
|
|
| 294 |
+ out.Termination = nil |
|
| 295 |
+ } |
|
| 296 |
+ return nil |
|
| 297 |
+} |
|
| 298 |
+ |
|
| 299 |
+func deepCopy_v1beta3_ContainerStateRunning(in ContainerStateRunning, out *ContainerStateRunning, c *conversion.Cloner) error {
|
|
| 300 |
+ if err := deepCopy_util_Time(in.StartedAt, &out.StartedAt, c); err != nil {
|
|
| 301 |
+ return err |
|
| 302 |
+ } |
|
| 303 |
+ return nil |
|
| 304 |
+} |
|
| 305 |
+ |
|
| 306 |
+func deepCopy_v1beta3_ContainerStateTerminated(in ContainerStateTerminated, out *ContainerStateTerminated, c *conversion.Cloner) error {
|
|
| 307 |
+ out.ExitCode = in.ExitCode |
|
| 308 |
+ out.Signal = in.Signal |
|
| 309 |
+ out.Reason = in.Reason |
|
| 310 |
+ out.Message = in.Message |
|
| 311 |
+ if err := deepCopy_util_Time(in.StartedAt, &out.StartedAt, c); err != nil {
|
|
| 312 |
+ return err |
|
| 313 |
+ } |
|
| 314 |
+ if err := deepCopy_util_Time(in.FinishedAt, &out.FinishedAt, c); err != nil {
|
|
| 315 |
+ return err |
|
| 316 |
+ } |
|
| 317 |
+ out.ContainerID = in.ContainerID |
|
| 318 |
+ return nil |
|
| 319 |
+} |
|
| 320 |
+ |
|
| 321 |
+func deepCopy_v1beta3_ContainerStateWaiting(in ContainerStateWaiting, out *ContainerStateWaiting, c *conversion.Cloner) error {
|
|
| 322 |
+ out.Reason = in.Reason |
|
| 323 |
+ return nil |
|
| 324 |
+} |
|
| 325 |
+ |
|
| 326 |
+func deepCopy_v1beta3_ContainerStatus(in ContainerStatus, out *ContainerStatus, c *conversion.Cloner) error {
|
|
| 327 |
+ out.Name = in.Name |
|
| 328 |
+ if err := deepCopy_v1beta3_ContainerState(in.State, &out.State, c); err != nil {
|
|
| 329 |
+ return err |
|
| 330 |
+ } |
|
| 331 |
+ if err := deepCopy_v1beta3_ContainerState(in.LastTerminationState, &out.LastTerminationState, c); err != nil {
|
|
| 332 |
+ return err |
|
| 333 |
+ } |
|
| 334 |
+ out.Ready = in.Ready |
|
| 335 |
+ out.RestartCount = in.RestartCount |
|
| 336 |
+ out.Image = in.Image |
|
| 337 |
+ out.ImageID = in.ImageID |
|
| 338 |
+ out.ContainerID = in.ContainerID |
|
| 339 |
+ return nil |
|
| 340 |
+} |
|
| 341 |
+ |
|
| 342 |
+func deepCopy_v1beta3_DeleteOptions(in DeleteOptions, out *DeleteOptions, c *conversion.Cloner) error {
|
|
| 343 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 344 |
+ return err |
|
| 345 |
+ } |
|
| 346 |
+ if in.GracePeriodSeconds != nil {
|
|
| 347 |
+ out.GracePeriodSeconds = new(int64) |
|
| 348 |
+ *out.GracePeriodSeconds = *in.GracePeriodSeconds |
|
| 349 |
+ } else {
|
|
| 350 |
+ out.GracePeriodSeconds = nil |
|
| 351 |
+ } |
|
| 352 |
+ return nil |
|
| 353 |
+} |
|
| 354 |
+ |
|
| 355 |
+func deepCopy_v1beta3_DownwardAPIVolumeFile(in DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, c *conversion.Cloner) error {
|
|
| 356 |
+ out.Path = in.Path |
|
| 357 |
+ if err := deepCopy_v1beta3_ObjectFieldSelector(in.FieldRef, &out.FieldRef, c); err != nil {
|
|
| 358 |
+ return err |
|
| 359 |
+ } |
|
| 360 |
+ return nil |
|
| 361 |
+} |
|
| 362 |
+ |
|
| 363 |
+func deepCopy_v1beta3_DownwardAPIVolumeSource(in DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, c *conversion.Cloner) error {
|
|
| 364 |
+ if in.Items != nil {
|
|
| 365 |
+ out.Items = make([]DownwardAPIVolumeFile, len(in.Items)) |
|
| 366 |
+ for i := range in.Items {
|
|
| 367 |
+ if err := deepCopy_v1beta3_DownwardAPIVolumeFile(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 368 |
+ return err |
|
| 369 |
+ } |
|
| 370 |
+ } |
|
| 371 |
+ } else {
|
|
| 372 |
+ out.Items = nil |
|
| 373 |
+ } |
|
| 374 |
+ return nil |
|
| 375 |
+} |
|
| 376 |
+ |
|
| 377 |
+func deepCopy_v1beta3_EmptyDirVolumeSource(in EmptyDirVolumeSource, out *EmptyDirVolumeSource, c *conversion.Cloner) error {
|
|
| 378 |
+ out.Medium = in.Medium |
|
| 379 |
+ return nil |
|
| 380 |
+} |
|
| 381 |
+ |
|
| 382 |
+func deepCopy_v1beta3_EndpointAddress(in EndpointAddress, out *EndpointAddress, c *conversion.Cloner) error {
|
|
| 383 |
+ out.IP = in.IP |
|
| 384 |
+ if in.TargetRef != nil {
|
|
| 385 |
+ out.TargetRef = new(ObjectReference) |
|
| 386 |
+ if err := deepCopy_v1beta3_ObjectReference(*in.TargetRef, out.TargetRef, c); err != nil {
|
|
| 387 |
+ return err |
|
| 388 |
+ } |
|
| 389 |
+ } else {
|
|
| 390 |
+ out.TargetRef = nil |
|
| 391 |
+ } |
|
| 392 |
+ return nil |
|
| 393 |
+} |
|
| 394 |
+ |
|
| 395 |
+func deepCopy_v1beta3_EndpointPort(in EndpointPort, out *EndpointPort, c *conversion.Cloner) error {
|
|
| 396 |
+ out.Name = in.Name |
|
| 397 |
+ out.Port = in.Port |
|
| 398 |
+ out.Protocol = in.Protocol |
|
| 399 |
+ return nil |
|
| 400 |
+} |
|
| 401 |
+ |
|
| 402 |
+func deepCopy_v1beta3_EndpointSubset(in EndpointSubset, out *EndpointSubset, c *conversion.Cloner) error {
|
|
| 403 |
+ if in.Addresses != nil {
|
|
| 404 |
+ out.Addresses = make([]EndpointAddress, len(in.Addresses)) |
|
| 405 |
+ for i := range in.Addresses {
|
|
| 406 |
+ if err := deepCopy_v1beta3_EndpointAddress(in.Addresses[i], &out.Addresses[i], c); err != nil {
|
|
| 407 |
+ return err |
|
| 408 |
+ } |
|
| 409 |
+ } |
|
| 410 |
+ } else {
|
|
| 411 |
+ out.Addresses = nil |
|
| 412 |
+ } |
|
| 413 |
+ if in.Ports != nil {
|
|
| 414 |
+ out.Ports = make([]EndpointPort, len(in.Ports)) |
|
| 415 |
+ for i := range in.Ports {
|
|
| 416 |
+ if err := deepCopy_v1beta3_EndpointPort(in.Ports[i], &out.Ports[i], c); err != nil {
|
|
| 417 |
+ return err |
|
| 418 |
+ } |
|
| 419 |
+ } |
|
| 420 |
+ } else {
|
|
| 421 |
+ out.Ports = nil |
|
| 422 |
+ } |
|
| 423 |
+ return nil |
|
| 424 |
+} |
|
| 425 |
+ |
|
| 426 |
+func deepCopy_v1beta3_Endpoints(in Endpoints, out *Endpoints, c *conversion.Cloner) error {
|
|
| 427 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 428 |
+ return err |
|
| 429 |
+ } |
|
| 430 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 431 |
+ return err |
|
| 432 |
+ } |
|
| 433 |
+ if in.Subsets != nil {
|
|
| 434 |
+ out.Subsets = make([]EndpointSubset, len(in.Subsets)) |
|
| 435 |
+ for i := range in.Subsets {
|
|
| 436 |
+ if err := deepCopy_v1beta3_EndpointSubset(in.Subsets[i], &out.Subsets[i], c); err != nil {
|
|
| 437 |
+ return err |
|
| 438 |
+ } |
|
| 439 |
+ } |
|
| 440 |
+ } else {
|
|
| 441 |
+ out.Subsets = nil |
|
| 442 |
+ } |
|
| 443 |
+ return nil |
|
| 444 |
+} |
|
| 445 |
+ |
|
| 446 |
+func deepCopy_v1beta3_EndpointsList(in EndpointsList, out *EndpointsList, c *conversion.Cloner) error {
|
|
| 447 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 448 |
+ return err |
|
| 449 |
+ } |
|
| 450 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 451 |
+ return err |
|
| 452 |
+ } |
|
| 453 |
+ if in.Items != nil {
|
|
| 454 |
+ out.Items = make([]Endpoints, len(in.Items)) |
|
| 455 |
+ for i := range in.Items {
|
|
| 456 |
+ if err := deepCopy_v1beta3_Endpoints(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 457 |
+ return err |
|
| 458 |
+ } |
|
| 459 |
+ } |
|
| 460 |
+ } else {
|
|
| 461 |
+ out.Items = nil |
|
| 462 |
+ } |
|
| 463 |
+ return nil |
|
| 464 |
+} |
|
| 465 |
+ |
|
| 466 |
+func deepCopy_v1beta3_EnvVar(in EnvVar, out *EnvVar, c *conversion.Cloner) error {
|
|
| 467 |
+ out.Name = in.Name |
|
| 468 |
+ out.Value = in.Value |
|
| 469 |
+ if in.ValueFrom != nil {
|
|
| 470 |
+ out.ValueFrom = new(EnvVarSource) |
|
| 471 |
+ if err := deepCopy_v1beta3_EnvVarSource(*in.ValueFrom, out.ValueFrom, c); err != nil {
|
|
| 472 |
+ return err |
|
| 473 |
+ } |
|
| 474 |
+ } else {
|
|
| 475 |
+ out.ValueFrom = nil |
|
| 476 |
+ } |
|
| 477 |
+ return nil |
|
| 478 |
+} |
|
| 479 |
+ |
|
| 480 |
+func deepCopy_v1beta3_EnvVarSource(in EnvVarSource, out *EnvVarSource, c *conversion.Cloner) error {
|
|
| 481 |
+ if in.FieldRef != nil {
|
|
| 482 |
+ out.FieldRef = new(ObjectFieldSelector) |
|
| 483 |
+ if err := deepCopy_v1beta3_ObjectFieldSelector(*in.FieldRef, out.FieldRef, c); err != nil {
|
|
| 484 |
+ return err |
|
| 485 |
+ } |
|
| 486 |
+ } else {
|
|
| 487 |
+ out.FieldRef = nil |
|
| 488 |
+ } |
|
| 489 |
+ return nil |
|
| 490 |
+} |
|
| 491 |
+ |
|
| 492 |
+func deepCopy_v1beta3_Event(in Event, out *Event, c *conversion.Cloner) error {
|
|
| 493 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 494 |
+ return err |
|
| 495 |
+ } |
|
| 496 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 497 |
+ return err |
|
| 498 |
+ } |
|
| 499 |
+ if err := deepCopy_v1beta3_ObjectReference(in.InvolvedObject, &out.InvolvedObject, c); err != nil {
|
|
| 500 |
+ return err |
|
| 501 |
+ } |
|
| 502 |
+ out.Reason = in.Reason |
|
| 503 |
+ out.Message = in.Message |
|
| 504 |
+ if err := deepCopy_v1beta3_EventSource(in.Source, &out.Source, c); err != nil {
|
|
| 505 |
+ return err |
|
| 506 |
+ } |
|
| 507 |
+ if err := deepCopy_util_Time(in.FirstTimestamp, &out.FirstTimestamp, c); err != nil {
|
|
| 508 |
+ return err |
|
| 509 |
+ } |
|
| 510 |
+ if err := deepCopy_util_Time(in.LastTimestamp, &out.LastTimestamp, c); err != nil {
|
|
| 511 |
+ return err |
|
| 512 |
+ } |
|
| 513 |
+ out.Count = in.Count |
|
| 514 |
+ return nil |
|
| 515 |
+} |
|
| 516 |
+ |
|
| 517 |
+func deepCopy_v1beta3_EventList(in EventList, out *EventList, c *conversion.Cloner) error {
|
|
| 518 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 519 |
+ return err |
|
| 520 |
+ } |
|
| 521 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 522 |
+ return err |
|
| 523 |
+ } |
|
| 524 |
+ if in.Items != nil {
|
|
| 525 |
+ out.Items = make([]Event, len(in.Items)) |
|
| 526 |
+ for i := range in.Items {
|
|
| 527 |
+ if err := deepCopy_v1beta3_Event(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 528 |
+ return err |
|
| 529 |
+ } |
|
| 530 |
+ } |
|
| 531 |
+ } else {
|
|
| 532 |
+ out.Items = nil |
|
| 533 |
+ } |
|
| 534 |
+ return nil |
|
| 535 |
+} |
|
| 536 |
+ |
|
| 537 |
+func deepCopy_v1beta3_EventSource(in EventSource, out *EventSource, c *conversion.Cloner) error {
|
|
| 538 |
+ out.Component = in.Component |
|
| 539 |
+ out.Host = in.Host |
|
| 540 |
+ return nil |
|
| 541 |
+} |
|
| 542 |
+ |
|
| 543 |
+func deepCopy_v1beta3_ExecAction(in ExecAction, out *ExecAction, c *conversion.Cloner) error {
|
|
| 544 |
+ if in.Command != nil {
|
|
| 545 |
+ out.Command = make([]string, len(in.Command)) |
|
| 546 |
+ for i := range in.Command {
|
|
| 547 |
+ out.Command[i] = in.Command[i] |
|
| 548 |
+ } |
|
| 549 |
+ } else {
|
|
| 550 |
+ out.Command = nil |
|
| 551 |
+ } |
|
| 552 |
+ return nil |
|
| 553 |
+} |
|
| 554 |
+ |
|
| 555 |
+func deepCopy_v1beta3_GCEPersistentDiskVolumeSource(in GCEPersistentDiskVolumeSource, out *GCEPersistentDiskVolumeSource, c *conversion.Cloner) error {
|
|
| 556 |
+ out.PDName = in.PDName |
|
| 557 |
+ out.FSType = in.FSType |
|
| 558 |
+ out.Partition = in.Partition |
|
| 559 |
+ out.ReadOnly = in.ReadOnly |
|
| 560 |
+ return nil |
|
| 561 |
+} |
|
| 562 |
+ |
|
| 563 |
+func deepCopy_v1beta3_GitRepoVolumeSource(in GitRepoVolumeSource, out *GitRepoVolumeSource, c *conversion.Cloner) error {
|
|
| 564 |
+ out.Repository = in.Repository |
|
| 565 |
+ out.Revision = in.Revision |
|
| 566 |
+ return nil |
|
| 567 |
+} |
|
| 568 |
+ |
|
| 569 |
+func deepCopy_v1beta3_GlusterfsVolumeSource(in GlusterfsVolumeSource, out *GlusterfsVolumeSource, c *conversion.Cloner) error {
|
|
| 570 |
+ out.EndpointsName = in.EndpointsName |
|
| 571 |
+ out.Path = in.Path |
|
| 572 |
+ out.ReadOnly = in.ReadOnly |
|
| 573 |
+ return nil |
|
| 574 |
+} |
|
| 575 |
+ |
|
| 576 |
+func deepCopy_v1beta3_HTTPGetAction(in HTTPGetAction, out *HTTPGetAction, c *conversion.Cloner) error {
|
|
| 577 |
+ out.Path = in.Path |
|
| 578 |
+ if err := deepCopy_util_IntOrString(in.Port, &out.Port, c); err != nil {
|
|
| 579 |
+ return err |
|
| 580 |
+ } |
|
| 581 |
+ out.Host = in.Host |
|
| 582 |
+ out.Scheme = in.Scheme |
|
| 583 |
+ return nil |
|
| 584 |
+} |
|
| 585 |
+ |
|
| 586 |
+func deepCopy_v1beta3_Handler(in Handler, out *Handler, c *conversion.Cloner) error {
|
|
| 587 |
+ if in.Exec != nil {
|
|
| 588 |
+ out.Exec = new(ExecAction) |
|
| 589 |
+ if err := deepCopy_v1beta3_ExecAction(*in.Exec, out.Exec, c); err != nil {
|
|
| 590 |
+ return err |
|
| 591 |
+ } |
|
| 592 |
+ } else {
|
|
| 593 |
+ out.Exec = nil |
|
| 594 |
+ } |
|
| 595 |
+ if in.HTTPGet != nil {
|
|
| 596 |
+ out.HTTPGet = new(HTTPGetAction) |
|
| 597 |
+ if err := deepCopy_v1beta3_HTTPGetAction(*in.HTTPGet, out.HTTPGet, c); err != nil {
|
|
| 598 |
+ return err |
|
| 599 |
+ } |
|
| 600 |
+ } else {
|
|
| 601 |
+ out.HTTPGet = nil |
|
| 602 |
+ } |
|
| 603 |
+ if in.TCPSocket != nil {
|
|
| 604 |
+ out.TCPSocket = new(TCPSocketAction) |
|
| 605 |
+ if err := deepCopy_v1beta3_TCPSocketAction(*in.TCPSocket, out.TCPSocket, c); err != nil {
|
|
| 606 |
+ return err |
|
| 607 |
+ } |
|
| 608 |
+ } else {
|
|
| 609 |
+ out.TCPSocket = nil |
|
| 610 |
+ } |
|
| 611 |
+ return nil |
|
| 612 |
+} |
|
| 613 |
+ |
|
| 614 |
+func deepCopy_v1beta3_HostPathVolumeSource(in HostPathVolumeSource, out *HostPathVolumeSource, c *conversion.Cloner) error {
|
|
| 615 |
+ out.Path = in.Path |
|
| 616 |
+ return nil |
|
| 617 |
+} |
|
| 618 |
+ |
|
| 619 |
+func deepCopy_v1beta3_ISCSIVolumeSource(in ISCSIVolumeSource, out *ISCSIVolumeSource, c *conversion.Cloner) error {
|
|
| 620 |
+ out.TargetPortal = in.TargetPortal |
|
| 621 |
+ out.IQN = in.IQN |
|
| 622 |
+ out.Lun = in.Lun |
|
| 623 |
+ out.FSType = in.FSType |
|
| 624 |
+ out.ReadOnly = in.ReadOnly |
|
| 625 |
+ return nil |
|
| 626 |
+} |
|
| 627 |
+ |
|
| 628 |
+func deepCopy_v1beta3_Lifecycle(in Lifecycle, out *Lifecycle, c *conversion.Cloner) error {
|
|
| 629 |
+ if in.PostStart != nil {
|
|
| 630 |
+ out.PostStart = new(Handler) |
|
| 631 |
+ if err := deepCopy_v1beta3_Handler(*in.PostStart, out.PostStart, c); err != nil {
|
|
| 632 |
+ return err |
|
| 633 |
+ } |
|
| 634 |
+ } else {
|
|
| 635 |
+ out.PostStart = nil |
|
| 636 |
+ } |
|
| 637 |
+ if in.PreStop != nil {
|
|
| 638 |
+ out.PreStop = new(Handler) |
|
| 639 |
+ if err := deepCopy_v1beta3_Handler(*in.PreStop, out.PreStop, c); err != nil {
|
|
| 640 |
+ return err |
|
| 641 |
+ } |
|
| 642 |
+ } else {
|
|
| 643 |
+ out.PreStop = nil |
|
| 644 |
+ } |
|
| 645 |
+ return nil |
|
| 646 |
+} |
|
| 647 |
+ |
|
| 648 |
+func deepCopy_v1beta3_LimitRange(in LimitRange, out *LimitRange, c *conversion.Cloner) error {
|
|
| 649 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 650 |
+ return err |
|
| 651 |
+ } |
|
| 652 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 653 |
+ return err |
|
| 654 |
+ } |
|
| 655 |
+ if err := deepCopy_v1beta3_LimitRangeSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 656 |
+ return err |
|
| 657 |
+ } |
|
| 658 |
+ return nil |
|
| 659 |
+} |
|
| 660 |
+ |
|
| 661 |
+func deepCopy_v1beta3_LimitRangeItem(in LimitRangeItem, out *LimitRangeItem, c *conversion.Cloner) error {
|
|
| 662 |
+ out.Type = in.Type |
|
| 663 |
+ if in.Max != nil {
|
|
| 664 |
+ out.Max = make(ResourceList) |
|
| 665 |
+ for key, val := range in.Max {
|
|
| 666 |
+ newVal := new(resource.Quantity) |
|
| 667 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 668 |
+ return err |
|
| 669 |
+ } |
|
| 670 |
+ out.Max[key] = *newVal |
|
| 671 |
+ } |
|
| 672 |
+ } else {
|
|
| 673 |
+ out.Max = nil |
|
| 674 |
+ } |
|
| 675 |
+ if in.Min != nil {
|
|
| 676 |
+ out.Min = make(ResourceList) |
|
| 677 |
+ for key, val := range in.Min {
|
|
| 678 |
+ newVal := new(resource.Quantity) |
|
| 679 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 680 |
+ return err |
|
| 681 |
+ } |
|
| 682 |
+ out.Min[key] = *newVal |
|
| 683 |
+ } |
|
| 684 |
+ } else {
|
|
| 685 |
+ out.Min = nil |
|
| 686 |
+ } |
|
| 687 |
+ if in.Default != nil {
|
|
| 688 |
+ out.Default = make(ResourceList) |
|
| 689 |
+ for key, val := range in.Default {
|
|
| 690 |
+ newVal := new(resource.Quantity) |
|
| 691 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 692 |
+ return err |
|
| 693 |
+ } |
|
| 694 |
+ out.Default[key] = *newVal |
|
| 695 |
+ } |
|
| 696 |
+ } else {
|
|
| 697 |
+ out.Default = nil |
|
| 698 |
+ } |
|
| 699 |
+ if in.DefaultRequest != nil {
|
|
| 700 |
+ out.DefaultRequest = make(ResourceList) |
|
| 701 |
+ for key, val := range in.DefaultRequest {
|
|
| 702 |
+ newVal := new(resource.Quantity) |
|
| 703 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 704 |
+ return err |
|
| 705 |
+ } |
|
| 706 |
+ out.DefaultRequest[key] = *newVal |
|
| 707 |
+ } |
|
| 708 |
+ } else {
|
|
| 709 |
+ out.DefaultRequest = nil |
|
| 710 |
+ } |
|
| 711 |
+ if in.MaxLimitRequestRatio != nil {
|
|
| 712 |
+ out.MaxLimitRequestRatio = make(ResourceList) |
|
| 713 |
+ for key, val := range in.MaxLimitRequestRatio {
|
|
| 714 |
+ newVal := new(resource.Quantity) |
|
| 715 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 716 |
+ return err |
|
| 717 |
+ } |
|
| 718 |
+ out.MaxLimitRequestRatio[key] = *newVal |
|
| 719 |
+ } |
|
| 720 |
+ } else {
|
|
| 721 |
+ out.MaxLimitRequestRatio = nil |
|
| 722 |
+ } |
|
| 723 |
+ return nil |
|
| 724 |
+} |
|
| 725 |
+ |
|
| 726 |
+func deepCopy_v1beta3_LimitRangeList(in LimitRangeList, out *LimitRangeList, c *conversion.Cloner) error {
|
|
| 727 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 728 |
+ return err |
|
| 729 |
+ } |
|
| 730 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 731 |
+ return err |
|
| 732 |
+ } |
|
| 733 |
+ if in.Items != nil {
|
|
| 734 |
+ out.Items = make([]LimitRange, len(in.Items)) |
|
| 735 |
+ for i := range in.Items {
|
|
| 736 |
+ if err := deepCopy_v1beta3_LimitRange(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 737 |
+ return err |
|
| 738 |
+ } |
|
| 739 |
+ } |
|
| 740 |
+ } else {
|
|
| 741 |
+ out.Items = nil |
|
| 742 |
+ } |
|
| 743 |
+ return nil |
|
| 744 |
+} |
|
| 745 |
+ |
|
| 746 |
+func deepCopy_v1beta3_LimitRangeSpec(in LimitRangeSpec, out *LimitRangeSpec, c *conversion.Cloner) error {
|
|
| 747 |
+ if in.Limits != nil {
|
|
| 748 |
+ out.Limits = make([]LimitRangeItem, len(in.Limits)) |
|
| 749 |
+ for i := range in.Limits {
|
|
| 750 |
+ if err := deepCopy_v1beta3_LimitRangeItem(in.Limits[i], &out.Limits[i], c); err != nil {
|
|
| 751 |
+ return err |
|
| 752 |
+ } |
|
| 753 |
+ } |
|
| 754 |
+ } else {
|
|
| 755 |
+ out.Limits = nil |
|
| 756 |
+ } |
|
| 757 |
+ return nil |
|
| 758 |
+} |
|
| 759 |
+ |
|
| 760 |
+func deepCopy_v1beta3_List(in List, out *List, c *conversion.Cloner) error {
|
|
| 761 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 762 |
+ return err |
|
| 763 |
+ } |
|
| 764 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 765 |
+ return err |
|
| 766 |
+ } |
|
| 767 |
+ if in.Items != nil {
|
|
| 768 |
+ out.Items = make([]runtime.RawExtension, len(in.Items)) |
|
| 769 |
+ for i := range in.Items {
|
|
| 770 |
+ if err := deepCopy_runtime_RawExtension(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 771 |
+ return err |
|
| 772 |
+ } |
|
| 773 |
+ } |
|
| 774 |
+ } else {
|
|
| 775 |
+ out.Items = nil |
|
| 776 |
+ } |
|
| 777 |
+ return nil |
|
| 778 |
+} |
|
| 779 |
+ |
|
| 780 |
+func deepCopy_v1beta3_ListMeta(in ListMeta, out *ListMeta, c *conversion.Cloner) error {
|
|
| 781 |
+ out.SelfLink = in.SelfLink |
|
| 782 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 783 |
+ return nil |
|
| 784 |
+} |
|
| 785 |
+ |
|
| 786 |
+func deepCopy_v1beta3_ListOptions(in ListOptions, out *ListOptions, c *conversion.Cloner) error {
|
|
| 787 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 788 |
+ return err |
|
| 789 |
+ } |
|
| 790 |
+ out.LabelSelector = in.LabelSelector |
|
| 791 |
+ out.FieldSelector = in.FieldSelector |
|
| 792 |
+ out.Watch = in.Watch |
|
| 793 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 794 |
+ return nil |
|
| 795 |
+} |
|
| 796 |
+ |
|
| 797 |
+func deepCopy_v1beta3_LoadBalancerIngress(in LoadBalancerIngress, out *LoadBalancerIngress, c *conversion.Cloner) error {
|
|
| 798 |
+ out.IP = in.IP |
|
| 799 |
+ out.Hostname = in.Hostname |
|
| 800 |
+ return nil |
|
| 801 |
+} |
|
| 802 |
+ |
|
| 803 |
+func deepCopy_v1beta3_LoadBalancerStatus(in LoadBalancerStatus, out *LoadBalancerStatus, c *conversion.Cloner) error {
|
|
| 804 |
+ if in.Ingress != nil {
|
|
| 805 |
+ out.Ingress = make([]LoadBalancerIngress, len(in.Ingress)) |
|
| 806 |
+ for i := range in.Ingress {
|
|
| 807 |
+ if err := deepCopy_v1beta3_LoadBalancerIngress(in.Ingress[i], &out.Ingress[i], c); err != nil {
|
|
| 808 |
+ return err |
|
| 809 |
+ } |
|
| 810 |
+ } |
|
| 811 |
+ } else {
|
|
| 812 |
+ out.Ingress = nil |
|
| 813 |
+ } |
|
| 814 |
+ return nil |
|
| 815 |
+} |
|
| 816 |
+ |
|
| 817 |
+func deepCopy_v1beta3_LocalObjectReference(in LocalObjectReference, out *LocalObjectReference, c *conversion.Cloner) error {
|
|
| 818 |
+ out.Name = in.Name |
|
| 819 |
+ return nil |
|
| 820 |
+} |
|
| 821 |
+ |
|
| 822 |
+func deepCopy_v1beta3_MetadataFile(in MetadataFile, out *MetadataFile, c *conversion.Cloner) error {
|
|
| 823 |
+ out.Name = in.Name |
|
| 824 |
+ if err := deepCopy_v1beta3_ObjectFieldSelector(in.FieldRef, &out.FieldRef, c); err != nil {
|
|
| 825 |
+ return err |
|
| 826 |
+ } |
|
| 827 |
+ return nil |
|
| 828 |
+} |
|
| 829 |
+ |
|
| 830 |
+func deepCopy_v1beta3_MetadataVolumeSource(in MetadataVolumeSource, out *MetadataVolumeSource, c *conversion.Cloner) error {
|
|
| 831 |
+ if in.Items != nil {
|
|
| 832 |
+ out.Items = make([]MetadataFile, len(in.Items)) |
|
| 833 |
+ for i := range in.Items {
|
|
| 834 |
+ if err := deepCopy_v1beta3_MetadataFile(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 835 |
+ return err |
|
| 836 |
+ } |
|
| 837 |
+ } |
|
| 838 |
+ } else {
|
|
| 839 |
+ out.Items = nil |
|
| 840 |
+ } |
|
| 841 |
+ return nil |
|
| 842 |
+} |
|
| 843 |
+ |
|
| 844 |
+func deepCopy_v1beta3_NFSVolumeSource(in NFSVolumeSource, out *NFSVolumeSource, c *conversion.Cloner) error {
|
|
| 845 |
+ out.Server = in.Server |
|
| 846 |
+ out.Path = in.Path |
|
| 847 |
+ out.ReadOnly = in.ReadOnly |
|
| 848 |
+ return nil |
|
| 849 |
+} |
|
| 850 |
+ |
|
| 851 |
+func deepCopy_v1beta3_Namespace(in Namespace, out *Namespace, c *conversion.Cloner) error {
|
|
| 852 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 853 |
+ return err |
|
| 854 |
+ } |
|
| 855 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 856 |
+ return err |
|
| 857 |
+ } |
|
| 858 |
+ if err := deepCopy_v1beta3_NamespaceSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 859 |
+ return err |
|
| 860 |
+ } |
|
| 861 |
+ if err := deepCopy_v1beta3_NamespaceStatus(in.Status, &out.Status, c); err != nil {
|
|
| 862 |
+ return err |
|
| 863 |
+ } |
|
| 864 |
+ return nil |
|
| 865 |
+} |
|
| 866 |
+ |
|
| 867 |
+func deepCopy_v1beta3_NamespaceList(in NamespaceList, out *NamespaceList, c *conversion.Cloner) error {
|
|
| 868 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 869 |
+ return err |
|
| 870 |
+ } |
|
| 871 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 872 |
+ return err |
|
| 873 |
+ } |
|
| 874 |
+ if in.Items != nil {
|
|
| 875 |
+ out.Items = make([]Namespace, len(in.Items)) |
|
| 876 |
+ for i := range in.Items {
|
|
| 877 |
+ if err := deepCopy_v1beta3_Namespace(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 878 |
+ return err |
|
| 879 |
+ } |
|
| 880 |
+ } |
|
| 881 |
+ } else {
|
|
| 882 |
+ out.Items = nil |
|
| 883 |
+ } |
|
| 884 |
+ return nil |
|
| 885 |
+} |
|
| 886 |
+ |
|
| 887 |
+func deepCopy_v1beta3_NamespaceSpec(in NamespaceSpec, out *NamespaceSpec, c *conversion.Cloner) error {
|
|
| 888 |
+ if in.Finalizers != nil {
|
|
| 889 |
+ out.Finalizers = make([]FinalizerName, len(in.Finalizers)) |
|
| 890 |
+ for i := range in.Finalizers {
|
|
| 891 |
+ out.Finalizers[i] = in.Finalizers[i] |
|
| 892 |
+ } |
|
| 893 |
+ } else {
|
|
| 894 |
+ out.Finalizers = nil |
|
| 895 |
+ } |
|
| 896 |
+ return nil |
|
| 897 |
+} |
|
| 898 |
+ |
|
| 899 |
+func deepCopy_v1beta3_NamespaceStatus(in NamespaceStatus, out *NamespaceStatus, c *conversion.Cloner) error {
|
|
| 900 |
+ out.Phase = in.Phase |
|
| 901 |
+ return nil |
|
| 902 |
+} |
|
| 903 |
+ |
|
| 904 |
+func deepCopy_v1beta3_Node(in Node, out *Node, c *conversion.Cloner) error {
|
|
| 905 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 906 |
+ return err |
|
| 907 |
+ } |
|
| 908 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 909 |
+ return err |
|
| 910 |
+ } |
|
| 911 |
+ if err := deepCopy_v1beta3_NodeSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 912 |
+ return err |
|
| 913 |
+ } |
|
| 914 |
+ if err := deepCopy_v1beta3_NodeStatus(in.Status, &out.Status, c); err != nil {
|
|
| 915 |
+ return err |
|
| 916 |
+ } |
|
| 917 |
+ return nil |
|
| 918 |
+} |
|
| 919 |
+ |
|
| 920 |
+func deepCopy_v1beta3_NodeAddress(in NodeAddress, out *NodeAddress, c *conversion.Cloner) error {
|
|
| 921 |
+ out.Type = in.Type |
|
| 922 |
+ out.Address = in.Address |
|
| 923 |
+ return nil |
|
| 924 |
+} |
|
| 925 |
+ |
|
| 926 |
+func deepCopy_v1beta3_NodeCondition(in NodeCondition, out *NodeCondition, c *conversion.Cloner) error {
|
|
| 927 |
+ out.Type = in.Type |
|
| 928 |
+ out.Status = in.Status |
|
| 929 |
+ if err := deepCopy_util_Time(in.LastHeartbeatTime, &out.LastHeartbeatTime, c); err != nil {
|
|
| 930 |
+ return err |
|
| 931 |
+ } |
|
| 932 |
+ if err := deepCopy_util_Time(in.LastTransitionTime, &out.LastTransitionTime, c); err != nil {
|
|
| 933 |
+ return err |
|
| 934 |
+ } |
|
| 935 |
+ out.Reason = in.Reason |
|
| 936 |
+ out.Message = in.Message |
|
| 937 |
+ return nil |
|
| 938 |
+} |
|
| 939 |
+ |
|
| 940 |
+func deepCopy_v1beta3_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) error {
|
|
| 941 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 942 |
+ return err |
|
| 943 |
+ } |
|
| 944 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 945 |
+ return err |
|
| 946 |
+ } |
|
| 947 |
+ if in.Items != nil {
|
|
| 948 |
+ out.Items = make([]Node, len(in.Items)) |
|
| 949 |
+ for i := range in.Items {
|
|
| 950 |
+ if err := deepCopy_v1beta3_Node(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 951 |
+ return err |
|
| 952 |
+ } |
|
| 953 |
+ } |
|
| 954 |
+ } else {
|
|
| 955 |
+ out.Items = nil |
|
| 956 |
+ } |
|
| 957 |
+ return nil |
|
| 958 |
+} |
|
| 959 |
+ |
|
| 960 |
+func deepCopy_v1beta3_NodeSpec(in NodeSpec, out *NodeSpec, c *conversion.Cloner) error {
|
|
| 961 |
+ out.PodCIDR = in.PodCIDR |
|
| 962 |
+ out.ExternalID = in.ExternalID |
|
| 963 |
+ out.ProviderID = in.ProviderID |
|
| 964 |
+ out.Unschedulable = in.Unschedulable |
|
| 965 |
+ return nil |
|
| 966 |
+} |
|
| 967 |
+ |
|
| 968 |
+func deepCopy_v1beta3_NodeStatus(in NodeStatus, out *NodeStatus, c *conversion.Cloner) error {
|
|
| 969 |
+ if in.Capacity != nil {
|
|
| 970 |
+ out.Capacity = make(ResourceList) |
|
| 971 |
+ for key, val := range in.Capacity {
|
|
| 972 |
+ newVal := new(resource.Quantity) |
|
| 973 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 974 |
+ return err |
|
| 975 |
+ } |
|
| 976 |
+ out.Capacity[key] = *newVal |
|
| 977 |
+ } |
|
| 978 |
+ } else {
|
|
| 979 |
+ out.Capacity = nil |
|
| 980 |
+ } |
|
| 981 |
+ out.Phase = in.Phase |
|
| 982 |
+ if in.Conditions != nil {
|
|
| 983 |
+ out.Conditions = make([]NodeCondition, len(in.Conditions)) |
|
| 984 |
+ for i := range in.Conditions {
|
|
| 985 |
+ if err := deepCopy_v1beta3_NodeCondition(in.Conditions[i], &out.Conditions[i], c); err != nil {
|
|
| 986 |
+ return err |
|
| 987 |
+ } |
|
| 988 |
+ } |
|
| 989 |
+ } else {
|
|
| 990 |
+ out.Conditions = nil |
|
| 991 |
+ } |
|
| 992 |
+ if in.Addresses != nil {
|
|
| 993 |
+ out.Addresses = make([]NodeAddress, len(in.Addresses)) |
|
| 994 |
+ for i := range in.Addresses {
|
|
| 995 |
+ if err := deepCopy_v1beta3_NodeAddress(in.Addresses[i], &out.Addresses[i], c); err != nil {
|
|
| 996 |
+ return err |
|
| 997 |
+ } |
|
| 998 |
+ } |
|
| 999 |
+ } else {
|
|
| 1000 |
+ out.Addresses = nil |
|
| 1001 |
+ } |
|
| 1002 |
+ if err := deepCopy_v1beta3_NodeSystemInfo(in.NodeInfo, &out.NodeInfo, c); err != nil {
|
|
| 1003 |
+ return err |
|
| 1004 |
+ } |
|
| 1005 |
+ return nil |
|
| 1006 |
+} |
|
| 1007 |
+ |
|
| 1008 |
+func deepCopy_v1beta3_NodeSystemInfo(in NodeSystemInfo, out *NodeSystemInfo, c *conversion.Cloner) error {
|
|
| 1009 |
+ out.MachineID = in.MachineID |
|
| 1010 |
+ out.SystemUUID = in.SystemUUID |
|
| 1011 |
+ out.BootID = in.BootID |
|
| 1012 |
+ out.KernelVersion = in.KernelVersion |
|
| 1013 |
+ out.OsImage = in.OsImage |
|
| 1014 |
+ out.ContainerRuntimeVersion = in.ContainerRuntimeVersion |
|
| 1015 |
+ out.KubeletVersion = in.KubeletVersion |
|
| 1016 |
+ out.KubeProxyVersion = in.KubeProxyVersion |
|
| 1017 |
+ return nil |
|
| 1018 |
+} |
|
| 1019 |
+ |
|
| 1020 |
+func deepCopy_v1beta3_ObjectFieldSelector(in ObjectFieldSelector, out *ObjectFieldSelector, c *conversion.Cloner) error {
|
|
| 1021 |
+ out.APIVersion = in.APIVersion |
|
| 1022 |
+ out.FieldPath = in.FieldPath |
|
| 1023 |
+ return nil |
|
| 1024 |
+} |
|
| 1025 |
+ |
|
| 1026 |
+func deepCopy_v1beta3_ObjectMeta(in ObjectMeta, out *ObjectMeta, c *conversion.Cloner) error {
|
|
| 1027 |
+ out.Name = in.Name |
|
| 1028 |
+ out.GenerateName = in.GenerateName |
|
| 1029 |
+ out.Namespace = in.Namespace |
|
| 1030 |
+ out.SelfLink = in.SelfLink |
|
| 1031 |
+ out.UID = in.UID |
|
| 1032 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 1033 |
+ out.Generation = in.Generation |
|
| 1034 |
+ if err := deepCopy_util_Time(in.CreationTimestamp, &out.CreationTimestamp, c); err != nil {
|
|
| 1035 |
+ return err |
|
| 1036 |
+ } |
|
| 1037 |
+ if in.DeletionTimestamp != nil {
|
|
| 1038 |
+ out.DeletionTimestamp = new(util.Time) |
|
| 1039 |
+ if err := deepCopy_util_Time(*in.DeletionTimestamp, out.DeletionTimestamp, c); err != nil {
|
|
| 1040 |
+ return err |
|
| 1041 |
+ } |
|
| 1042 |
+ } else {
|
|
| 1043 |
+ out.DeletionTimestamp = nil |
|
| 1044 |
+ } |
|
| 1045 |
+ if in.DeletionGracePeriodSeconds != nil {
|
|
| 1046 |
+ out.DeletionGracePeriodSeconds = new(int64) |
|
| 1047 |
+ *out.DeletionGracePeriodSeconds = *in.DeletionGracePeriodSeconds |
|
| 1048 |
+ } else {
|
|
| 1049 |
+ out.DeletionGracePeriodSeconds = nil |
|
| 1050 |
+ } |
|
| 1051 |
+ if in.Labels != nil {
|
|
| 1052 |
+ out.Labels = make(map[string]string) |
|
| 1053 |
+ for key, val := range in.Labels {
|
|
| 1054 |
+ out.Labels[key] = val |
|
| 1055 |
+ } |
|
| 1056 |
+ } else {
|
|
| 1057 |
+ out.Labels = nil |
|
| 1058 |
+ } |
|
| 1059 |
+ if in.Annotations != nil {
|
|
| 1060 |
+ out.Annotations = make(map[string]string) |
|
| 1061 |
+ for key, val := range in.Annotations {
|
|
| 1062 |
+ out.Annotations[key] = val |
|
| 1063 |
+ } |
|
| 1064 |
+ } else {
|
|
| 1065 |
+ out.Annotations = nil |
|
| 1066 |
+ } |
|
| 1067 |
+ return nil |
|
| 1068 |
+} |
|
| 1069 |
+ |
|
| 1070 |
+func deepCopy_v1beta3_ObjectReference(in ObjectReference, out *ObjectReference, c *conversion.Cloner) error {
|
|
| 1071 |
+ out.Kind = in.Kind |
|
| 1072 |
+ out.Namespace = in.Namespace |
|
| 1073 |
+ out.Name = in.Name |
|
| 1074 |
+ out.UID = in.UID |
|
| 1075 |
+ out.APIVersion = in.APIVersion |
|
| 1076 |
+ out.ResourceVersion = in.ResourceVersion |
|
| 1077 |
+ out.FieldPath = in.FieldPath |
|
| 1078 |
+ return nil |
|
| 1079 |
+} |
|
| 1080 |
+ |
|
| 1081 |
+func deepCopy_v1beta3_PersistentVolume(in PersistentVolume, out *PersistentVolume, c *conversion.Cloner) error {
|
|
| 1082 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1083 |
+ return err |
|
| 1084 |
+ } |
|
| 1085 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1086 |
+ return err |
|
| 1087 |
+ } |
|
| 1088 |
+ if err := deepCopy_v1beta3_PersistentVolumeSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1089 |
+ return err |
|
| 1090 |
+ } |
|
| 1091 |
+ if err := deepCopy_v1beta3_PersistentVolumeStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1092 |
+ return err |
|
| 1093 |
+ } |
|
| 1094 |
+ return nil |
|
| 1095 |
+} |
|
| 1096 |
+ |
|
| 1097 |
+func deepCopy_v1beta3_PersistentVolumeClaim(in PersistentVolumeClaim, out *PersistentVolumeClaim, c *conversion.Cloner) error {
|
|
| 1098 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1099 |
+ return err |
|
| 1100 |
+ } |
|
| 1101 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1102 |
+ return err |
|
| 1103 |
+ } |
|
| 1104 |
+ if err := deepCopy_v1beta3_PersistentVolumeClaimSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1105 |
+ return err |
|
| 1106 |
+ } |
|
| 1107 |
+ if err := deepCopy_v1beta3_PersistentVolumeClaimStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1108 |
+ return err |
|
| 1109 |
+ } |
|
| 1110 |
+ return nil |
|
| 1111 |
+} |
|
| 1112 |
+ |
|
| 1113 |
+func deepCopy_v1beta3_PersistentVolumeClaimList(in PersistentVolumeClaimList, out *PersistentVolumeClaimList, c *conversion.Cloner) error {
|
|
| 1114 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1115 |
+ return err |
|
| 1116 |
+ } |
|
| 1117 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1118 |
+ return err |
|
| 1119 |
+ } |
|
| 1120 |
+ if in.Items != nil {
|
|
| 1121 |
+ out.Items = make([]PersistentVolumeClaim, len(in.Items)) |
|
| 1122 |
+ for i := range in.Items {
|
|
| 1123 |
+ if err := deepCopy_v1beta3_PersistentVolumeClaim(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1124 |
+ return err |
|
| 1125 |
+ } |
|
| 1126 |
+ } |
|
| 1127 |
+ } else {
|
|
| 1128 |
+ out.Items = nil |
|
| 1129 |
+ } |
|
| 1130 |
+ return nil |
|
| 1131 |
+} |
|
| 1132 |
+ |
|
| 1133 |
+func deepCopy_v1beta3_PersistentVolumeClaimSpec(in PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, c *conversion.Cloner) error {
|
|
| 1134 |
+ if in.AccessModes != nil {
|
|
| 1135 |
+ out.AccessModes = make([]PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 1136 |
+ for i := range in.AccessModes {
|
|
| 1137 |
+ out.AccessModes[i] = in.AccessModes[i] |
|
| 1138 |
+ } |
|
| 1139 |
+ } else {
|
|
| 1140 |
+ out.AccessModes = nil |
|
| 1141 |
+ } |
|
| 1142 |
+ if err := deepCopy_v1beta3_ResourceRequirements(in.Resources, &out.Resources, c); err != nil {
|
|
| 1143 |
+ return err |
|
| 1144 |
+ } |
|
| 1145 |
+ out.VolumeName = in.VolumeName |
|
| 1146 |
+ return nil |
|
| 1147 |
+} |
|
| 1148 |
+ |
|
| 1149 |
+func deepCopy_v1beta3_PersistentVolumeClaimStatus(in PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, c *conversion.Cloner) error {
|
|
| 1150 |
+ out.Phase = in.Phase |
|
| 1151 |
+ if in.AccessModes != nil {
|
|
| 1152 |
+ out.AccessModes = make([]PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 1153 |
+ for i := range in.AccessModes {
|
|
| 1154 |
+ out.AccessModes[i] = in.AccessModes[i] |
|
| 1155 |
+ } |
|
| 1156 |
+ } else {
|
|
| 1157 |
+ out.AccessModes = nil |
|
| 1158 |
+ } |
|
| 1159 |
+ if in.Capacity != nil {
|
|
| 1160 |
+ out.Capacity = make(ResourceList) |
|
| 1161 |
+ for key, val := range in.Capacity {
|
|
| 1162 |
+ newVal := new(resource.Quantity) |
|
| 1163 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1164 |
+ return err |
|
| 1165 |
+ } |
|
| 1166 |
+ out.Capacity[key] = *newVal |
|
| 1167 |
+ } |
|
| 1168 |
+ } else {
|
|
| 1169 |
+ out.Capacity = nil |
|
| 1170 |
+ } |
|
| 1171 |
+ return nil |
|
| 1172 |
+} |
|
| 1173 |
+ |
|
| 1174 |
+func deepCopy_v1beta3_PersistentVolumeClaimVolumeSource(in PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, c *conversion.Cloner) error {
|
|
| 1175 |
+ out.ClaimName = in.ClaimName |
|
| 1176 |
+ out.ReadOnly = in.ReadOnly |
|
| 1177 |
+ return nil |
|
| 1178 |
+} |
|
| 1179 |
+ |
|
| 1180 |
+func deepCopy_v1beta3_PersistentVolumeList(in PersistentVolumeList, out *PersistentVolumeList, c *conversion.Cloner) error {
|
|
| 1181 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1182 |
+ return err |
|
| 1183 |
+ } |
|
| 1184 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1185 |
+ return err |
|
| 1186 |
+ } |
|
| 1187 |
+ if in.Items != nil {
|
|
| 1188 |
+ out.Items = make([]PersistentVolume, len(in.Items)) |
|
| 1189 |
+ for i := range in.Items {
|
|
| 1190 |
+ if err := deepCopy_v1beta3_PersistentVolume(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1191 |
+ return err |
|
| 1192 |
+ } |
|
| 1193 |
+ } |
|
| 1194 |
+ } else {
|
|
| 1195 |
+ out.Items = nil |
|
| 1196 |
+ } |
|
| 1197 |
+ return nil |
|
| 1198 |
+} |
|
| 1199 |
+ |
|
| 1200 |
+func deepCopy_v1beta3_PersistentVolumeSource(in PersistentVolumeSource, out *PersistentVolumeSource, c *conversion.Cloner) error {
|
|
| 1201 |
+ if in.GCEPersistentDisk != nil {
|
|
| 1202 |
+ out.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) |
|
| 1203 |
+ if err := deepCopy_v1beta3_GCEPersistentDiskVolumeSource(*in.GCEPersistentDisk, out.GCEPersistentDisk, c); err != nil {
|
|
| 1204 |
+ return err |
|
| 1205 |
+ } |
|
| 1206 |
+ } else {
|
|
| 1207 |
+ out.GCEPersistentDisk = nil |
|
| 1208 |
+ } |
|
| 1209 |
+ if in.AWSElasticBlockStore != nil {
|
|
| 1210 |
+ out.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) |
|
| 1211 |
+ if err := deepCopy_v1beta3_AWSElasticBlockStoreVolumeSource(*in.AWSElasticBlockStore, out.AWSElasticBlockStore, c); err != nil {
|
|
| 1212 |
+ return err |
|
| 1213 |
+ } |
|
| 1214 |
+ } else {
|
|
| 1215 |
+ out.AWSElasticBlockStore = nil |
|
| 1216 |
+ } |
|
| 1217 |
+ if in.HostPath != nil {
|
|
| 1218 |
+ out.HostPath = new(HostPathVolumeSource) |
|
| 1219 |
+ if err := deepCopy_v1beta3_HostPathVolumeSource(*in.HostPath, out.HostPath, c); err != nil {
|
|
| 1220 |
+ return err |
|
| 1221 |
+ } |
|
| 1222 |
+ } else {
|
|
| 1223 |
+ out.HostPath = nil |
|
| 1224 |
+ } |
|
| 1225 |
+ if in.Glusterfs != nil {
|
|
| 1226 |
+ out.Glusterfs = new(GlusterfsVolumeSource) |
|
| 1227 |
+ if err := deepCopy_v1beta3_GlusterfsVolumeSource(*in.Glusterfs, out.Glusterfs, c); err != nil {
|
|
| 1228 |
+ return err |
|
| 1229 |
+ } |
|
| 1230 |
+ } else {
|
|
| 1231 |
+ out.Glusterfs = nil |
|
| 1232 |
+ } |
|
| 1233 |
+ if in.NFS != nil {
|
|
| 1234 |
+ out.NFS = new(NFSVolumeSource) |
|
| 1235 |
+ if err := deepCopy_v1beta3_NFSVolumeSource(*in.NFS, out.NFS, c); err != nil {
|
|
| 1236 |
+ return err |
|
| 1237 |
+ } |
|
| 1238 |
+ } else {
|
|
| 1239 |
+ out.NFS = nil |
|
| 1240 |
+ } |
|
| 1241 |
+ if in.RBD != nil {
|
|
| 1242 |
+ out.RBD = new(RBDVolumeSource) |
|
| 1243 |
+ if err := deepCopy_v1beta3_RBDVolumeSource(*in.RBD, out.RBD, c); err != nil {
|
|
| 1244 |
+ return err |
|
| 1245 |
+ } |
|
| 1246 |
+ } else {
|
|
| 1247 |
+ out.RBD = nil |
|
| 1248 |
+ } |
|
| 1249 |
+ if in.ISCSI != nil {
|
|
| 1250 |
+ out.ISCSI = new(ISCSIVolumeSource) |
|
| 1251 |
+ if err := deepCopy_v1beta3_ISCSIVolumeSource(*in.ISCSI, out.ISCSI, c); err != nil {
|
|
| 1252 |
+ return err |
|
| 1253 |
+ } |
|
| 1254 |
+ } else {
|
|
| 1255 |
+ out.ISCSI = nil |
|
| 1256 |
+ } |
|
| 1257 |
+ if in.CephFS != nil {
|
|
| 1258 |
+ out.CephFS = new(CephFSVolumeSource) |
|
| 1259 |
+ if err := deepCopy_v1beta3_CephFSVolumeSource(*in.CephFS, out.CephFS, c); err != nil {
|
|
| 1260 |
+ return err |
|
| 1261 |
+ } |
|
| 1262 |
+ } else {
|
|
| 1263 |
+ out.CephFS = nil |
|
| 1264 |
+ } |
|
| 1265 |
+ if in.Cinder != nil {
|
|
| 1266 |
+ out.Cinder = new(CinderVolumeSource) |
|
| 1267 |
+ if err := deepCopy_v1beta3_CinderVolumeSource(*in.Cinder, out.Cinder, c); err != nil {
|
|
| 1268 |
+ return err |
|
| 1269 |
+ } |
|
| 1270 |
+ } else {
|
|
| 1271 |
+ out.Cinder = nil |
|
| 1272 |
+ } |
|
| 1273 |
+ return nil |
|
| 1274 |
+} |
|
| 1275 |
+ |
|
| 1276 |
+func deepCopy_v1beta3_PersistentVolumeSpec(in PersistentVolumeSpec, out *PersistentVolumeSpec, c *conversion.Cloner) error {
|
|
| 1277 |
+ if in.Capacity != nil {
|
|
| 1278 |
+ out.Capacity = make(ResourceList) |
|
| 1279 |
+ for key, val := range in.Capacity {
|
|
| 1280 |
+ newVal := new(resource.Quantity) |
|
| 1281 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1282 |
+ return err |
|
| 1283 |
+ } |
|
| 1284 |
+ out.Capacity[key] = *newVal |
|
| 1285 |
+ } |
|
| 1286 |
+ } else {
|
|
| 1287 |
+ out.Capacity = nil |
|
| 1288 |
+ } |
|
| 1289 |
+ if err := deepCopy_v1beta3_PersistentVolumeSource(in.PersistentVolumeSource, &out.PersistentVolumeSource, c); err != nil {
|
|
| 1290 |
+ return err |
|
| 1291 |
+ } |
|
| 1292 |
+ if in.AccessModes != nil {
|
|
| 1293 |
+ out.AccessModes = make([]PersistentVolumeAccessMode, len(in.AccessModes)) |
|
| 1294 |
+ for i := range in.AccessModes {
|
|
| 1295 |
+ out.AccessModes[i] = in.AccessModes[i] |
|
| 1296 |
+ } |
|
| 1297 |
+ } else {
|
|
| 1298 |
+ out.AccessModes = nil |
|
| 1299 |
+ } |
|
| 1300 |
+ if in.ClaimRef != nil {
|
|
| 1301 |
+ out.ClaimRef = new(ObjectReference) |
|
| 1302 |
+ if err := deepCopy_v1beta3_ObjectReference(*in.ClaimRef, out.ClaimRef, c); err != nil {
|
|
| 1303 |
+ return err |
|
| 1304 |
+ } |
|
| 1305 |
+ } else {
|
|
| 1306 |
+ out.ClaimRef = nil |
|
| 1307 |
+ } |
|
| 1308 |
+ out.PersistentVolumeReclaimPolicy = in.PersistentVolumeReclaimPolicy |
|
| 1309 |
+ return nil |
|
| 1310 |
+} |
|
| 1311 |
+ |
|
| 1312 |
+func deepCopy_v1beta3_PersistentVolumeStatus(in PersistentVolumeStatus, out *PersistentVolumeStatus, c *conversion.Cloner) error {
|
|
| 1313 |
+ out.Phase = in.Phase |
|
| 1314 |
+ out.Message = in.Message |
|
| 1315 |
+ out.Reason = in.Reason |
|
| 1316 |
+ return nil |
|
| 1317 |
+} |
|
| 1318 |
+ |
|
| 1319 |
+func deepCopy_v1beta3_Pod(in Pod, out *Pod, c *conversion.Cloner) error {
|
|
| 1320 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1321 |
+ return err |
|
| 1322 |
+ } |
|
| 1323 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1324 |
+ return err |
|
| 1325 |
+ } |
|
| 1326 |
+ if err := deepCopy_v1beta3_PodSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1327 |
+ return err |
|
| 1328 |
+ } |
|
| 1329 |
+ if err := deepCopy_v1beta3_PodStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1330 |
+ return err |
|
| 1331 |
+ } |
|
| 1332 |
+ return nil |
|
| 1333 |
+} |
|
| 1334 |
+ |
|
| 1335 |
+func deepCopy_v1beta3_PodCondition(in PodCondition, out *PodCondition, c *conversion.Cloner) error {
|
|
| 1336 |
+ out.Type = in.Type |
|
| 1337 |
+ out.Status = in.Status |
|
| 1338 |
+ return nil |
|
| 1339 |
+} |
|
| 1340 |
+ |
|
| 1341 |
+func deepCopy_v1beta3_PodExecOptions(in PodExecOptions, out *PodExecOptions, c *conversion.Cloner) error {
|
|
| 1342 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1343 |
+ return err |
|
| 1344 |
+ } |
|
| 1345 |
+ out.Stdin = in.Stdin |
|
| 1346 |
+ out.Stdout = in.Stdout |
|
| 1347 |
+ out.Stderr = in.Stderr |
|
| 1348 |
+ out.TTY = in.TTY |
|
| 1349 |
+ out.Container = in.Container |
|
| 1350 |
+ if in.Command != nil {
|
|
| 1351 |
+ out.Command = make([]string, len(in.Command)) |
|
| 1352 |
+ for i := range in.Command {
|
|
| 1353 |
+ out.Command[i] = in.Command[i] |
|
| 1354 |
+ } |
|
| 1355 |
+ } else {
|
|
| 1356 |
+ out.Command = nil |
|
| 1357 |
+ } |
|
| 1358 |
+ return nil |
|
| 1359 |
+} |
|
| 1360 |
+ |
|
| 1361 |
+func deepCopy_v1beta3_PodList(in PodList, out *PodList, c *conversion.Cloner) error {
|
|
| 1362 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1363 |
+ return err |
|
| 1364 |
+ } |
|
| 1365 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1366 |
+ return err |
|
| 1367 |
+ } |
|
| 1368 |
+ if in.Items != nil {
|
|
| 1369 |
+ out.Items = make([]Pod, len(in.Items)) |
|
| 1370 |
+ for i := range in.Items {
|
|
| 1371 |
+ if err := deepCopy_v1beta3_Pod(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1372 |
+ return err |
|
| 1373 |
+ } |
|
| 1374 |
+ } |
|
| 1375 |
+ } else {
|
|
| 1376 |
+ out.Items = nil |
|
| 1377 |
+ } |
|
| 1378 |
+ return nil |
|
| 1379 |
+} |
|
| 1380 |
+ |
|
| 1381 |
+func deepCopy_v1beta3_PodLogOptions(in PodLogOptions, out *PodLogOptions, c *conversion.Cloner) error {
|
|
| 1382 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1383 |
+ return err |
|
| 1384 |
+ } |
|
| 1385 |
+ out.Container = in.Container |
|
| 1386 |
+ out.Follow = in.Follow |
|
| 1387 |
+ out.Previous = in.Previous |
|
| 1388 |
+ return nil |
|
| 1389 |
+} |
|
| 1390 |
+ |
|
| 1391 |
+func deepCopy_v1beta3_PodProxyOptions(in PodProxyOptions, out *PodProxyOptions, c *conversion.Cloner) error {
|
|
| 1392 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1393 |
+ return err |
|
| 1394 |
+ } |
|
| 1395 |
+ out.Path = in.Path |
|
| 1396 |
+ return nil |
|
| 1397 |
+} |
|
| 1398 |
+ |
|
| 1399 |
+func deepCopy_v1beta3_PodSpec(in PodSpec, out *PodSpec, c *conversion.Cloner) error {
|
|
| 1400 |
+ if in.Volumes != nil {
|
|
| 1401 |
+ out.Volumes = make([]Volume, len(in.Volumes)) |
|
| 1402 |
+ for i := range in.Volumes {
|
|
| 1403 |
+ if err := deepCopy_v1beta3_Volume(in.Volumes[i], &out.Volumes[i], c); err != nil {
|
|
| 1404 |
+ return err |
|
| 1405 |
+ } |
|
| 1406 |
+ } |
|
| 1407 |
+ } else {
|
|
| 1408 |
+ out.Volumes = nil |
|
| 1409 |
+ } |
|
| 1410 |
+ if in.Containers != nil {
|
|
| 1411 |
+ out.Containers = make([]Container, len(in.Containers)) |
|
| 1412 |
+ for i := range in.Containers {
|
|
| 1413 |
+ if err := deepCopy_v1beta3_Container(in.Containers[i], &out.Containers[i], c); err != nil {
|
|
| 1414 |
+ return err |
|
| 1415 |
+ } |
|
| 1416 |
+ } |
|
| 1417 |
+ } else {
|
|
| 1418 |
+ out.Containers = nil |
|
| 1419 |
+ } |
|
| 1420 |
+ out.RestartPolicy = in.RestartPolicy |
|
| 1421 |
+ if in.TerminationGracePeriodSeconds != nil {
|
|
| 1422 |
+ out.TerminationGracePeriodSeconds = new(int64) |
|
| 1423 |
+ *out.TerminationGracePeriodSeconds = *in.TerminationGracePeriodSeconds |
|
| 1424 |
+ } else {
|
|
| 1425 |
+ out.TerminationGracePeriodSeconds = nil |
|
| 1426 |
+ } |
|
| 1427 |
+ if in.ActiveDeadlineSeconds != nil {
|
|
| 1428 |
+ out.ActiveDeadlineSeconds = new(int64) |
|
| 1429 |
+ *out.ActiveDeadlineSeconds = *in.ActiveDeadlineSeconds |
|
| 1430 |
+ } else {
|
|
| 1431 |
+ out.ActiveDeadlineSeconds = nil |
|
| 1432 |
+ } |
|
| 1433 |
+ out.DNSPolicy = in.DNSPolicy |
|
| 1434 |
+ if in.NodeSelector != nil {
|
|
| 1435 |
+ out.NodeSelector = make(map[string]string) |
|
| 1436 |
+ for key, val := range in.NodeSelector {
|
|
| 1437 |
+ out.NodeSelector[key] = val |
|
| 1438 |
+ } |
|
| 1439 |
+ } else {
|
|
| 1440 |
+ out.NodeSelector = nil |
|
| 1441 |
+ } |
|
| 1442 |
+ out.ServiceAccount = in.ServiceAccount |
|
| 1443 |
+ out.Host = in.Host |
|
| 1444 |
+ out.HostNetwork = in.HostNetwork |
|
| 1445 |
+ if in.ImagePullSecrets != nil {
|
|
| 1446 |
+ out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) |
|
| 1447 |
+ for i := range in.ImagePullSecrets {
|
|
| 1448 |
+ if err := deepCopy_v1beta3_LocalObjectReference(in.ImagePullSecrets[i], &out.ImagePullSecrets[i], c); err != nil {
|
|
| 1449 |
+ return err |
|
| 1450 |
+ } |
|
| 1451 |
+ } |
|
| 1452 |
+ } else {
|
|
| 1453 |
+ out.ImagePullSecrets = nil |
|
| 1454 |
+ } |
|
| 1455 |
+ return nil |
|
| 1456 |
+} |
|
| 1457 |
+ |
|
| 1458 |
+func deepCopy_v1beta3_PodStatus(in PodStatus, out *PodStatus, c *conversion.Cloner) error {
|
|
| 1459 |
+ out.Phase = in.Phase |
|
| 1460 |
+ if in.Conditions != nil {
|
|
| 1461 |
+ out.Conditions = make([]PodCondition, len(in.Conditions)) |
|
| 1462 |
+ for i := range in.Conditions {
|
|
| 1463 |
+ if err := deepCopy_v1beta3_PodCondition(in.Conditions[i], &out.Conditions[i], c); err != nil {
|
|
| 1464 |
+ return err |
|
| 1465 |
+ } |
|
| 1466 |
+ } |
|
| 1467 |
+ } else {
|
|
| 1468 |
+ out.Conditions = nil |
|
| 1469 |
+ } |
|
| 1470 |
+ out.Message = in.Message |
|
| 1471 |
+ out.Reason = in.Reason |
|
| 1472 |
+ out.HostIP = in.HostIP |
|
| 1473 |
+ out.PodIP = in.PodIP |
|
| 1474 |
+ if in.StartTime != nil {
|
|
| 1475 |
+ out.StartTime = new(util.Time) |
|
| 1476 |
+ if err := deepCopy_util_Time(*in.StartTime, out.StartTime, c); err != nil {
|
|
| 1477 |
+ return err |
|
| 1478 |
+ } |
|
| 1479 |
+ } else {
|
|
| 1480 |
+ out.StartTime = nil |
|
| 1481 |
+ } |
|
| 1482 |
+ if in.ContainerStatuses != nil {
|
|
| 1483 |
+ out.ContainerStatuses = make([]ContainerStatus, len(in.ContainerStatuses)) |
|
| 1484 |
+ for i := range in.ContainerStatuses {
|
|
| 1485 |
+ if err := deepCopy_v1beta3_ContainerStatus(in.ContainerStatuses[i], &out.ContainerStatuses[i], c); err != nil {
|
|
| 1486 |
+ return err |
|
| 1487 |
+ } |
|
| 1488 |
+ } |
|
| 1489 |
+ } else {
|
|
| 1490 |
+ out.ContainerStatuses = nil |
|
| 1491 |
+ } |
|
| 1492 |
+ return nil |
|
| 1493 |
+} |
|
| 1494 |
+ |
|
| 1495 |
+func deepCopy_v1beta3_PodStatusResult(in PodStatusResult, out *PodStatusResult, c *conversion.Cloner) error {
|
|
| 1496 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1497 |
+ return err |
|
| 1498 |
+ } |
|
| 1499 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1500 |
+ return err |
|
| 1501 |
+ } |
|
| 1502 |
+ if err := deepCopy_v1beta3_PodStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1503 |
+ return err |
|
| 1504 |
+ } |
|
| 1505 |
+ return nil |
|
| 1506 |
+} |
|
| 1507 |
+ |
|
| 1508 |
+func deepCopy_v1beta3_PodTemplate(in PodTemplate, out *PodTemplate, c *conversion.Cloner) error {
|
|
| 1509 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1510 |
+ return err |
|
| 1511 |
+ } |
|
| 1512 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1513 |
+ return err |
|
| 1514 |
+ } |
|
| 1515 |
+ if err := deepCopy_v1beta3_PodTemplateSpec(in.Template, &out.Template, c); err != nil {
|
|
| 1516 |
+ return err |
|
| 1517 |
+ } |
|
| 1518 |
+ return nil |
|
| 1519 |
+} |
|
| 1520 |
+ |
|
| 1521 |
+func deepCopy_v1beta3_PodTemplateList(in PodTemplateList, out *PodTemplateList, c *conversion.Cloner) error {
|
|
| 1522 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1523 |
+ return err |
|
| 1524 |
+ } |
|
| 1525 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1526 |
+ return err |
|
| 1527 |
+ } |
|
| 1528 |
+ if in.Items != nil {
|
|
| 1529 |
+ out.Items = make([]PodTemplate, len(in.Items)) |
|
| 1530 |
+ for i := range in.Items {
|
|
| 1531 |
+ if err := deepCopy_v1beta3_PodTemplate(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1532 |
+ return err |
|
| 1533 |
+ } |
|
| 1534 |
+ } |
|
| 1535 |
+ } else {
|
|
| 1536 |
+ out.Items = nil |
|
| 1537 |
+ } |
|
| 1538 |
+ return nil |
|
| 1539 |
+} |
|
| 1540 |
+ |
|
| 1541 |
+func deepCopy_v1beta3_PodTemplateSpec(in PodTemplateSpec, out *PodTemplateSpec, c *conversion.Cloner) error {
|
|
| 1542 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1543 |
+ return err |
|
| 1544 |
+ } |
|
| 1545 |
+ if err := deepCopy_v1beta3_PodSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1546 |
+ return err |
|
| 1547 |
+ } |
|
| 1548 |
+ return nil |
|
| 1549 |
+} |
|
| 1550 |
+ |
|
| 1551 |
+func deepCopy_v1beta3_Probe(in Probe, out *Probe, c *conversion.Cloner) error {
|
|
| 1552 |
+ if err := deepCopy_v1beta3_Handler(in.Handler, &out.Handler, c); err != nil {
|
|
| 1553 |
+ return err |
|
| 1554 |
+ } |
|
| 1555 |
+ out.InitialDelaySeconds = in.InitialDelaySeconds |
|
| 1556 |
+ out.TimeoutSeconds = in.TimeoutSeconds |
|
| 1557 |
+ return nil |
|
| 1558 |
+} |
|
| 1559 |
+ |
|
| 1560 |
+func deepCopy_v1beta3_RBDVolumeSource(in RBDVolumeSource, out *RBDVolumeSource, c *conversion.Cloner) error {
|
|
| 1561 |
+ if in.CephMonitors != nil {
|
|
| 1562 |
+ out.CephMonitors = make([]string, len(in.CephMonitors)) |
|
| 1563 |
+ for i := range in.CephMonitors {
|
|
| 1564 |
+ out.CephMonitors[i] = in.CephMonitors[i] |
|
| 1565 |
+ } |
|
| 1566 |
+ } else {
|
|
| 1567 |
+ out.CephMonitors = nil |
|
| 1568 |
+ } |
|
| 1569 |
+ out.RBDImage = in.RBDImage |
|
| 1570 |
+ out.FSType = in.FSType |
|
| 1571 |
+ out.RBDPool = in.RBDPool |
|
| 1572 |
+ out.RadosUser = in.RadosUser |
|
| 1573 |
+ out.Keyring = in.Keyring |
|
| 1574 |
+ if in.SecretRef != nil {
|
|
| 1575 |
+ out.SecretRef = new(LocalObjectReference) |
|
| 1576 |
+ if err := deepCopy_v1beta3_LocalObjectReference(*in.SecretRef, out.SecretRef, c); err != nil {
|
|
| 1577 |
+ return err |
|
| 1578 |
+ } |
|
| 1579 |
+ } else {
|
|
| 1580 |
+ out.SecretRef = nil |
|
| 1581 |
+ } |
|
| 1582 |
+ out.ReadOnly = in.ReadOnly |
|
| 1583 |
+ return nil |
|
| 1584 |
+} |
|
| 1585 |
+ |
|
| 1586 |
+func deepCopy_v1beta3_RangeAllocation(in RangeAllocation, out *RangeAllocation, c *conversion.Cloner) error {
|
|
| 1587 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1588 |
+ return err |
|
| 1589 |
+ } |
|
| 1590 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1591 |
+ return err |
|
| 1592 |
+ } |
|
| 1593 |
+ out.Range = in.Range |
|
| 1594 |
+ if in.Data != nil {
|
|
| 1595 |
+ out.Data = make([]uint8, len(in.Data)) |
|
| 1596 |
+ for i := range in.Data {
|
|
| 1597 |
+ out.Data[i] = in.Data[i] |
|
| 1598 |
+ } |
|
| 1599 |
+ } else {
|
|
| 1600 |
+ out.Data = nil |
|
| 1601 |
+ } |
|
| 1602 |
+ return nil |
|
| 1603 |
+} |
|
| 1604 |
+ |
|
| 1605 |
+func deepCopy_v1beta3_ReplicationController(in ReplicationController, out *ReplicationController, c *conversion.Cloner) error {
|
|
| 1606 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1607 |
+ return err |
|
| 1608 |
+ } |
|
| 1609 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1610 |
+ return err |
|
| 1611 |
+ } |
|
| 1612 |
+ if err := deepCopy_v1beta3_ReplicationControllerSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1613 |
+ return err |
|
| 1614 |
+ } |
|
| 1615 |
+ if err := deepCopy_v1beta3_ReplicationControllerStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1616 |
+ return err |
|
| 1617 |
+ } |
|
| 1618 |
+ return nil |
|
| 1619 |
+} |
|
| 1620 |
+ |
|
| 1621 |
+func deepCopy_v1beta3_ReplicationControllerList(in ReplicationControllerList, out *ReplicationControllerList, c *conversion.Cloner) error {
|
|
| 1622 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1623 |
+ return err |
|
| 1624 |
+ } |
|
| 1625 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1626 |
+ return err |
|
| 1627 |
+ } |
|
| 1628 |
+ if in.Items != nil {
|
|
| 1629 |
+ out.Items = make([]ReplicationController, len(in.Items)) |
|
| 1630 |
+ for i := range in.Items {
|
|
| 1631 |
+ if err := deepCopy_v1beta3_ReplicationController(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1632 |
+ return err |
|
| 1633 |
+ } |
|
| 1634 |
+ } |
|
| 1635 |
+ } else {
|
|
| 1636 |
+ out.Items = nil |
|
| 1637 |
+ } |
|
| 1638 |
+ return nil |
|
| 1639 |
+} |
|
| 1640 |
+ |
|
| 1641 |
+func deepCopy_v1beta3_ReplicationControllerSpec(in ReplicationControllerSpec, out *ReplicationControllerSpec, c *conversion.Cloner) error {
|
|
| 1642 |
+ if in.Replicas != nil {
|
|
| 1643 |
+ out.Replicas = new(int) |
|
| 1644 |
+ *out.Replicas = *in.Replicas |
|
| 1645 |
+ } else {
|
|
| 1646 |
+ out.Replicas = nil |
|
| 1647 |
+ } |
|
| 1648 |
+ if in.Selector != nil {
|
|
| 1649 |
+ out.Selector = make(map[string]string) |
|
| 1650 |
+ for key, val := range in.Selector {
|
|
| 1651 |
+ out.Selector[key] = val |
|
| 1652 |
+ } |
|
| 1653 |
+ } else {
|
|
| 1654 |
+ out.Selector = nil |
|
| 1655 |
+ } |
|
| 1656 |
+ if in.Template != nil {
|
|
| 1657 |
+ out.Template = new(PodTemplateSpec) |
|
| 1658 |
+ if err := deepCopy_v1beta3_PodTemplateSpec(*in.Template, out.Template, c); err != nil {
|
|
| 1659 |
+ return err |
|
| 1660 |
+ } |
|
| 1661 |
+ } else {
|
|
| 1662 |
+ out.Template = nil |
|
| 1663 |
+ } |
|
| 1664 |
+ return nil |
|
| 1665 |
+} |
|
| 1666 |
+ |
|
| 1667 |
+func deepCopy_v1beta3_ReplicationControllerStatus(in ReplicationControllerStatus, out *ReplicationControllerStatus, c *conversion.Cloner) error {
|
|
| 1668 |
+ out.Replicas = in.Replicas |
|
| 1669 |
+ out.ObservedGeneration = in.ObservedGeneration |
|
| 1670 |
+ return nil |
|
| 1671 |
+} |
|
| 1672 |
+ |
|
| 1673 |
+func deepCopy_v1beta3_ResourceQuota(in ResourceQuota, out *ResourceQuota, c *conversion.Cloner) error {
|
|
| 1674 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1675 |
+ return err |
|
| 1676 |
+ } |
|
| 1677 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1678 |
+ return err |
|
| 1679 |
+ } |
|
| 1680 |
+ if err := deepCopy_v1beta3_ResourceQuotaSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1681 |
+ return err |
|
| 1682 |
+ } |
|
| 1683 |
+ if err := deepCopy_v1beta3_ResourceQuotaStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1684 |
+ return err |
|
| 1685 |
+ } |
|
| 1686 |
+ return nil |
|
| 1687 |
+} |
|
| 1688 |
+ |
|
| 1689 |
+func deepCopy_v1beta3_ResourceQuotaList(in ResourceQuotaList, out *ResourceQuotaList, c *conversion.Cloner) error {
|
|
| 1690 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1691 |
+ return err |
|
| 1692 |
+ } |
|
| 1693 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1694 |
+ return err |
|
| 1695 |
+ } |
|
| 1696 |
+ if in.Items != nil {
|
|
| 1697 |
+ out.Items = make([]ResourceQuota, len(in.Items)) |
|
| 1698 |
+ for i := range in.Items {
|
|
| 1699 |
+ if err := deepCopy_v1beta3_ResourceQuota(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1700 |
+ return err |
|
| 1701 |
+ } |
|
| 1702 |
+ } |
|
| 1703 |
+ } else {
|
|
| 1704 |
+ out.Items = nil |
|
| 1705 |
+ } |
|
| 1706 |
+ return nil |
|
| 1707 |
+} |
|
| 1708 |
+ |
|
| 1709 |
+func deepCopy_v1beta3_ResourceQuotaSpec(in ResourceQuotaSpec, out *ResourceQuotaSpec, c *conversion.Cloner) error {
|
|
| 1710 |
+ if in.Hard != nil {
|
|
| 1711 |
+ out.Hard = make(ResourceList) |
|
| 1712 |
+ for key, val := range in.Hard {
|
|
| 1713 |
+ newVal := new(resource.Quantity) |
|
| 1714 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1715 |
+ return err |
|
| 1716 |
+ } |
|
| 1717 |
+ out.Hard[key] = *newVal |
|
| 1718 |
+ } |
|
| 1719 |
+ } else {
|
|
| 1720 |
+ out.Hard = nil |
|
| 1721 |
+ } |
|
| 1722 |
+ return nil |
|
| 1723 |
+} |
|
| 1724 |
+ |
|
| 1725 |
+func deepCopy_v1beta3_ResourceQuotaStatus(in ResourceQuotaStatus, out *ResourceQuotaStatus, c *conversion.Cloner) error {
|
|
| 1726 |
+ if in.Hard != nil {
|
|
| 1727 |
+ out.Hard = make(ResourceList) |
|
| 1728 |
+ for key, val := range in.Hard {
|
|
| 1729 |
+ newVal := new(resource.Quantity) |
|
| 1730 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1731 |
+ return err |
|
| 1732 |
+ } |
|
| 1733 |
+ out.Hard[key] = *newVal |
|
| 1734 |
+ } |
|
| 1735 |
+ } else {
|
|
| 1736 |
+ out.Hard = nil |
|
| 1737 |
+ } |
|
| 1738 |
+ if in.Used != nil {
|
|
| 1739 |
+ out.Used = make(ResourceList) |
|
| 1740 |
+ for key, val := range in.Used {
|
|
| 1741 |
+ newVal := new(resource.Quantity) |
|
| 1742 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1743 |
+ return err |
|
| 1744 |
+ } |
|
| 1745 |
+ out.Used[key] = *newVal |
|
| 1746 |
+ } |
|
| 1747 |
+ } else {
|
|
| 1748 |
+ out.Used = nil |
|
| 1749 |
+ } |
|
| 1750 |
+ return nil |
|
| 1751 |
+} |
|
| 1752 |
+ |
|
| 1753 |
+func deepCopy_v1beta3_ResourceRequirements(in ResourceRequirements, out *ResourceRequirements, c *conversion.Cloner) error {
|
|
| 1754 |
+ if in.Limits != nil {
|
|
| 1755 |
+ out.Limits = make(ResourceList) |
|
| 1756 |
+ for key, val := range in.Limits {
|
|
| 1757 |
+ newVal := new(resource.Quantity) |
|
| 1758 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1759 |
+ return err |
|
| 1760 |
+ } |
|
| 1761 |
+ out.Limits[key] = *newVal |
|
| 1762 |
+ } |
|
| 1763 |
+ } else {
|
|
| 1764 |
+ out.Limits = nil |
|
| 1765 |
+ } |
|
| 1766 |
+ if in.Requests != nil {
|
|
| 1767 |
+ out.Requests = make(ResourceList) |
|
| 1768 |
+ for key, val := range in.Requests {
|
|
| 1769 |
+ newVal := new(resource.Quantity) |
|
| 1770 |
+ if err := deepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
| 1771 |
+ return err |
|
| 1772 |
+ } |
|
| 1773 |
+ out.Requests[key] = *newVal |
|
| 1774 |
+ } |
|
| 1775 |
+ } else {
|
|
| 1776 |
+ out.Requests = nil |
|
| 1777 |
+ } |
|
| 1778 |
+ return nil |
|
| 1779 |
+} |
|
| 1780 |
+ |
|
| 1781 |
+func deepCopy_v1beta3_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, c *conversion.Cloner) error {
|
|
| 1782 |
+ out.Type = in.Type |
|
| 1783 |
+ if in.UID != nil {
|
|
| 1784 |
+ out.UID = new(int64) |
|
| 1785 |
+ *out.UID = *in.UID |
|
| 1786 |
+ } else {
|
|
| 1787 |
+ out.UID = nil |
|
| 1788 |
+ } |
|
| 1789 |
+ if in.UIDRangeMin != nil {
|
|
| 1790 |
+ out.UIDRangeMin = new(int64) |
|
| 1791 |
+ *out.UIDRangeMin = *in.UIDRangeMin |
|
| 1792 |
+ } else {
|
|
| 1793 |
+ out.UIDRangeMin = nil |
|
| 1794 |
+ } |
|
| 1795 |
+ if in.UIDRangeMax != nil {
|
|
| 1796 |
+ out.UIDRangeMax = new(int64) |
|
| 1797 |
+ *out.UIDRangeMax = *in.UIDRangeMax |
|
| 1798 |
+ } else {
|
|
| 1799 |
+ out.UIDRangeMax = nil |
|
| 1800 |
+ } |
|
| 1801 |
+ return nil |
|
| 1802 |
+} |
|
| 1803 |
+ |
|
| 1804 |
+func deepCopy_v1beta3_SELinuxContextStrategyOptions(in SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, c *conversion.Cloner) error {
|
|
| 1805 |
+ out.Type = in.Type |
|
| 1806 |
+ if in.SELinuxOptions != nil {
|
|
| 1807 |
+ out.SELinuxOptions = new(SELinuxOptions) |
|
| 1808 |
+ if err := deepCopy_v1beta3_SELinuxOptions(*in.SELinuxOptions, out.SELinuxOptions, c); err != nil {
|
|
| 1809 |
+ return err |
|
| 1810 |
+ } |
|
| 1811 |
+ } else {
|
|
| 1812 |
+ out.SELinuxOptions = nil |
|
| 1813 |
+ } |
|
| 1814 |
+ return nil |
|
| 1815 |
+} |
|
| 1816 |
+ |
|
| 1817 |
+func deepCopy_v1beta3_SELinuxOptions(in SELinuxOptions, out *SELinuxOptions, c *conversion.Cloner) error {
|
|
| 1818 |
+ out.User = in.User |
|
| 1819 |
+ out.Role = in.Role |
|
| 1820 |
+ out.Type = in.Type |
|
| 1821 |
+ out.Level = in.Level |
|
| 1822 |
+ return nil |
|
| 1823 |
+} |
|
| 1824 |
+ |
|
| 1825 |
+func deepCopy_v1beta3_Secret(in Secret, out *Secret, c *conversion.Cloner) error {
|
|
| 1826 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1827 |
+ return err |
|
| 1828 |
+ } |
|
| 1829 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1830 |
+ return err |
|
| 1831 |
+ } |
|
| 1832 |
+ if in.Data != nil {
|
|
| 1833 |
+ out.Data = make(map[string][]uint8) |
|
| 1834 |
+ for key, val := range in.Data {
|
|
| 1835 |
+ if newVal, err := c.DeepCopy(val); err != nil {
|
|
| 1836 |
+ return err |
|
| 1837 |
+ } else {
|
|
| 1838 |
+ out.Data[key] = newVal.([]uint8) |
|
| 1839 |
+ } |
|
| 1840 |
+ } |
|
| 1841 |
+ } else {
|
|
| 1842 |
+ out.Data = nil |
|
| 1843 |
+ } |
|
| 1844 |
+ out.Type = in.Type |
|
| 1845 |
+ return nil |
|
| 1846 |
+} |
|
| 1847 |
+ |
|
| 1848 |
+func deepCopy_v1beta3_SecretList(in SecretList, out *SecretList, c *conversion.Cloner) error {
|
|
| 1849 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1850 |
+ return err |
|
| 1851 |
+ } |
|
| 1852 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1853 |
+ return err |
|
| 1854 |
+ } |
|
| 1855 |
+ if in.Items != nil {
|
|
| 1856 |
+ out.Items = make([]Secret, len(in.Items)) |
|
| 1857 |
+ for i := range in.Items {
|
|
| 1858 |
+ if err := deepCopy_v1beta3_Secret(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1859 |
+ return err |
|
| 1860 |
+ } |
|
| 1861 |
+ } |
|
| 1862 |
+ } else {
|
|
| 1863 |
+ out.Items = nil |
|
| 1864 |
+ } |
|
| 1865 |
+ return nil |
|
| 1866 |
+} |
|
| 1867 |
+ |
|
| 1868 |
+func deepCopy_v1beta3_SecretVolumeSource(in SecretVolumeSource, out *SecretVolumeSource, c *conversion.Cloner) error {
|
|
| 1869 |
+ out.SecretName = in.SecretName |
|
| 1870 |
+ return nil |
|
| 1871 |
+} |
|
| 1872 |
+ |
|
| 1873 |
+func deepCopy_v1beta3_SecurityContext(in SecurityContext, out *SecurityContext, c *conversion.Cloner) error {
|
|
| 1874 |
+ if in.Capabilities != nil {
|
|
| 1875 |
+ out.Capabilities = new(Capabilities) |
|
| 1876 |
+ if err := deepCopy_v1beta3_Capabilities(*in.Capabilities, out.Capabilities, c); err != nil {
|
|
| 1877 |
+ return err |
|
| 1878 |
+ } |
|
| 1879 |
+ } else {
|
|
| 1880 |
+ out.Capabilities = nil |
|
| 1881 |
+ } |
|
| 1882 |
+ if in.Privileged != nil {
|
|
| 1883 |
+ out.Privileged = new(bool) |
|
| 1884 |
+ *out.Privileged = *in.Privileged |
|
| 1885 |
+ } else {
|
|
| 1886 |
+ out.Privileged = nil |
|
| 1887 |
+ } |
|
| 1888 |
+ if in.SELinuxOptions != nil {
|
|
| 1889 |
+ out.SELinuxOptions = new(SELinuxOptions) |
|
| 1890 |
+ if err := deepCopy_v1beta3_SELinuxOptions(*in.SELinuxOptions, out.SELinuxOptions, c); err != nil {
|
|
| 1891 |
+ return err |
|
| 1892 |
+ } |
|
| 1893 |
+ } else {
|
|
| 1894 |
+ out.SELinuxOptions = nil |
|
| 1895 |
+ } |
|
| 1896 |
+ if in.RunAsUser != nil {
|
|
| 1897 |
+ out.RunAsUser = new(int64) |
|
| 1898 |
+ *out.RunAsUser = *in.RunAsUser |
|
| 1899 |
+ } else {
|
|
| 1900 |
+ out.RunAsUser = nil |
|
| 1901 |
+ } |
|
| 1902 |
+ out.RunAsNonRoot = in.RunAsNonRoot |
|
| 1903 |
+ return nil |
|
| 1904 |
+} |
|
| 1905 |
+ |
|
| 1906 |
+func deepCopy_v1beta3_SecurityContextConstraints(in SecurityContextConstraints, out *SecurityContextConstraints, c *conversion.Cloner) error {
|
|
| 1907 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1908 |
+ return err |
|
| 1909 |
+ } |
|
| 1910 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1911 |
+ return err |
|
| 1912 |
+ } |
|
| 1913 |
+ out.AllowPrivilegedContainer = in.AllowPrivilegedContainer |
|
| 1914 |
+ if in.AllowedCapabilities != nil {
|
|
| 1915 |
+ out.AllowedCapabilities = make([]Capability, len(in.AllowedCapabilities)) |
|
| 1916 |
+ for i := range in.AllowedCapabilities {
|
|
| 1917 |
+ out.AllowedCapabilities[i] = in.AllowedCapabilities[i] |
|
| 1918 |
+ } |
|
| 1919 |
+ } else {
|
|
| 1920 |
+ out.AllowedCapabilities = nil |
|
| 1921 |
+ } |
|
| 1922 |
+ out.AllowHostDirVolumePlugin = in.AllowHostDirVolumePlugin |
|
| 1923 |
+ out.AllowHostNetwork = in.AllowHostNetwork |
|
| 1924 |
+ out.AllowHostPorts = in.AllowHostPorts |
|
| 1925 |
+ if err := deepCopy_v1beta3_SELinuxContextStrategyOptions(in.SELinuxContext, &out.SELinuxContext, c); err != nil {
|
|
| 1926 |
+ return err |
|
| 1927 |
+ } |
|
| 1928 |
+ if err := deepCopy_v1beta3_RunAsUserStrategyOptions(in.RunAsUser, &out.RunAsUser, c); err != nil {
|
|
| 1929 |
+ return err |
|
| 1930 |
+ } |
|
| 1931 |
+ if in.Users != nil {
|
|
| 1932 |
+ out.Users = make([]string, len(in.Users)) |
|
| 1933 |
+ for i := range in.Users {
|
|
| 1934 |
+ out.Users[i] = in.Users[i] |
|
| 1935 |
+ } |
|
| 1936 |
+ } else {
|
|
| 1937 |
+ out.Users = nil |
|
| 1938 |
+ } |
|
| 1939 |
+ if in.Groups != nil {
|
|
| 1940 |
+ out.Groups = make([]string, len(in.Groups)) |
|
| 1941 |
+ for i := range in.Groups {
|
|
| 1942 |
+ out.Groups[i] = in.Groups[i] |
|
| 1943 |
+ } |
|
| 1944 |
+ } else {
|
|
| 1945 |
+ out.Groups = nil |
|
| 1946 |
+ } |
|
| 1947 |
+ return nil |
|
| 1948 |
+} |
|
| 1949 |
+ |
|
| 1950 |
+func deepCopy_v1beta3_SecurityContextConstraintsList(in SecurityContextConstraintsList, out *SecurityContextConstraintsList, c *conversion.Cloner) error {
|
|
| 1951 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1952 |
+ return err |
|
| 1953 |
+ } |
|
| 1954 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 1955 |
+ return err |
|
| 1956 |
+ } |
|
| 1957 |
+ if in.Items != nil {
|
|
| 1958 |
+ out.Items = make([]SecurityContextConstraints, len(in.Items)) |
|
| 1959 |
+ for i := range in.Items {
|
|
| 1960 |
+ if err := deepCopy_v1beta3_SecurityContextConstraints(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 1961 |
+ return err |
|
| 1962 |
+ } |
|
| 1963 |
+ } |
|
| 1964 |
+ } else {
|
|
| 1965 |
+ out.Items = nil |
|
| 1966 |
+ } |
|
| 1967 |
+ return nil |
|
| 1968 |
+} |
|
| 1969 |
+ |
|
| 1970 |
+func deepCopy_v1beta3_SerializedReference(in SerializedReference, out *SerializedReference, c *conversion.Cloner) error {
|
|
| 1971 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1972 |
+ return err |
|
| 1973 |
+ } |
|
| 1974 |
+ if err := deepCopy_v1beta3_ObjectReference(in.Reference, &out.Reference, c); err != nil {
|
|
| 1975 |
+ return err |
|
| 1976 |
+ } |
|
| 1977 |
+ return nil |
|
| 1978 |
+} |
|
| 1979 |
+ |
|
| 1980 |
+func deepCopy_v1beta3_Service(in Service, out *Service, c *conversion.Cloner) error {
|
|
| 1981 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1982 |
+ return err |
|
| 1983 |
+ } |
|
| 1984 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 1985 |
+ return err |
|
| 1986 |
+ } |
|
| 1987 |
+ if err := deepCopy_v1beta3_ServiceSpec(in.Spec, &out.Spec, c); err != nil {
|
|
| 1988 |
+ return err |
|
| 1989 |
+ } |
|
| 1990 |
+ if err := deepCopy_v1beta3_ServiceStatus(in.Status, &out.Status, c); err != nil {
|
|
| 1991 |
+ return err |
|
| 1992 |
+ } |
|
| 1993 |
+ return nil |
|
| 1994 |
+} |
|
| 1995 |
+ |
|
| 1996 |
+func deepCopy_v1beta3_ServiceAccount(in ServiceAccount, out *ServiceAccount, c *conversion.Cloner) error {
|
|
| 1997 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 1998 |
+ return err |
|
| 1999 |
+ } |
|
| 2000 |
+ if err := deepCopy_v1beta3_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
|
| 2001 |
+ return err |
|
| 2002 |
+ } |
|
| 2003 |
+ if in.Secrets != nil {
|
|
| 2004 |
+ out.Secrets = make([]ObjectReference, len(in.Secrets)) |
|
| 2005 |
+ for i := range in.Secrets {
|
|
| 2006 |
+ if err := deepCopy_v1beta3_ObjectReference(in.Secrets[i], &out.Secrets[i], c); err != nil {
|
|
| 2007 |
+ return err |
|
| 2008 |
+ } |
|
| 2009 |
+ } |
|
| 2010 |
+ } else {
|
|
| 2011 |
+ out.Secrets = nil |
|
| 2012 |
+ } |
|
| 2013 |
+ if in.ImagePullSecrets != nil {
|
|
| 2014 |
+ out.ImagePullSecrets = make([]LocalObjectReference, len(in.ImagePullSecrets)) |
|
| 2015 |
+ for i := range in.ImagePullSecrets {
|
|
| 2016 |
+ if err := deepCopy_v1beta3_LocalObjectReference(in.ImagePullSecrets[i], &out.ImagePullSecrets[i], c); err != nil {
|
|
| 2017 |
+ return err |
|
| 2018 |
+ } |
|
| 2019 |
+ } |
|
| 2020 |
+ } else {
|
|
| 2021 |
+ out.ImagePullSecrets = nil |
|
| 2022 |
+ } |
|
| 2023 |
+ return nil |
|
| 2024 |
+} |
|
| 2025 |
+ |
|
| 2026 |
+func deepCopy_v1beta3_ServiceAccountList(in ServiceAccountList, out *ServiceAccountList, c *conversion.Cloner) error {
|
|
| 2027 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 2028 |
+ return err |
|
| 2029 |
+ } |
|
| 2030 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 2031 |
+ return err |
|
| 2032 |
+ } |
|
| 2033 |
+ if in.Items != nil {
|
|
| 2034 |
+ out.Items = make([]ServiceAccount, len(in.Items)) |
|
| 2035 |
+ for i := range in.Items {
|
|
| 2036 |
+ if err := deepCopy_v1beta3_ServiceAccount(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 2037 |
+ return err |
|
| 2038 |
+ } |
|
| 2039 |
+ } |
|
| 2040 |
+ } else {
|
|
| 2041 |
+ out.Items = nil |
|
| 2042 |
+ } |
|
| 2043 |
+ return nil |
|
| 2044 |
+} |
|
| 2045 |
+ |
|
| 2046 |
+func deepCopy_v1beta3_ServiceList(in ServiceList, out *ServiceList, c *conversion.Cloner) error {
|
|
| 2047 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 2048 |
+ return err |
|
| 2049 |
+ } |
|
| 2050 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 2051 |
+ return err |
|
| 2052 |
+ } |
|
| 2053 |
+ if in.Items != nil {
|
|
| 2054 |
+ out.Items = make([]Service, len(in.Items)) |
|
| 2055 |
+ for i := range in.Items {
|
|
| 2056 |
+ if err := deepCopy_v1beta3_Service(in.Items[i], &out.Items[i], c); err != nil {
|
|
| 2057 |
+ return err |
|
| 2058 |
+ } |
|
| 2059 |
+ } |
|
| 2060 |
+ } else {
|
|
| 2061 |
+ out.Items = nil |
|
| 2062 |
+ } |
|
| 2063 |
+ return nil |
|
| 2064 |
+} |
|
| 2065 |
+ |
|
| 2066 |
+func deepCopy_v1beta3_ServicePort(in ServicePort, out *ServicePort, c *conversion.Cloner) error {
|
|
| 2067 |
+ out.Name = in.Name |
|
| 2068 |
+ out.Protocol = in.Protocol |
|
| 2069 |
+ out.Port = in.Port |
|
| 2070 |
+ if err := deepCopy_util_IntOrString(in.TargetPort, &out.TargetPort, c); err != nil {
|
|
| 2071 |
+ return err |
|
| 2072 |
+ } |
|
| 2073 |
+ out.NodePort = in.NodePort |
|
| 2074 |
+ return nil |
|
| 2075 |
+} |
|
| 2076 |
+ |
|
| 2077 |
+func deepCopy_v1beta3_ServiceSpec(in ServiceSpec, out *ServiceSpec, c *conversion.Cloner) error {
|
|
| 2078 |
+ if in.Ports != nil {
|
|
| 2079 |
+ out.Ports = make([]ServicePort, len(in.Ports)) |
|
| 2080 |
+ for i := range in.Ports {
|
|
| 2081 |
+ if err := deepCopy_v1beta3_ServicePort(in.Ports[i], &out.Ports[i], c); err != nil {
|
|
| 2082 |
+ return err |
|
| 2083 |
+ } |
|
| 2084 |
+ } |
|
| 2085 |
+ } else {
|
|
| 2086 |
+ out.Ports = nil |
|
| 2087 |
+ } |
|
| 2088 |
+ if in.Selector != nil {
|
|
| 2089 |
+ out.Selector = make(map[string]string) |
|
| 2090 |
+ for key, val := range in.Selector {
|
|
| 2091 |
+ out.Selector[key] = val |
|
| 2092 |
+ } |
|
| 2093 |
+ } else {
|
|
| 2094 |
+ out.Selector = nil |
|
| 2095 |
+ } |
|
| 2096 |
+ out.PortalIP = in.PortalIP |
|
| 2097 |
+ out.CreateExternalLoadBalancer = in.CreateExternalLoadBalancer |
|
| 2098 |
+ out.Type = in.Type |
|
| 2099 |
+ if in.PublicIPs != nil {
|
|
| 2100 |
+ out.PublicIPs = make([]string, len(in.PublicIPs)) |
|
| 2101 |
+ for i := range in.PublicIPs {
|
|
| 2102 |
+ out.PublicIPs[i] = in.PublicIPs[i] |
|
| 2103 |
+ } |
|
| 2104 |
+ } else {
|
|
| 2105 |
+ out.PublicIPs = nil |
|
| 2106 |
+ } |
|
| 2107 |
+ out.SessionAffinity = in.SessionAffinity |
|
| 2108 |
+ return nil |
|
| 2109 |
+} |
|
| 2110 |
+ |
|
| 2111 |
+func deepCopy_v1beta3_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *conversion.Cloner) error {
|
|
| 2112 |
+ if err := deepCopy_v1beta3_LoadBalancerStatus(in.LoadBalancer, &out.LoadBalancer, c); err != nil {
|
|
| 2113 |
+ return err |
|
| 2114 |
+ } |
|
| 2115 |
+ return nil |
|
| 2116 |
+} |
|
| 2117 |
+ |
|
| 2118 |
+func deepCopy_v1beta3_Status(in Status, out *Status, c *conversion.Cloner) error {
|
|
| 2119 |
+ if err := deepCopy_v1beta3_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
|
| 2120 |
+ return err |
|
| 2121 |
+ } |
|
| 2122 |
+ if err := deepCopy_v1beta3_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
|
| 2123 |
+ return err |
|
| 2124 |
+ } |
|
| 2125 |
+ out.Status = in.Status |
|
| 2126 |
+ out.Message = in.Message |
|
| 2127 |
+ out.Reason = in.Reason |
|
| 2128 |
+ if in.Details != nil {
|
|
| 2129 |
+ out.Details = new(StatusDetails) |
|
| 2130 |
+ if err := deepCopy_v1beta3_StatusDetails(*in.Details, out.Details, c); err != nil {
|
|
| 2131 |
+ return err |
|
| 2132 |
+ } |
|
| 2133 |
+ } else {
|
|
| 2134 |
+ out.Details = nil |
|
| 2135 |
+ } |
|
| 2136 |
+ out.Code = in.Code |
|
| 2137 |
+ return nil |
|
| 2138 |
+} |
|
| 2139 |
+ |
|
| 2140 |
+func deepCopy_v1beta3_StatusCause(in StatusCause, out *StatusCause, c *conversion.Cloner) error {
|
|
| 2141 |
+ out.Type = in.Type |
|
| 2142 |
+ out.Message = in.Message |
|
| 2143 |
+ out.Field = in.Field |
|
| 2144 |
+ return nil |
|
| 2145 |
+} |
|
| 2146 |
+ |
|
| 2147 |
+func deepCopy_v1beta3_StatusDetails(in StatusDetails, out *StatusDetails, c *conversion.Cloner) error {
|
|
| 2148 |
+ out.ID = in.ID |
|
| 2149 |
+ out.Kind = in.Kind |
|
| 2150 |
+ if in.Causes != nil {
|
|
| 2151 |
+ out.Causes = make([]StatusCause, len(in.Causes)) |
|
| 2152 |
+ for i := range in.Causes {
|
|
| 2153 |
+ if err := deepCopy_v1beta3_StatusCause(in.Causes[i], &out.Causes[i], c); err != nil {
|
|
| 2154 |
+ return err |
|
| 2155 |
+ } |
|
| 2156 |
+ } |
|
| 2157 |
+ } else {
|
|
| 2158 |
+ out.Causes = nil |
|
| 2159 |
+ } |
|
| 2160 |
+ out.RetryAfterSeconds = in.RetryAfterSeconds |
|
| 2161 |
+ return nil |
|
| 2162 |
+} |
|
| 2163 |
+ |
|
| 2164 |
+func deepCopy_v1beta3_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *conversion.Cloner) error {
|
|
| 2165 |
+ if err := deepCopy_util_IntOrString(in.Port, &out.Port, c); err != nil {
|
|
| 2166 |
+ return err |
|
| 2167 |
+ } |
|
| 2168 |
+ return nil |
|
| 2169 |
+} |
|
| 2170 |
+ |
|
| 2171 |
+func deepCopy_v1beta3_TypeMeta(in TypeMeta, out *TypeMeta, c *conversion.Cloner) error {
|
|
| 2172 |
+ out.Kind = in.Kind |
|
| 2173 |
+ out.APIVersion = in.APIVersion |
|
| 2174 |
+ return nil |
|
| 2175 |
+} |
|
| 2176 |
+ |
|
| 2177 |
+func deepCopy_v1beta3_Volume(in Volume, out *Volume, c *conversion.Cloner) error {
|
|
| 2178 |
+ out.Name = in.Name |
|
| 2179 |
+ if err := deepCopy_v1beta3_VolumeSource(in.VolumeSource, &out.VolumeSource, c); err != nil {
|
|
| 2180 |
+ return err |
|
| 2181 |
+ } |
|
| 2182 |
+ return nil |
|
| 2183 |
+} |
|
| 2184 |
+ |
|
| 2185 |
+func deepCopy_v1beta3_VolumeMount(in VolumeMount, out *VolumeMount, c *conversion.Cloner) error {
|
|
| 2186 |
+ out.Name = in.Name |
|
| 2187 |
+ out.ReadOnly = in.ReadOnly |
|
| 2188 |
+ out.MountPath = in.MountPath |
|
| 2189 |
+ return nil |
|
| 2190 |
+} |
|
| 2191 |
+ |
|
| 2192 |
+func deepCopy_v1beta3_VolumeSource(in VolumeSource, out *VolumeSource, c *conversion.Cloner) error {
|
|
| 2193 |
+ if in.HostPath != nil {
|
|
| 2194 |
+ out.HostPath = new(HostPathVolumeSource) |
|
| 2195 |
+ if err := deepCopy_v1beta3_HostPathVolumeSource(*in.HostPath, out.HostPath, c); err != nil {
|
|
| 2196 |
+ return err |
|
| 2197 |
+ } |
|
| 2198 |
+ } else {
|
|
| 2199 |
+ out.HostPath = nil |
|
| 2200 |
+ } |
|
| 2201 |
+ if in.EmptyDir != nil {
|
|
| 2202 |
+ out.EmptyDir = new(EmptyDirVolumeSource) |
|
| 2203 |
+ if err := deepCopy_v1beta3_EmptyDirVolumeSource(*in.EmptyDir, out.EmptyDir, c); err != nil {
|
|
| 2204 |
+ return err |
|
| 2205 |
+ } |
|
| 2206 |
+ } else {
|
|
| 2207 |
+ out.EmptyDir = nil |
|
| 2208 |
+ } |
|
| 2209 |
+ if in.GCEPersistentDisk != nil {
|
|
| 2210 |
+ out.GCEPersistentDisk = new(GCEPersistentDiskVolumeSource) |
|
| 2211 |
+ if err := deepCopy_v1beta3_GCEPersistentDiskVolumeSource(*in.GCEPersistentDisk, out.GCEPersistentDisk, c); err != nil {
|
|
| 2212 |
+ return err |
|
| 2213 |
+ } |
|
| 2214 |
+ } else {
|
|
| 2215 |
+ out.GCEPersistentDisk = nil |
|
| 2216 |
+ } |
|
| 2217 |
+ if in.AWSElasticBlockStore != nil {
|
|
| 2218 |
+ out.AWSElasticBlockStore = new(AWSElasticBlockStoreVolumeSource) |
|
| 2219 |
+ if err := deepCopy_v1beta3_AWSElasticBlockStoreVolumeSource(*in.AWSElasticBlockStore, out.AWSElasticBlockStore, c); err != nil {
|
|
| 2220 |
+ return err |
|
| 2221 |
+ } |
|
| 2222 |
+ } else {
|
|
| 2223 |
+ out.AWSElasticBlockStore = nil |
|
| 2224 |
+ } |
|
| 2225 |
+ if in.GitRepo != nil {
|
|
| 2226 |
+ out.GitRepo = new(GitRepoVolumeSource) |
|
| 2227 |
+ if err := deepCopy_v1beta3_GitRepoVolumeSource(*in.GitRepo, out.GitRepo, c); err != nil {
|
|
| 2228 |
+ return err |
|
| 2229 |
+ } |
|
| 2230 |
+ } else {
|
|
| 2231 |
+ out.GitRepo = nil |
|
| 2232 |
+ } |
|
| 2233 |
+ if in.Secret != nil {
|
|
| 2234 |
+ out.Secret = new(SecretVolumeSource) |
|
| 2235 |
+ if err := deepCopy_v1beta3_SecretVolumeSource(*in.Secret, out.Secret, c); err != nil {
|
|
| 2236 |
+ return err |
|
| 2237 |
+ } |
|
| 2238 |
+ } else {
|
|
| 2239 |
+ out.Secret = nil |
|
| 2240 |
+ } |
|
| 2241 |
+ if in.NFS != nil {
|
|
| 2242 |
+ out.NFS = new(NFSVolumeSource) |
|
| 2243 |
+ if err := deepCopy_v1beta3_NFSVolumeSource(*in.NFS, out.NFS, c); err != nil {
|
|
| 2244 |
+ return err |
|
| 2245 |
+ } |
|
| 2246 |
+ } else {
|
|
| 2247 |
+ out.NFS = nil |
|
| 2248 |
+ } |
|
| 2249 |
+ if in.ISCSI != nil {
|
|
| 2250 |
+ out.ISCSI = new(ISCSIVolumeSource) |
|
| 2251 |
+ if err := deepCopy_v1beta3_ISCSIVolumeSource(*in.ISCSI, out.ISCSI, c); err != nil {
|
|
| 2252 |
+ return err |
|
| 2253 |
+ } |
|
| 2254 |
+ } else {
|
|
| 2255 |
+ out.ISCSI = nil |
|
| 2256 |
+ } |
|
| 2257 |
+ if in.Glusterfs != nil {
|
|
| 2258 |
+ out.Glusterfs = new(GlusterfsVolumeSource) |
|
| 2259 |
+ if err := deepCopy_v1beta3_GlusterfsVolumeSource(*in.Glusterfs, out.Glusterfs, c); err != nil {
|
|
| 2260 |
+ return err |
|
| 2261 |
+ } |
|
| 2262 |
+ } else {
|
|
| 2263 |
+ out.Glusterfs = nil |
|
| 2264 |
+ } |
|
| 2265 |
+ if in.PersistentVolumeClaim != nil {
|
|
| 2266 |
+ out.PersistentVolumeClaim = new(PersistentVolumeClaimVolumeSource) |
|
| 2267 |
+ if err := deepCopy_v1beta3_PersistentVolumeClaimVolumeSource(*in.PersistentVolumeClaim, out.PersistentVolumeClaim, c); err != nil {
|
|
| 2268 |
+ return err |
|
| 2269 |
+ } |
|
| 2270 |
+ } else {
|
|
| 2271 |
+ out.PersistentVolumeClaim = nil |
|
| 2272 |
+ } |
|
| 2273 |
+ if in.RBD != nil {
|
|
| 2274 |
+ out.RBD = new(RBDVolumeSource) |
|
| 2275 |
+ if err := deepCopy_v1beta3_RBDVolumeSource(*in.RBD, out.RBD, c); err != nil {
|
|
| 2276 |
+ return err |
|
| 2277 |
+ } |
|
| 2278 |
+ } else {
|
|
| 2279 |
+ out.RBD = nil |
|
| 2280 |
+ } |
|
| 2281 |
+ if in.CephFS != nil {
|
|
| 2282 |
+ out.CephFS = new(CephFSVolumeSource) |
|
| 2283 |
+ if err := deepCopy_v1beta3_CephFSVolumeSource(*in.CephFS, out.CephFS, c); err != nil {
|
|
| 2284 |
+ return err |
|
| 2285 |
+ } |
|
| 2286 |
+ } else {
|
|
| 2287 |
+ out.CephFS = nil |
|
| 2288 |
+ } |
|
| 2289 |
+ if in.Metadata != nil {
|
|
| 2290 |
+ out.Metadata = new(MetadataVolumeSource) |
|
| 2291 |
+ if err := deepCopy_v1beta3_MetadataVolumeSource(*in.Metadata, out.Metadata, c); err != nil {
|
|
| 2292 |
+ return err |
|
| 2293 |
+ } |
|
| 2294 |
+ } else {
|
|
| 2295 |
+ out.Metadata = nil |
|
| 2296 |
+ } |
|
| 2297 |
+ if in.DownwardAPI != nil {
|
|
| 2298 |
+ out.DownwardAPI = new(DownwardAPIVolumeSource) |
|
| 2299 |
+ if err := deepCopy_v1beta3_DownwardAPIVolumeSource(*in.DownwardAPI, out.DownwardAPI, c); err != nil {
|
|
| 2300 |
+ return err |
|
| 2301 |
+ } |
|
| 2302 |
+ } else {
|
|
| 2303 |
+ out.DownwardAPI = nil |
|
| 2304 |
+ } |
|
| 2305 |
+ if in.Cinder != nil {
|
|
| 2306 |
+ out.Cinder = new(CinderVolumeSource) |
|
| 2307 |
+ if err := deepCopy_v1beta3_CinderVolumeSource(*in.Cinder, out.Cinder, c); err != nil {
|
|
| 2308 |
+ return err |
|
| 2309 |
+ } |
|
| 2310 |
+ } else {
|
|
| 2311 |
+ out.Cinder = nil |
|
| 2312 |
+ } |
|
| 2313 |
+ return nil |
|
| 2314 |
+} |
|
| 2315 |
+ |
|
| 2316 |
+func deepCopy_runtime_RawExtension(in runtime.RawExtension, out *runtime.RawExtension, c *conversion.Cloner) error {
|
|
| 2317 |
+ if in.RawJSON != nil {
|
|
| 2318 |
+ out.RawJSON = make([]uint8, len(in.RawJSON)) |
|
| 2319 |
+ for i := range in.RawJSON {
|
|
| 2320 |
+ out.RawJSON[i] = in.RawJSON[i] |
|
| 2321 |
+ } |
|
| 2322 |
+ } else {
|
|
| 2323 |
+ out.RawJSON = nil |
|
| 2324 |
+ } |
|
| 2325 |
+ return nil |
|
| 2326 |
+} |
|
| 2327 |
+ |
|
| 2328 |
+func deepCopy_util_IntOrString(in util.IntOrString, out *util.IntOrString, c *conversion.Cloner) error {
|
|
| 2329 |
+ out.Kind = in.Kind |
|
| 2330 |
+ out.IntVal = in.IntVal |
|
| 2331 |
+ out.StrVal = in.StrVal |
|
| 2332 |
+ return nil |
|
| 2333 |
+} |
|
| 2334 |
+ |
|
| 2335 |
+func deepCopy_util_Time(in util.Time, out *util.Time, c *conversion.Cloner) error {
|
|
| 2336 |
+ if newVal, err := c.DeepCopy(in.Time); err != nil {
|
|
| 2337 |
+ return err |
|
| 2338 |
+ } else {
|
|
| 2339 |
+ out.Time = newVal.(time.Time) |
|
| 2340 |
+ } |
|
| 2341 |
+ return nil |
|
| 2342 |
+} |
|
| 2343 |
+ |
|
| 2344 |
+func init() {
|
|
| 2345 |
+ err := api.Scheme.AddGeneratedDeepCopyFuncs( |
|
| 2346 |
+ deepCopy_resource_Quantity, |
|
| 2347 |
+ deepCopy_v1beta3_AWSElasticBlockStoreVolumeSource, |
|
| 2348 |
+ deepCopy_v1beta3_Binding, |
|
| 2349 |
+ deepCopy_v1beta3_Capabilities, |
|
| 2350 |
+ deepCopy_v1beta3_CephFSVolumeSource, |
|
| 2351 |
+ deepCopy_v1beta3_CinderVolumeSource, |
|
| 2352 |
+ deepCopy_v1beta3_ComponentCondition, |
|
| 2353 |
+ deepCopy_v1beta3_ComponentStatus, |
|
| 2354 |
+ deepCopy_v1beta3_ComponentStatusList, |
|
| 2355 |
+ deepCopy_v1beta3_Container, |
|
| 2356 |
+ deepCopy_v1beta3_ContainerPort, |
|
| 2357 |
+ deepCopy_v1beta3_ContainerState, |
|
| 2358 |
+ deepCopy_v1beta3_ContainerStateRunning, |
|
| 2359 |
+ deepCopy_v1beta3_ContainerStateTerminated, |
|
| 2360 |
+ deepCopy_v1beta3_ContainerStateWaiting, |
|
| 2361 |
+ deepCopy_v1beta3_ContainerStatus, |
|
| 2362 |
+ deepCopy_v1beta3_DeleteOptions, |
|
| 2363 |
+ deepCopy_v1beta3_DownwardAPIVolumeFile, |
|
| 2364 |
+ deepCopy_v1beta3_DownwardAPIVolumeSource, |
|
| 2365 |
+ deepCopy_v1beta3_EmptyDirVolumeSource, |
|
| 2366 |
+ deepCopy_v1beta3_EndpointAddress, |
|
| 2367 |
+ deepCopy_v1beta3_EndpointPort, |
|
| 2368 |
+ deepCopy_v1beta3_EndpointSubset, |
|
| 2369 |
+ deepCopy_v1beta3_Endpoints, |
|
| 2370 |
+ deepCopy_v1beta3_EndpointsList, |
|
| 2371 |
+ deepCopy_v1beta3_EnvVar, |
|
| 2372 |
+ deepCopy_v1beta3_EnvVarSource, |
|
| 2373 |
+ deepCopy_v1beta3_Event, |
|
| 2374 |
+ deepCopy_v1beta3_EventList, |
|
| 2375 |
+ deepCopy_v1beta3_EventSource, |
|
| 2376 |
+ deepCopy_v1beta3_ExecAction, |
|
| 2377 |
+ deepCopy_v1beta3_GCEPersistentDiskVolumeSource, |
|
| 2378 |
+ deepCopy_v1beta3_GitRepoVolumeSource, |
|
| 2379 |
+ deepCopy_v1beta3_GlusterfsVolumeSource, |
|
| 2380 |
+ deepCopy_v1beta3_HTTPGetAction, |
|
| 2381 |
+ deepCopy_v1beta3_Handler, |
|
| 2382 |
+ deepCopy_v1beta3_HostPathVolumeSource, |
|
| 2383 |
+ deepCopy_v1beta3_ISCSIVolumeSource, |
|
| 2384 |
+ deepCopy_v1beta3_Lifecycle, |
|
| 2385 |
+ deepCopy_v1beta3_LimitRange, |
|
| 2386 |
+ deepCopy_v1beta3_LimitRangeItem, |
|
| 2387 |
+ deepCopy_v1beta3_LimitRangeList, |
|
| 2388 |
+ deepCopy_v1beta3_LimitRangeSpec, |
|
| 2389 |
+ deepCopy_v1beta3_List, |
|
| 2390 |
+ deepCopy_v1beta3_ListMeta, |
|
| 2391 |
+ deepCopy_v1beta3_ListOptions, |
|
| 2392 |
+ deepCopy_v1beta3_LoadBalancerIngress, |
|
| 2393 |
+ deepCopy_v1beta3_LoadBalancerStatus, |
|
| 2394 |
+ deepCopy_v1beta3_LocalObjectReference, |
|
| 2395 |
+ deepCopy_v1beta3_MetadataFile, |
|
| 2396 |
+ deepCopy_v1beta3_MetadataVolumeSource, |
|
| 2397 |
+ deepCopy_v1beta3_NFSVolumeSource, |
|
| 2398 |
+ deepCopy_v1beta3_Namespace, |
|
| 2399 |
+ deepCopy_v1beta3_NamespaceList, |
|
| 2400 |
+ deepCopy_v1beta3_NamespaceSpec, |
|
| 2401 |
+ deepCopy_v1beta3_NamespaceStatus, |
|
| 2402 |
+ deepCopy_v1beta3_Node, |
|
| 2403 |
+ deepCopy_v1beta3_NodeAddress, |
|
| 2404 |
+ deepCopy_v1beta3_NodeCondition, |
|
| 2405 |
+ deepCopy_v1beta3_NodeList, |
|
| 2406 |
+ deepCopy_v1beta3_NodeSpec, |
|
| 2407 |
+ deepCopy_v1beta3_NodeStatus, |
|
| 2408 |
+ deepCopy_v1beta3_NodeSystemInfo, |
|
| 2409 |
+ deepCopy_v1beta3_ObjectFieldSelector, |
|
| 2410 |
+ deepCopy_v1beta3_ObjectMeta, |
|
| 2411 |
+ deepCopy_v1beta3_ObjectReference, |
|
| 2412 |
+ deepCopy_v1beta3_PersistentVolume, |
|
| 2413 |
+ deepCopy_v1beta3_PersistentVolumeClaim, |
|
| 2414 |
+ deepCopy_v1beta3_PersistentVolumeClaimList, |
|
| 2415 |
+ deepCopy_v1beta3_PersistentVolumeClaimSpec, |
|
| 2416 |
+ deepCopy_v1beta3_PersistentVolumeClaimStatus, |
|
| 2417 |
+ deepCopy_v1beta3_PersistentVolumeClaimVolumeSource, |
|
| 2418 |
+ deepCopy_v1beta3_PersistentVolumeList, |
|
| 2419 |
+ deepCopy_v1beta3_PersistentVolumeSource, |
|
| 2420 |
+ deepCopy_v1beta3_PersistentVolumeSpec, |
|
| 2421 |
+ deepCopy_v1beta3_PersistentVolumeStatus, |
|
| 2422 |
+ deepCopy_v1beta3_Pod, |
|
| 2423 |
+ deepCopy_v1beta3_PodCondition, |
|
| 2424 |
+ deepCopy_v1beta3_PodExecOptions, |
|
| 2425 |
+ deepCopy_v1beta3_PodList, |
|
| 2426 |
+ deepCopy_v1beta3_PodLogOptions, |
|
| 2427 |
+ deepCopy_v1beta3_PodProxyOptions, |
|
| 2428 |
+ deepCopy_v1beta3_PodSpec, |
|
| 2429 |
+ deepCopy_v1beta3_PodStatus, |
|
| 2430 |
+ deepCopy_v1beta3_PodStatusResult, |
|
| 2431 |
+ deepCopy_v1beta3_PodTemplate, |
|
| 2432 |
+ deepCopy_v1beta3_PodTemplateList, |
|
| 2433 |
+ deepCopy_v1beta3_PodTemplateSpec, |
|
| 2434 |
+ deepCopy_v1beta3_Probe, |
|
| 2435 |
+ deepCopy_v1beta3_RBDVolumeSource, |
|
| 2436 |
+ deepCopy_v1beta3_RangeAllocation, |
|
| 2437 |
+ deepCopy_v1beta3_ReplicationController, |
|
| 2438 |
+ deepCopy_v1beta3_ReplicationControllerList, |
|
| 2439 |
+ deepCopy_v1beta3_ReplicationControllerSpec, |
|
| 2440 |
+ deepCopy_v1beta3_ReplicationControllerStatus, |
|
| 2441 |
+ deepCopy_v1beta3_ResourceQuota, |
|
| 2442 |
+ deepCopy_v1beta3_ResourceQuotaList, |
|
| 2443 |
+ deepCopy_v1beta3_ResourceQuotaSpec, |
|
| 2444 |
+ deepCopy_v1beta3_ResourceQuotaStatus, |
|
| 2445 |
+ deepCopy_v1beta3_ResourceRequirements, |
|
| 2446 |
+ deepCopy_v1beta3_RunAsUserStrategyOptions, |
|
| 2447 |
+ deepCopy_v1beta3_SELinuxContextStrategyOptions, |
|
| 2448 |
+ deepCopy_v1beta3_SELinuxOptions, |
|
| 2449 |
+ deepCopy_v1beta3_Secret, |
|
| 2450 |
+ deepCopy_v1beta3_SecretList, |
|
| 2451 |
+ deepCopy_v1beta3_SecretVolumeSource, |
|
| 2452 |
+ deepCopy_v1beta3_SecurityContext, |
|
| 2453 |
+ deepCopy_v1beta3_SecurityContextConstraints, |
|
| 2454 |
+ deepCopy_v1beta3_SecurityContextConstraintsList, |
|
| 2455 |
+ deepCopy_v1beta3_SerializedReference, |
|
| 2456 |
+ deepCopy_v1beta3_Service, |
|
| 2457 |
+ deepCopy_v1beta3_ServiceAccount, |
|
| 2458 |
+ deepCopy_v1beta3_ServiceAccountList, |
|
| 2459 |
+ deepCopy_v1beta3_ServiceList, |
|
| 2460 |
+ deepCopy_v1beta3_ServicePort, |
|
| 2461 |
+ deepCopy_v1beta3_ServiceSpec, |
|
| 2462 |
+ deepCopy_v1beta3_ServiceStatus, |
|
| 2463 |
+ deepCopy_v1beta3_Status, |
|
| 2464 |
+ deepCopy_v1beta3_StatusCause, |
|
| 2465 |
+ deepCopy_v1beta3_StatusDetails, |
|
| 2466 |
+ deepCopy_v1beta3_TCPSocketAction, |
|
| 2467 |
+ deepCopy_v1beta3_TypeMeta, |
|
| 2468 |
+ deepCopy_v1beta3_Volume, |
|
| 2469 |
+ deepCopy_v1beta3_VolumeMount, |
|
| 2470 |
+ deepCopy_v1beta3_VolumeSource, |
|
| 2471 |
+ deepCopy_runtime_RawExtension, |
|
| 2472 |
+ deepCopy_util_IntOrString, |
|
| 2473 |
+ deepCopy_util_Time, |
|
| 2474 |
+ ) |
|
| 2475 |
+ if err != nil {
|
|
| 2476 |
+ // if one of the deep copy functions is malformed, detect it immediately. |
|
| 2477 |
+ panic(err) |
|
| 2478 |
+ } |
|
| 2479 |
+} |
| 0 | 2480 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,218 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2014 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+package v1beta3 |
|
| 17 |
+ |
|
| 18 |
+import ( |
|
| 19 |
+ "strings" |
|
| 20 |
+ |
|
| 21 |
+ "k8s.io/kubernetes/pkg/api" |
|
| 22 |
+ "k8s.io/kubernetes/pkg/util" |
|
| 23 |
+ "github.com/golang/glog" |
|
| 24 |
+) |
|
| 25 |
+ |
|
| 26 |
+func addDefaultingFuncs() {
|
|
| 27 |
+ api.Scheme.AddDefaultingFuncs( |
|
| 28 |
+ func(obj *ReplicationController) {
|
|
| 29 |
+ var labels map[string]string |
|
| 30 |
+ if obj.Spec.Template != nil {
|
|
| 31 |
+ labels = obj.Spec.Template.Labels |
|
| 32 |
+ } |
|
| 33 |
+ // TODO: support templates defined elsewhere when we support them in the API |
|
| 34 |
+ if labels != nil {
|
|
| 35 |
+ if len(obj.Spec.Selector) == 0 {
|
|
| 36 |
+ obj.Spec.Selector = labels |
|
| 37 |
+ } |
|
| 38 |
+ if len(obj.Labels) == 0 {
|
|
| 39 |
+ obj.Labels = labels |
|
| 40 |
+ } |
|
| 41 |
+ } |
|
| 42 |
+ if obj.Spec.Replicas == nil {
|
|
| 43 |
+ obj.Spec.Replicas = new(int) |
|
| 44 |
+ *obj.Spec.Replicas = 0 |
|
| 45 |
+ } |
|
| 46 |
+ }, |
|
| 47 |
+ func(obj *Volume) {
|
|
| 48 |
+ if util.AllPtrFieldsNil(&obj.VolumeSource) {
|
|
| 49 |
+ obj.VolumeSource = VolumeSource{
|
|
| 50 |
+ EmptyDir: &EmptyDirVolumeSource{},
|
|
| 51 |
+ } |
|
| 52 |
+ } |
|
| 53 |
+ }, |
|
| 54 |
+ func(obj *ContainerPort) {
|
|
| 55 |
+ if obj.Protocol == "" {
|
|
| 56 |
+ obj.Protocol = ProtocolTCP |
|
| 57 |
+ } |
|
| 58 |
+ }, |
|
| 59 |
+ func(obj *Container) {
|
|
| 60 |
+ if obj.ImagePullPolicy == "" {
|
|
| 61 |
+ // TODO(dchen1107): Move ParseImageName code to pkg/util |
|
| 62 |
+ parts := strings.Split(obj.Image, ":") |
|
| 63 |
+ // Check image tag |
|
| 64 |
+ if parts[len(parts)-1] == "latest" {
|
|
| 65 |
+ obj.ImagePullPolicy = PullAlways |
|
| 66 |
+ } else {
|
|
| 67 |
+ obj.ImagePullPolicy = PullIfNotPresent |
|
| 68 |
+ } |
|
| 69 |
+ } |
|
| 70 |
+ if obj.TerminationMessagePath == "" {
|
|
| 71 |
+ obj.TerminationMessagePath = TerminationMessagePathDefault |
|
| 72 |
+ } |
|
| 73 |
+ defaultSecurityContext(obj) |
|
| 74 |
+ }, |
|
| 75 |
+ func(obj *ServiceSpec) {
|
|
| 76 |
+ if obj.SessionAffinity == "" {
|
|
| 77 |
+ obj.SessionAffinity = ServiceAffinityNone |
|
| 78 |
+ } |
|
| 79 |
+ if obj.Type == "" {
|
|
| 80 |
+ if obj.CreateExternalLoadBalancer {
|
|
| 81 |
+ obj.Type = ServiceTypeLoadBalancer |
|
| 82 |
+ } else {
|
|
| 83 |
+ obj.Type = ServiceTypeClusterIP |
|
| 84 |
+ } |
|
| 85 |
+ } else if obj.Type == ServiceTypeLoadBalancer {
|
|
| 86 |
+ obj.CreateExternalLoadBalancer = true |
|
| 87 |
+ } |
|
| 88 |
+ for i := range obj.Ports {
|
|
| 89 |
+ sp := &obj.Ports[i] |
|
| 90 |
+ if sp.Protocol == "" {
|
|
| 91 |
+ sp.Protocol = ProtocolTCP |
|
| 92 |
+ } |
|
| 93 |
+ if sp.TargetPort == util.NewIntOrStringFromInt(0) || sp.TargetPort == util.NewIntOrStringFromString("") {
|
|
| 94 |
+ sp.TargetPort = util.NewIntOrStringFromInt(sp.Port) |
|
| 95 |
+ } |
|
| 96 |
+ } |
|
| 97 |
+ }, |
|
| 98 |
+ func(obj *PodSpec) {
|
|
| 99 |
+ if obj.DNSPolicy == "" {
|
|
| 100 |
+ obj.DNSPolicy = DNSClusterFirst |
|
| 101 |
+ } |
|
| 102 |
+ if obj.RestartPolicy == "" {
|
|
| 103 |
+ obj.RestartPolicy = RestartPolicyAlways |
|
| 104 |
+ } |
|
| 105 |
+ if obj.HostNetwork {
|
|
| 106 |
+ defaultHostNetworkPorts(&obj.Containers) |
|
| 107 |
+ } |
|
| 108 |
+ }, |
|
| 109 |
+ func(obj *Probe) {
|
|
| 110 |
+ if obj.TimeoutSeconds == 0 {
|
|
| 111 |
+ obj.TimeoutSeconds = 1 |
|
| 112 |
+ } |
|
| 113 |
+ }, |
|
| 114 |
+ func(obj *Secret) {
|
|
| 115 |
+ if obj.Type == "" {
|
|
| 116 |
+ obj.Type = SecretTypeOpaque |
|
| 117 |
+ } |
|
| 118 |
+ }, |
|
| 119 |
+ func(obj *PersistentVolume) {
|
|
| 120 |
+ if obj.Status.Phase == "" {
|
|
| 121 |
+ obj.Status.Phase = VolumePending |
|
| 122 |
+ } |
|
| 123 |
+ if obj.Spec.PersistentVolumeReclaimPolicy == "" {
|
|
| 124 |
+ obj.Spec.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimRetain |
|
| 125 |
+ } |
|
| 126 |
+ }, |
|
| 127 |
+ func(obj *PersistentVolumeClaim) {
|
|
| 128 |
+ if obj.Status.Phase == "" {
|
|
| 129 |
+ obj.Status.Phase = ClaimPending |
|
| 130 |
+ } |
|
| 131 |
+ }, |
|
| 132 |
+ func(obj *Endpoints) {
|
|
| 133 |
+ for i := range obj.Subsets {
|
|
| 134 |
+ ss := &obj.Subsets[i] |
|
| 135 |
+ for i := range ss.Ports {
|
|
| 136 |
+ ep := &ss.Ports[i] |
|
| 137 |
+ if ep.Protocol == "" {
|
|
| 138 |
+ ep.Protocol = ProtocolTCP |
|
| 139 |
+ } |
|
| 140 |
+ } |
|
| 141 |
+ } |
|
| 142 |
+ }, |
|
| 143 |
+ func(obj *HTTPGetAction) {
|
|
| 144 |
+ if obj.Path == "" {
|
|
| 145 |
+ obj.Path = "/" |
|
| 146 |
+ } |
|
| 147 |
+ if obj.Scheme == "" {
|
|
| 148 |
+ obj.Scheme = URISchemeHTTP |
|
| 149 |
+ } |
|
| 150 |
+ }, |
|
| 151 |
+ func(obj *NamespaceStatus) {
|
|
| 152 |
+ if obj.Phase == "" {
|
|
| 153 |
+ obj.Phase = NamespaceActive |
|
| 154 |
+ } |
|
| 155 |
+ }, |
|
| 156 |
+ func(obj *Node) {
|
|
| 157 |
+ if obj.Spec.ExternalID == "" {
|
|
| 158 |
+ obj.Spec.ExternalID = obj.Name |
|
| 159 |
+ } |
|
| 160 |
+ }, |
|
| 161 |
+ func(obj *ObjectFieldSelector) {
|
|
| 162 |
+ if obj.APIVersion == "" {
|
|
| 163 |
+ obj.APIVersion = "v1beta3" |
|
| 164 |
+ } |
|
| 165 |
+ }, |
|
| 166 |
+ ) |
|
| 167 |
+} |
|
| 168 |
+ |
|
| 169 |
+// With host networking default all container ports to host ports. |
|
| 170 |
+func defaultHostNetworkPorts(containers *[]Container) {
|
|
| 171 |
+ for i := range *containers {
|
|
| 172 |
+ for j := range (*containers)[i].Ports {
|
|
| 173 |
+ if (*containers)[i].Ports[j].HostPort == 0 {
|
|
| 174 |
+ (*containers)[i].Ports[j].HostPort = (*containers)[i].Ports[j].ContainerPort |
|
| 175 |
+ } |
|
| 176 |
+ } |
|
| 177 |
+ } |
|
| 178 |
+} |
|
| 179 |
+ |
|
| 180 |
+// defaultSecurityContext performs the downward and upward merges of a pod definition |
|
| 181 |
+func defaultSecurityContext(container *Container) {
|
|
| 182 |
+ if container.SecurityContext == nil {
|
|
| 183 |
+ if (len(container.Capabilities.Add) == 0) && (len(container.Capabilities.Drop) == 0) && (container.Privileged == false) {
|
|
| 184 |
+ return |
|
| 185 |
+ } |
|
| 186 |
+ glog.V(5).Infof("creating security context for container %s", container.Name)
|
|
| 187 |
+ container.SecurityContext = &SecurityContext{}
|
|
| 188 |
+ } |
|
| 189 |
+ // if there are no capabilities defined on the SecurityContext then copy the container settings |
|
| 190 |
+ if container.SecurityContext.Capabilities == nil {
|
|
| 191 |
+ container.SecurityContext.Capabilities = &container.Capabilities |
|
| 192 |
+ } else {
|
|
| 193 |
+ // if there are capabilities defined on the security context and the container setting is |
|
| 194 |
+ // empty then assume that it was left off the pod definition and ensure that the container |
|
| 195 |
+ // settings match the security context settings (checked by the convert functions). If |
|
| 196 |
+ // there are settings in both then don't touch it, the converter will error if they don't |
|
| 197 |
+ // match |
|
| 198 |
+ if len(container.Capabilities.Add) == 0 {
|
|
| 199 |
+ container.Capabilities.Add = container.SecurityContext.Capabilities.Add |
|
| 200 |
+ } |
|
| 201 |
+ if len(container.Capabilities.Drop) == 0 {
|
|
| 202 |
+ container.Capabilities.Drop = container.SecurityContext.Capabilities.Drop |
|
| 203 |
+ } |
|
| 204 |
+ } |
|
| 205 |
+ // if there are no privileged settings on the security context then copy the container settings |
|
| 206 |
+ if container.SecurityContext.Privileged == nil {
|
|
| 207 |
+ container.SecurityContext.Privileged = &container.Privileged |
|
| 208 |
+ } else {
|
|
| 209 |
+ // we don't have a good way to know if container.Privileged was set or just defaulted to false |
|
| 210 |
+ // so the best we can do here is check if the securityContext is set to true and the |
|
| 211 |
+ // container is set to false and assume that the Privileged field was left off the container |
|
| 212 |
+ // definition and not an intentional mismatch |
|
| 213 |
+ if *container.SecurityContext.Privileged && !container.Privileged {
|
|
| 214 |
+ container.Privileged = *container.SecurityContext.Privileged |
|
| 215 |
+ } |
|
| 216 |
+ } |
|
| 217 |
+} |
| 0 | 218 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,471 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2015 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+package v1beta3_test |
|
| 17 |
+ |
|
| 18 |
+import ( |
|
| 19 |
+ "reflect" |
|
| 20 |
+ "testing" |
|
| 21 |
+ |
|
| 22 |
+ "k8s.io/kubernetes/pkg/api" |
|
| 23 |
+ versioned "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 24 |
+ "k8s.io/kubernetes/pkg/runtime" |
|
| 25 |
+ "k8s.io/kubernetes/pkg/util" |
|
| 26 |
+) |
|
| 27 |
+ |
|
| 28 |
+func roundTrip(t *testing.T, obj runtime.Object) runtime.Object {
|
|
| 29 |
+ data, err := versioned.Codec.Encode(obj) |
|
| 30 |
+ if err != nil {
|
|
| 31 |
+ t.Errorf("%v\n %#v", err, obj)
|
|
| 32 |
+ return nil |
|
| 33 |
+ } |
|
| 34 |
+ obj2, err := api.Codec.Decode(data) |
|
| 35 |
+ if err != nil {
|
|
| 36 |
+ t.Errorf("%v\nData: %s\nSource: %#v", err, string(data), obj)
|
|
| 37 |
+ return nil |
|
| 38 |
+ } |
|
| 39 |
+ obj3 := reflect.New(reflect.TypeOf(obj).Elem()).Interface().(runtime.Object) |
|
| 40 |
+ err = api.Scheme.Convert(obj2, obj3) |
|
| 41 |
+ if err != nil {
|
|
| 42 |
+ t.Errorf("%v\nSource: %#v", err, obj2)
|
|
| 43 |
+ return nil |
|
| 44 |
+ } |
|
| 45 |
+ return obj3 |
|
| 46 |
+} |
|
| 47 |
+ |
|
| 48 |
+func TestSetDefaultReplicationController(t *testing.T) {
|
|
| 49 |
+ tests := []struct {
|
|
| 50 |
+ rc *versioned.ReplicationController |
|
| 51 |
+ expectLabels bool |
|
| 52 |
+ expectSelector bool |
|
| 53 |
+ }{
|
|
| 54 |
+ {
|
|
| 55 |
+ rc: &versioned.ReplicationController{
|
|
| 56 |
+ Spec: versioned.ReplicationControllerSpec{
|
|
| 57 |
+ Template: &versioned.PodTemplateSpec{
|
|
| 58 |
+ ObjectMeta: versioned.ObjectMeta{
|
|
| 59 |
+ Labels: map[string]string{
|
|
| 60 |
+ "foo": "bar", |
|
| 61 |
+ }, |
|
| 62 |
+ }, |
|
| 63 |
+ }, |
|
| 64 |
+ }, |
|
| 65 |
+ }, |
|
| 66 |
+ expectLabels: true, |
|
| 67 |
+ expectSelector: true, |
|
| 68 |
+ }, |
|
| 69 |
+ {
|
|
| 70 |
+ rc: &versioned.ReplicationController{
|
|
| 71 |
+ ObjectMeta: versioned.ObjectMeta{
|
|
| 72 |
+ Labels: map[string]string{
|
|
| 73 |
+ "bar": "foo", |
|
| 74 |
+ }, |
|
| 75 |
+ }, |
|
| 76 |
+ Spec: versioned.ReplicationControllerSpec{
|
|
| 77 |
+ Template: &versioned.PodTemplateSpec{
|
|
| 78 |
+ ObjectMeta: versioned.ObjectMeta{
|
|
| 79 |
+ Labels: map[string]string{
|
|
| 80 |
+ "foo": "bar", |
|
| 81 |
+ }, |
|
| 82 |
+ }, |
|
| 83 |
+ }, |
|
| 84 |
+ }, |
|
| 85 |
+ }, |
|
| 86 |
+ expectLabels: false, |
|
| 87 |
+ expectSelector: true, |
|
| 88 |
+ }, |
|
| 89 |
+ {
|
|
| 90 |
+ rc: &versioned.ReplicationController{
|
|
| 91 |
+ ObjectMeta: versioned.ObjectMeta{
|
|
| 92 |
+ Labels: map[string]string{
|
|
| 93 |
+ "bar": "foo", |
|
| 94 |
+ }, |
|
| 95 |
+ }, |
|
| 96 |
+ Spec: versioned.ReplicationControllerSpec{
|
|
| 97 |
+ Selector: map[string]string{
|
|
| 98 |
+ "some": "other", |
|
| 99 |
+ }, |
|
| 100 |
+ Template: &versioned.PodTemplateSpec{
|
|
| 101 |
+ ObjectMeta: versioned.ObjectMeta{
|
|
| 102 |
+ Labels: map[string]string{
|
|
| 103 |
+ "foo": "bar", |
|
| 104 |
+ }, |
|
| 105 |
+ }, |
|
| 106 |
+ }, |
|
| 107 |
+ }, |
|
| 108 |
+ }, |
|
| 109 |
+ expectLabels: false, |
|
| 110 |
+ expectSelector: false, |
|
| 111 |
+ }, |
|
| 112 |
+ {
|
|
| 113 |
+ rc: &versioned.ReplicationController{
|
|
| 114 |
+ Spec: versioned.ReplicationControllerSpec{
|
|
| 115 |
+ Selector: map[string]string{
|
|
| 116 |
+ "some": "other", |
|
| 117 |
+ }, |
|
| 118 |
+ Template: &versioned.PodTemplateSpec{
|
|
| 119 |
+ ObjectMeta: versioned.ObjectMeta{
|
|
| 120 |
+ Labels: map[string]string{
|
|
| 121 |
+ "foo": "bar", |
|
| 122 |
+ }, |
|
| 123 |
+ }, |
|
| 124 |
+ }, |
|
| 125 |
+ }, |
|
| 126 |
+ }, |
|
| 127 |
+ expectLabels: true, |
|
| 128 |
+ expectSelector: false, |
|
| 129 |
+ }, |
|
| 130 |
+ } |
|
| 131 |
+ |
|
| 132 |
+ for _, test := range tests {
|
|
| 133 |
+ rc := test.rc |
|
| 134 |
+ obj2 := roundTrip(t, runtime.Object(rc)) |
|
| 135 |
+ rc2, ok := obj2.(*versioned.ReplicationController) |
|
| 136 |
+ if !ok {
|
|
| 137 |
+ t.Errorf("unexpected object: %v", rc2)
|
|
| 138 |
+ t.FailNow() |
|
| 139 |
+ } |
|
| 140 |
+ if test.expectSelector != reflect.DeepEqual(rc2.Spec.Selector, rc2.Spec.Template.Labels) {
|
|
| 141 |
+ if test.expectSelector {
|
|
| 142 |
+ t.Errorf("expected: %v, got: %v", rc2.Spec.Template.Labels, rc2.Spec.Selector)
|
|
| 143 |
+ } else {
|
|
| 144 |
+ t.Errorf("unexpected equality: %v", rc.Spec.Selector)
|
|
| 145 |
+ } |
|
| 146 |
+ } |
|
| 147 |
+ if test.expectLabels != reflect.DeepEqual(rc2.Labels, rc2.Spec.Template.Labels) {
|
|
| 148 |
+ if test.expectLabels {
|
|
| 149 |
+ t.Errorf("expected: %v, got: %v", rc2.Spec.Template.Labels, rc2.Labels)
|
|
| 150 |
+ } else {
|
|
| 151 |
+ t.Errorf("unexpected equality: %v", rc.Labels)
|
|
| 152 |
+ } |
|
| 153 |
+ } |
|
| 154 |
+ } |
|
| 155 |
+} |
|
| 156 |
+ |
|
| 157 |
+func TestSetDefaultService(t *testing.T) {
|
|
| 158 |
+ svc := &versioned.Service{}
|
|
| 159 |
+ obj2 := roundTrip(t, runtime.Object(svc)) |
|
| 160 |
+ svc2 := obj2.(*versioned.Service) |
|
| 161 |
+ if svc2.Spec.SessionAffinity != versioned.ServiceAffinityNone {
|
|
| 162 |
+ t.Errorf("Expected default session affinity type:%s, got: %s", versioned.ServiceAffinityNone, svc2.Spec.SessionAffinity)
|
|
| 163 |
+ } |
|
| 164 |
+ if svc2.Spec.Type != versioned.ServiceTypeClusterIP {
|
|
| 165 |
+ t.Errorf("Expected default type:%s, got: %s", versioned.ServiceTypeClusterIP, svc2.Spec.Type)
|
|
| 166 |
+ } |
|
| 167 |
+} |
|
| 168 |
+ |
|
| 169 |
+func TestSetDefaultServiceWithLoadbalancer(t *testing.T) {
|
|
| 170 |
+ svc := &versioned.Service{}
|
|
| 171 |
+ svc.Spec.CreateExternalLoadBalancer = true |
|
| 172 |
+ obj2 := roundTrip(t, runtime.Object(svc)) |
|
| 173 |
+ svc2 := obj2.(*versioned.Service) |
|
| 174 |
+ if svc2.Spec.Type != versioned.ServiceTypeLoadBalancer {
|
|
| 175 |
+ t.Errorf("Expected default type:%s, got: %s", versioned.ServiceTypeLoadBalancer, svc2.Spec.Type)
|
|
| 176 |
+ } |
|
| 177 |
+} |
|
| 178 |
+ |
|
| 179 |
+func TestSetDefaultSecret(t *testing.T) {
|
|
| 180 |
+ s := &versioned.Secret{}
|
|
| 181 |
+ obj2 := roundTrip(t, runtime.Object(s)) |
|
| 182 |
+ s2 := obj2.(*versioned.Secret) |
|
| 183 |
+ |
|
| 184 |
+ if s2.Type != versioned.SecretTypeOpaque {
|
|
| 185 |
+ t.Errorf("Expected secret type %v, got %v", versioned.SecretTypeOpaque, s2.Type)
|
|
| 186 |
+ } |
|
| 187 |
+} |
|
| 188 |
+ |
|
| 189 |
+func TestSetDefaultPersistentVolume(t *testing.T) {
|
|
| 190 |
+ pv := &versioned.PersistentVolume{}
|
|
| 191 |
+ obj2 := roundTrip(t, runtime.Object(pv)) |
|
| 192 |
+ pv2 := obj2.(*versioned.PersistentVolume) |
|
| 193 |
+ |
|
| 194 |
+ if pv2.Status.Phase != versioned.VolumePending {
|
|
| 195 |
+ t.Errorf("Expected volume phase %v, got %v", versioned.VolumePending, pv2.Status.Phase)
|
|
| 196 |
+ } |
|
| 197 |
+ if pv2.Spec.PersistentVolumeReclaimPolicy != versioned.PersistentVolumeReclaimRetain {
|
|
| 198 |
+ t.Errorf("Expected pv reclaim policy %v, got %v", versioned.PersistentVolumeReclaimRetain, pv2.Spec.PersistentVolumeReclaimPolicy)
|
|
| 199 |
+ } |
|
| 200 |
+} |
|
| 201 |
+ |
|
| 202 |
+func TestSetDefaultPersistentVolumeClaim(t *testing.T) {
|
|
| 203 |
+ pvc := &versioned.PersistentVolumeClaim{}
|
|
| 204 |
+ obj2 := roundTrip(t, runtime.Object(pvc)) |
|
| 205 |
+ pvc2 := obj2.(*versioned.PersistentVolumeClaim) |
|
| 206 |
+ |
|
| 207 |
+ if pvc2.Status.Phase != versioned.ClaimPending {
|
|
| 208 |
+ t.Errorf("Expected claim phase %v, got %v", versioned.ClaimPending, pvc2.Status.Phase)
|
|
| 209 |
+ } |
|
| 210 |
+} |
|
| 211 |
+ |
|
| 212 |
+func TestSetDefaulEndpointsProtocol(t *testing.T) {
|
|
| 213 |
+ in := &versioned.Endpoints{Subsets: []versioned.EndpointSubset{
|
|
| 214 |
+ {Ports: []versioned.EndpointPort{{}, {Protocol: "UDP"}, {}}},
|
|
| 215 |
+ }} |
|
| 216 |
+ obj := roundTrip(t, runtime.Object(in)) |
|
| 217 |
+ out := obj.(*versioned.Endpoints) |
|
| 218 |
+ |
|
| 219 |
+ for i := range out.Subsets {
|
|
| 220 |
+ for j := range out.Subsets[i].Ports {
|
|
| 221 |
+ if in.Subsets[i].Ports[j].Protocol == "" {
|
|
| 222 |
+ if out.Subsets[i].Ports[j].Protocol != versioned.ProtocolTCP {
|
|
| 223 |
+ t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Subsets[i].Ports[j].Protocol)
|
|
| 224 |
+ } |
|
| 225 |
+ } else {
|
|
| 226 |
+ if out.Subsets[i].Ports[j].Protocol != in.Subsets[i].Ports[j].Protocol {
|
|
| 227 |
+ t.Errorf("Expected protocol %s, got %s", in.Subsets[i].Ports[j].Protocol, out.Subsets[i].Ports[j].Protocol)
|
|
| 228 |
+ } |
|
| 229 |
+ } |
|
| 230 |
+ } |
|
| 231 |
+ } |
|
| 232 |
+} |
|
| 233 |
+ |
|
| 234 |
+func TestSetDefaulServiceTargetPort(t *testing.T) {
|
|
| 235 |
+ in := &versioned.Service{Spec: versioned.ServiceSpec{Ports: []versioned.ServicePort{{Port: 1234}}}}
|
|
| 236 |
+ obj := roundTrip(t, runtime.Object(in)) |
|
| 237 |
+ out := obj.(*versioned.Service) |
|
| 238 |
+ if out.Spec.Ports[0].TargetPort != util.NewIntOrStringFromInt(1234) {
|
|
| 239 |
+ t.Errorf("Expected TargetPort to be defaulted, got %s", out.Spec.Ports[0].TargetPort)
|
|
| 240 |
+ } |
|
| 241 |
+ |
|
| 242 |
+ in = &versioned.Service{Spec: versioned.ServiceSpec{Ports: []versioned.ServicePort{{Port: 1234, TargetPort: util.NewIntOrStringFromInt(5678)}}}}
|
|
| 243 |
+ obj = roundTrip(t, runtime.Object(in)) |
|
| 244 |
+ out = obj.(*versioned.Service) |
|
| 245 |
+ if out.Spec.Ports[0].TargetPort != util.NewIntOrStringFromInt(5678) {
|
|
| 246 |
+ t.Errorf("Expected TargetPort to be unchanged, got %s", out.Spec.Ports[0].TargetPort)
|
|
| 247 |
+ } |
|
| 248 |
+} |
|
| 249 |
+ |
|
| 250 |
+func TestSetDefaultServicePort(t *testing.T) {
|
|
| 251 |
+ // Unchanged if set. |
|
| 252 |
+ in := &versioned.Service{Spec: versioned.ServiceSpec{
|
|
| 253 |
+ Ports: []versioned.ServicePort{
|
|
| 254 |
+ {Protocol: "UDP", Port: 9376, TargetPort: util.NewIntOrStringFromString("p")},
|
|
| 255 |
+ {Protocol: "UDP", Port: 8675, TargetPort: util.NewIntOrStringFromInt(309)},
|
|
| 256 |
+ }, |
|
| 257 |
+ }} |
|
| 258 |
+ out := roundTrip(t, runtime.Object(in)).(*versioned.Service) |
|
| 259 |
+ if out.Spec.Ports[0].Protocol != versioned.ProtocolUDP {
|
|
| 260 |
+ t.Errorf("Expected protocol %s, got %s", versioned.ProtocolUDP, out.Spec.Ports[0].Protocol)
|
|
| 261 |
+ } |
|
| 262 |
+ if out.Spec.Ports[0].TargetPort != util.NewIntOrStringFromString("p") {
|
|
| 263 |
+ t.Errorf("Expected port %d, got %s", in.Spec.Ports[0].Port, out.Spec.Ports[0].TargetPort)
|
|
| 264 |
+ } |
|
| 265 |
+ if out.Spec.Ports[1].Protocol != versioned.ProtocolUDP {
|
|
| 266 |
+ t.Errorf("Expected protocol %s, got %s", versioned.ProtocolUDP, out.Spec.Ports[1].Protocol)
|
|
| 267 |
+ } |
|
| 268 |
+ if out.Spec.Ports[1].TargetPort != util.NewIntOrStringFromInt(309) {
|
|
| 269 |
+ t.Errorf("Expected port %d, got %s", in.Spec.Ports[1].Port, out.Spec.Ports[1].TargetPort)
|
|
| 270 |
+ } |
|
| 271 |
+ |
|
| 272 |
+ // Defaulted. |
|
| 273 |
+ in = &versioned.Service{Spec: versioned.ServiceSpec{
|
|
| 274 |
+ Ports: []versioned.ServicePort{
|
|
| 275 |
+ {Protocol: "", Port: 9376, TargetPort: util.NewIntOrStringFromString("")},
|
|
| 276 |
+ {Protocol: "", Port: 8675, TargetPort: util.NewIntOrStringFromInt(0)},
|
|
| 277 |
+ }, |
|
| 278 |
+ }} |
|
| 279 |
+ out = roundTrip(t, runtime.Object(in)).(*versioned.Service) |
|
| 280 |
+ if out.Spec.Ports[0].Protocol != versioned.ProtocolTCP {
|
|
| 281 |
+ t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Spec.Ports[0].Protocol)
|
|
| 282 |
+ } |
|
| 283 |
+ if out.Spec.Ports[0].TargetPort != util.NewIntOrStringFromInt(in.Spec.Ports[0].Port) {
|
|
| 284 |
+ t.Errorf("Expected port %d, got %d", in.Spec.Ports[0].Port, out.Spec.Ports[0].TargetPort)
|
|
| 285 |
+ } |
|
| 286 |
+ if out.Spec.Ports[1].Protocol != versioned.ProtocolTCP {
|
|
| 287 |
+ t.Errorf("Expected protocol %s, got %s", versioned.ProtocolTCP, out.Spec.Ports[1].Protocol)
|
|
| 288 |
+ } |
|
| 289 |
+ if out.Spec.Ports[1].TargetPort != util.NewIntOrStringFromInt(in.Spec.Ports[1].Port) {
|
|
| 290 |
+ t.Errorf("Expected port %d, got %d", in.Spec.Ports[1].Port, out.Spec.Ports[1].TargetPort)
|
|
| 291 |
+ } |
|
| 292 |
+} |
|
| 293 |
+ |
|
| 294 |
+func TestSetDefaultNamespace(t *testing.T) {
|
|
| 295 |
+ s := &versioned.Namespace{}
|
|
| 296 |
+ obj2 := roundTrip(t, runtime.Object(s)) |
|
| 297 |
+ s2 := obj2.(*versioned.Namespace) |
|
| 298 |
+ |
|
| 299 |
+ if s2.Status.Phase != versioned.NamespaceActive {
|
|
| 300 |
+ t.Errorf("Expected phase %v, got %v", versioned.NamespaceActive, s2.Status.Phase)
|
|
| 301 |
+ } |
|
| 302 |
+} |
|
| 303 |
+ |
|
| 304 |
+func TestSetDefaultPodSpecHostNetwork(t *testing.T) {
|
|
| 305 |
+ portNum := 8080 |
|
| 306 |
+ s := versioned.PodSpec{}
|
|
| 307 |
+ s.HostNetwork = true |
|
| 308 |
+ s.Containers = []versioned.Container{
|
|
| 309 |
+ {
|
|
| 310 |
+ Ports: []versioned.ContainerPort{
|
|
| 311 |
+ {
|
|
| 312 |
+ ContainerPort: portNum, |
|
| 313 |
+ }, |
|
| 314 |
+ }, |
|
| 315 |
+ }, |
|
| 316 |
+ } |
|
| 317 |
+ pod := &versioned.Pod{
|
|
| 318 |
+ Spec: s, |
|
| 319 |
+ } |
|
| 320 |
+ obj2 := roundTrip(t, runtime.Object(pod)) |
|
| 321 |
+ pod2 := obj2.(*versioned.Pod) |
|
| 322 |
+ s2 := pod2.Spec |
|
| 323 |
+ |
|
| 324 |
+ hostPortNum := s2.Containers[0].Ports[0].HostPort |
|
| 325 |
+ if hostPortNum != portNum {
|
|
| 326 |
+ t.Errorf("Expected container port to be defaulted, was made %d instead of %d", hostPortNum, portNum)
|
|
| 327 |
+ } |
|
| 328 |
+} |
|
| 329 |
+ |
|
| 330 |
+func TestSetDefaultNodeExternalID(t *testing.T) {
|
|
| 331 |
+ name := "node0" |
|
| 332 |
+ n := &versioned.Node{}
|
|
| 333 |
+ n.Name = name |
|
| 334 |
+ obj2 := roundTrip(t, runtime.Object(n)) |
|
| 335 |
+ n2 := obj2.(*versioned.Node) |
|
| 336 |
+ if n2.Spec.ExternalID != name {
|
|
| 337 |
+ t.Errorf("Expected default External ID: %s, got: %s", name, n2.Spec.ExternalID)
|
|
| 338 |
+ } |
|
| 339 |
+ if n2.Spec.ProviderID != "" {
|
|
| 340 |
+ t.Errorf("Expected empty default Cloud Provider ID, got: %s", n2.Spec.ProviderID)
|
|
| 341 |
+ } |
|
| 342 |
+} |
|
| 343 |
+ |
|
| 344 |
+func TestSetDefaultObjectFieldSelectorAPIVersion(t *testing.T) {
|
|
| 345 |
+ s := versioned.PodSpec{
|
|
| 346 |
+ Containers: []versioned.Container{
|
|
| 347 |
+ {
|
|
| 348 |
+ Env: []versioned.EnvVar{
|
|
| 349 |
+ {
|
|
| 350 |
+ ValueFrom: &versioned.EnvVarSource{
|
|
| 351 |
+ FieldRef: &versioned.ObjectFieldSelector{},
|
|
| 352 |
+ }, |
|
| 353 |
+ }, |
|
| 354 |
+ }, |
|
| 355 |
+ }, |
|
| 356 |
+ }, |
|
| 357 |
+ } |
|
| 358 |
+ pod := &versioned.Pod{
|
|
| 359 |
+ Spec: s, |
|
| 360 |
+ } |
|
| 361 |
+ obj2 := roundTrip(t, runtime.Object(pod)) |
|
| 362 |
+ pod2 := obj2.(*versioned.Pod) |
|
| 363 |
+ s2 := pod2.Spec |
|
| 364 |
+ |
|
| 365 |
+ apiVersion := s2.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion |
|
| 366 |
+ if apiVersion != "v1beta3" {
|
|
| 367 |
+ t.Errorf("Expected default APIVersion v1beta3, got: %v", apiVersion)
|
|
| 368 |
+ } |
|
| 369 |
+} |
|
| 370 |
+ |
|
| 371 |
+func TestSetDefaultSecurityContext(t *testing.T) {
|
|
| 372 |
+ priv := false |
|
| 373 |
+ privTrue := true |
|
| 374 |
+ testCases := map[string]struct {
|
|
| 375 |
+ c versioned.Container |
|
| 376 |
+ }{
|
|
| 377 |
+ "downward defaulting caps": {
|
|
| 378 |
+ c: versioned.Container{
|
|
| 379 |
+ Privileged: false, |
|
| 380 |
+ Capabilities: versioned.Capabilities{
|
|
| 381 |
+ Add: []versioned.Capability{"foo"},
|
|
| 382 |
+ Drop: []versioned.Capability{"bar"},
|
|
| 383 |
+ }, |
|
| 384 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 385 |
+ Privileged: &priv, |
|
| 386 |
+ }, |
|
| 387 |
+ }, |
|
| 388 |
+ }, |
|
| 389 |
+ "downward defaulting priv": {
|
|
| 390 |
+ c: versioned.Container{
|
|
| 391 |
+ Privileged: false, |
|
| 392 |
+ Capabilities: versioned.Capabilities{
|
|
| 393 |
+ Add: []versioned.Capability{"foo"},
|
|
| 394 |
+ Drop: []versioned.Capability{"bar"},
|
|
| 395 |
+ }, |
|
| 396 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 397 |
+ Capabilities: &versioned.Capabilities{
|
|
| 398 |
+ Add: []versioned.Capability{"foo"},
|
|
| 399 |
+ Drop: []versioned.Capability{"bar"},
|
|
| 400 |
+ }, |
|
| 401 |
+ }, |
|
| 402 |
+ }, |
|
| 403 |
+ }, |
|
| 404 |
+ "upward defaulting caps": {
|
|
| 405 |
+ c: versioned.Container{
|
|
| 406 |
+ Privileged: false, |
|
| 407 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 408 |
+ Privileged: &priv, |
|
| 409 |
+ Capabilities: &versioned.Capabilities{
|
|
| 410 |
+ Add: []versioned.Capability{"biz"},
|
|
| 411 |
+ Drop: []versioned.Capability{"baz"},
|
|
| 412 |
+ }, |
|
| 413 |
+ }, |
|
| 414 |
+ }, |
|
| 415 |
+ }, |
|
| 416 |
+ "upward defaulting priv": {
|
|
| 417 |
+ c: versioned.Container{
|
|
| 418 |
+ Capabilities: versioned.Capabilities{
|
|
| 419 |
+ Add: []versioned.Capability{"foo"},
|
|
| 420 |
+ Drop: []versioned.Capability{"bar"},
|
|
| 421 |
+ }, |
|
| 422 |
+ SecurityContext: &versioned.SecurityContext{
|
|
| 423 |
+ Privileged: &privTrue, |
|
| 424 |
+ Capabilities: &versioned.Capabilities{
|
|
| 425 |
+ Add: []versioned.Capability{"foo"},
|
|
| 426 |
+ Drop: []versioned.Capability{"bar"},
|
|
| 427 |
+ }, |
|
| 428 |
+ }, |
|
| 429 |
+ }, |
|
| 430 |
+ }, |
|
| 431 |
+ } |
|
| 432 |
+ |
|
| 433 |
+ pod := &versioned.Pod{
|
|
| 434 |
+ Spec: versioned.PodSpec{},
|
|
| 435 |
+ } |
|
| 436 |
+ |
|
| 437 |
+ for k, v := range testCases {
|
|
| 438 |
+ pod.Spec.Containers = []versioned.Container{v.c}
|
|
| 439 |
+ obj := roundTrip(t, runtime.Object(pod)) |
|
| 440 |
+ defaultedPod := obj.(*versioned.Pod) |
|
| 441 |
+ c := defaultedPod.Spec.Containers[0] |
|
| 442 |
+ if isEqual, issues := areSecurityContextAndContainerEqual(&c); !isEqual {
|
|
| 443 |
+ t.Errorf("test case %s expected the security context to have the same values as the container but found %#v", k, issues)
|
|
| 444 |
+ } |
|
| 445 |
+ } |
|
| 446 |
+} |
|
| 447 |
+ |
|
| 448 |
+func areSecurityContextAndContainerEqual(c *versioned.Container) (bool, []string) {
|
|
| 449 |
+ issues := make([]string, 0) |
|
| 450 |
+ equal := true |
|
| 451 |
+ |
|
| 452 |
+ if c.SecurityContext == nil || c.SecurityContext.Privileged == nil || c.SecurityContext.Capabilities == nil {
|
|
| 453 |
+ equal = false |
|
| 454 |
+ issues = append(issues, "Expected non nil settings for SecurityContext") |
|
| 455 |
+ return equal, issues |
|
| 456 |
+ } |
|
| 457 |
+ if *c.SecurityContext.Privileged != c.Privileged {
|
|
| 458 |
+ equal = false |
|
| 459 |
+ issues = append(issues, "The defaulted SecurityContext.Privileged value did not match the container value") |
|
| 460 |
+ } |
|
| 461 |
+ if !reflect.DeepEqual(c.Capabilities.Add, c.Capabilities.Add) {
|
|
| 462 |
+ equal = false |
|
| 463 |
+ issues = append(issues, "The defaulted SecurityContext.Capabilities.Add did not match the container settings") |
|
| 464 |
+ } |
|
| 465 |
+ if !reflect.DeepEqual(c.Capabilities.Drop, c.Capabilities.Drop) {
|
|
| 466 |
+ equal = false |
|
| 467 |
+ issues = append(issues, "The defaulted SecurityContext.Capabilities.Drop did not match the container settings") |
|
| 468 |
+ } |
|
| 469 |
+ return equal, issues |
|
| 470 |
+} |
| 0 | 471 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,134 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2014 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+package v1beta3 |
|
| 17 |
+ |
|
| 18 |
+import ( |
|
| 19 |
+ "k8s.io/kubernetes/pkg/api" |
|
| 20 |
+ "k8s.io/kubernetes/pkg/api/registered" |
|
| 21 |
+ "k8s.io/kubernetes/pkg/runtime" |
|
| 22 |
+) |
|
| 23 |
+ |
|
| 24 |
+// Codec encodes internal objects to the v1beta3 scheme |
|
| 25 |
+var Codec = runtime.CodecFor(api.Scheme, "v1beta3") |
|
| 26 |
+ |
|
| 27 |
+func init() {
|
|
| 28 |
+ // Check if v1beta3 is in the list of supported API versions. |
|
| 29 |
+ if !registered.IsRegisteredAPIVersion("v1beta3") {
|
|
| 30 |
+ return |
|
| 31 |
+ } |
|
| 32 |
+ |
|
| 33 |
+ // Register the API. |
|
| 34 |
+ addKnownTypes() |
|
| 35 |
+ addConversionFuncs() |
|
| 36 |
+ addDefaultingFuncs() |
|
| 37 |
+} |
|
| 38 |
+ |
|
| 39 |
+// Adds the list of known types to api.Scheme. |
|
| 40 |
+func addKnownTypes() {
|
|
| 41 |
+ api.Scheme.AddKnownTypes("v1beta3",
|
|
| 42 |
+ &Pod{},
|
|
| 43 |
+ &PodList{},
|
|
| 44 |
+ &PodStatusResult{},
|
|
| 45 |
+ &PodTemplate{},
|
|
| 46 |
+ &PodTemplateList{},
|
|
| 47 |
+ &ReplicationController{},
|
|
| 48 |
+ &ReplicationControllerList{},
|
|
| 49 |
+ &Service{},
|
|
| 50 |
+ &ServiceList{},
|
|
| 51 |
+ &Endpoints{},
|
|
| 52 |
+ &EndpointsList{},
|
|
| 53 |
+ &Node{},
|
|
| 54 |
+ &NodeList{},
|
|
| 55 |
+ &Binding{},
|
|
| 56 |
+ &Status{},
|
|
| 57 |
+ &Event{},
|
|
| 58 |
+ &EventList{},
|
|
| 59 |
+ &List{},
|
|
| 60 |
+ &LimitRange{},
|
|
| 61 |
+ &LimitRangeList{},
|
|
| 62 |
+ &ResourceQuota{},
|
|
| 63 |
+ &ResourceQuotaList{},
|
|
| 64 |
+ &Namespace{},
|
|
| 65 |
+ &NamespaceList{},
|
|
| 66 |
+ &Secret{},
|
|
| 67 |
+ &SecretList{},
|
|
| 68 |
+ &ServiceAccount{},
|
|
| 69 |
+ &ServiceAccountList{},
|
|
| 70 |
+ &PersistentVolume{},
|
|
| 71 |
+ &PersistentVolumeList{},
|
|
| 72 |
+ &PersistentVolumeClaim{},
|
|
| 73 |
+ &PersistentVolumeClaimList{},
|
|
| 74 |
+ &DeleteOptions{},
|
|
| 75 |
+ &ListOptions{},
|
|
| 76 |
+ &PodLogOptions{},
|
|
| 77 |
+ &PodExecOptions{},
|
|
| 78 |
+ &PodProxyOptions{},
|
|
| 79 |
+ &ComponentStatus{},
|
|
| 80 |
+ &ComponentStatusList{},
|
|
| 81 |
+ &SerializedReference{},
|
|
| 82 |
+ &RangeAllocation{},
|
|
| 83 |
+ &SecurityContextConstraints{},
|
|
| 84 |
+ &SecurityContextConstraintsList{},
|
|
| 85 |
+ ) |
|
| 86 |
+ // Legacy names are supported |
|
| 87 |
+ api.Scheme.AddKnownTypeWithName("v1beta3", "Minion", &Node{})
|
|
| 88 |
+ api.Scheme.AddKnownTypeWithName("v1beta3", "MinionList", &NodeList{})
|
|
| 89 |
+} |
|
| 90 |
+ |
|
| 91 |
+func (*Pod) IsAnAPIObject() {}
|
|
| 92 |
+func (*PodList) IsAnAPIObject() {}
|
|
| 93 |
+func (*PodStatusResult) IsAnAPIObject() {}
|
|
| 94 |
+func (*PodTemplate) IsAnAPIObject() {}
|
|
| 95 |
+func (*PodTemplateList) IsAnAPIObject() {}
|
|
| 96 |
+func (*ReplicationController) IsAnAPIObject() {}
|
|
| 97 |
+func (*ReplicationControllerList) IsAnAPIObject() {}
|
|
| 98 |
+func (*Service) IsAnAPIObject() {}
|
|
| 99 |
+func (*ServiceList) IsAnAPIObject() {}
|
|
| 100 |
+func (*Endpoints) IsAnAPIObject() {}
|
|
| 101 |
+func (*EndpointsList) IsAnAPIObject() {}
|
|
| 102 |
+func (*Node) IsAnAPIObject() {}
|
|
| 103 |
+func (*NodeList) IsAnAPIObject() {}
|
|
| 104 |
+func (*Binding) IsAnAPIObject() {}
|
|
| 105 |
+func (*Status) IsAnAPIObject() {}
|
|
| 106 |
+func (*Event) IsAnAPIObject() {}
|
|
| 107 |
+func (*EventList) IsAnAPIObject() {}
|
|
| 108 |
+func (*List) IsAnAPIObject() {}
|
|
| 109 |
+func (*LimitRange) IsAnAPIObject() {}
|
|
| 110 |
+func (*LimitRangeList) IsAnAPIObject() {}
|
|
| 111 |
+func (*ResourceQuota) IsAnAPIObject() {}
|
|
| 112 |
+func (*ResourceQuotaList) IsAnAPIObject() {}
|
|
| 113 |
+func (*Namespace) IsAnAPIObject() {}
|
|
| 114 |
+func (*NamespaceList) IsAnAPIObject() {}
|
|
| 115 |
+func (*Secret) IsAnAPIObject() {}
|
|
| 116 |
+func (*SecretList) IsAnAPIObject() {}
|
|
| 117 |
+func (*ServiceAccount) IsAnAPIObject() {}
|
|
| 118 |
+func (*ServiceAccountList) IsAnAPIObject() {}
|
|
| 119 |
+func (*PersistentVolume) IsAnAPIObject() {}
|
|
| 120 |
+func (*PersistentVolumeList) IsAnAPIObject() {}
|
|
| 121 |
+func (*PersistentVolumeClaim) IsAnAPIObject() {}
|
|
| 122 |
+func (*PersistentVolumeClaimList) IsAnAPIObject() {}
|
|
| 123 |
+func (*DeleteOptions) IsAnAPIObject() {}
|
|
| 124 |
+func (*ListOptions) IsAnAPIObject() {}
|
|
| 125 |
+func (*PodLogOptions) IsAnAPIObject() {}
|
|
| 126 |
+func (*PodExecOptions) IsAnAPIObject() {}
|
|
| 127 |
+func (*PodProxyOptions) IsAnAPIObject() {}
|
|
| 128 |
+func (*ComponentStatus) IsAnAPIObject() {}
|
|
| 129 |
+func (*ComponentStatusList) IsAnAPIObject() {}
|
|
| 130 |
+func (*SerializedReference) IsAnAPIObject() {}
|
|
| 131 |
+func (*RangeAllocation) IsAnAPIObject() {}
|
|
| 132 |
+func (*SecurityContextConstraints) IsAnAPIObject() {}
|
|
| 133 |
+func (*SecurityContextConstraintsList) IsAnAPIObject() {}
|
| 0 | 134 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,2141 @@ |
| 0 |
+/* |
|
| 1 |
+Copyright 2014 The Kubernetes Authors All rights reserved. |
|
| 2 |
+ |
|
| 3 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 4 |
+you may not use this file except in compliance with the License. |
|
| 5 |
+You may obtain a copy of the License at |
|
| 6 |
+ |
|
| 7 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 8 |
+ |
|
| 9 |
+Unless required by applicable law or agreed to in writing, software |
|
| 10 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 |
+See the License for the specific language governing permissions and |
|
| 13 |
+limitations under the License. |
|
| 14 |
+*/ |
|
| 15 |
+ |
|
| 16 |
+package v1beta3 |
|
| 17 |
+ |
|
| 18 |
+import ( |
|
| 19 |
+ "k8s.io/kubernetes/pkg/api/resource" |
|
| 20 |
+ "k8s.io/kubernetes/pkg/runtime" |
|
| 21 |
+ "k8s.io/kubernetes/pkg/types" |
|
| 22 |
+ "k8s.io/kubernetes/pkg/util" |
|
| 23 |
+) |
|
| 24 |
+ |
|
| 25 |
+// Common string formats |
|
| 26 |
+// --------------------- |
|
| 27 |
+// Many fields in this API have formatting requirements. The commonly used |
|
| 28 |
+// formats are defined here. |
|
| 29 |
+// |
|
| 30 |
+// C_IDENTIFIER: This is a string that conforms to the definition of an "identifier" |
|
| 31 |
+// in the C language. This is captured by the following regex: |
|
| 32 |
+// [A-Za-z_][A-Za-z0-9_]* |
|
| 33 |
+// This defines the format, but not the length restriction, which should be |
|
| 34 |
+// specified at the definition of any field of this type. |
|
| 35 |
+// |
|
| 36 |
+// DNS_LABEL: This is a string, no more than 63 characters long, that conforms |
|
| 37 |
+// to the definition of a "label" in RFCs 1035 and 1123. This is captured |
|
| 38 |
+// by the following regex: |
|
| 39 |
+// [a-z0-9]([-a-z0-9]*[a-z0-9])? |
|
| 40 |
+// |
|
| 41 |
+// DNS_SUBDOMAIN: This is a string, no more than 253 characters long, that conforms |
|
| 42 |
+// to the definition of a "subdomain" in RFCs 1035 and 1123. This is captured |
|
| 43 |
+// by the following regex: |
|
| 44 |
+// [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* |
|
| 45 |
+// or more simply: |
|
| 46 |
+// DNS_LABEL(\.DNS_LABEL)* |
|
| 47 |
+// |
|
| 48 |
+// IANA_SVC_NAME: This is a string, no more than 15 characters long, that |
|
| 49 |
+// conforms to the definition of IANA service name in RFC 6335. |
|
| 50 |
+// It must contains at least one letter [a-z] and it must contains only [a-z0-9-]. |
|
| 51 |
+// Hypens ('-') cannot be leading or trailing character of the string
|
|
| 52 |
+// and cannot be adjacent to other hyphens. |
|
| 53 |
+ |
|
| 54 |
+// TypeMeta describes an individual object in an API response or request |
|
| 55 |
+// with strings representing the type of the object and its API schema version. |
|
| 56 |
+// Structures that are versioned or persisted should inline TypeMeta. |
|
| 57 |
+type TypeMeta struct {
|
|
| 58 |
+ // Kind is a string value representing the REST resource this object represents. |
|
| 59 |
+ // Servers may infer this from the endpoint the client submits requests to. |
|
| 60 |
+ Kind string `json:"kind,omitempty" description:"kind of object, in CamelCase; cannot be updated"` |
|
| 61 |
+ |
|
| 62 |
+ // APIVersion defines the versioned schema of this representation of an object. |
|
| 63 |
+ // Servers should convert recognized schemas to the latest internal value, and |
|
| 64 |
+ // may reject unrecognized values. |
|
| 65 |
+ APIVersion string `json:"apiVersion,omitempty" description:"version of the schema the object should have"` |
|
| 66 |
+} |
|
| 67 |
+ |
|
| 68 |
+// ListMeta describes metadata that synthetic resources must have, including lists and |
|
| 69 |
+// various status objects. |
|
| 70 |
+type ListMeta struct {
|
|
| 71 |
+ // SelfLink is a URL representing this object. |
|
| 72 |
+ SelfLink string `json:"selfLink,omitempty" description:"URL for the object; populated by the system, read-only"` |
|
| 73 |
+ |
|
| 74 |
+ // An opaque value that represents the version of this response for use with optimistic |
|
| 75 |
+ // concurrency and change monitoring endpoints. Clients must treat these values as opaque |
|
| 76 |
+ // and values may only be valid for a particular resource or set of resources. Only servers |
|
| 77 |
+ // will generate resource versions. |
|
| 78 |
+ ResourceVersion string `json:"resourceVersion,omitempty" description:"string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system, read-only; value must be treated as opaque by clients and passed unmodified back to the server: http://releases.k8s.io/v1.0.0/docs/api-conventions.md#concurrency-control-and-consistency"` |
|
| 79 |
+} |
|
| 80 |
+ |
|
| 81 |
+// ObjectMeta is metadata that all persisted resources must have, which includes all objects |
|
| 82 |
+// users must create. |
|
| 83 |
+type ObjectMeta struct {
|
|
| 84 |
+ // Name is unique within a namespace. Name is required when creating resources, although |
|
| 85 |
+ // some resources may allow a client to request the generation of an appropriate name |
|
| 86 |
+ // automatically. Name is primarily intended for creation idempotence and configuration |
|
| 87 |
+ // definition. |
|
| 88 |
+ Name string `json:"name,omitempty" description:"string that identifies an object. Must be unique within a namespace; cannot be updated"` |
|
| 89 |
+ |
|
| 90 |
+ // GenerateName indicates that the name should be made unique by the server prior to persisting |
|
| 91 |
+ // it. A non-empty value for the field indicates the name will be made unique (and the name |
|
| 92 |
+ // returned to the client will be different than the name passed). The value of this field will |
|
| 93 |
+ // be combined with a unique suffix on the server if the Name field has not been provided. |
|
| 94 |
+ // The provided value must be valid within the rules for Name, and may be truncated by the length |
|
| 95 |
+ // of the suffix required to make the value unique on the server. |
|
| 96 |
+ // |
|
| 97 |
+ // If this field is specified, and Name is not present, the server will NOT return a 409 if the |
|
| 98 |
+ // generated name exists - instead, it will either return 201 Created or 500 with Reason |
|
| 99 |
+ // ServerTimeout indicating a unique name could not be found in the time allotted, and the client |
|
| 100 |
+ // should retry (optionally after the time indicated in the Retry-After header). |
|
| 101 |
+ GenerateName string `json:"generateName,omitempty" description:"an optional prefix to use to generate a unique name; has the same validation rules as name; optional, and is applied only name if is not specified"` |
|
| 102 |
+ |
|
| 103 |
+ // Namespace defines the space within which name must be unique. An empty namespace is |
|
| 104 |
+ // equivalent to the "default" namespace, but "default" is the canonical representation. |
|
| 105 |
+ // Not all objects are required to be scoped to a namespace - the value of this field for |
|
| 106 |
+ // those objects will be empty. |
|
| 107 |
+ Namespace string `json:"namespace,omitempty" description:"namespace of the object; must be a DNS_LABEL; cannot be updated"` |
|
| 108 |
+ |
|
| 109 |
+ // SelfLink is a URL representing this object. |
|
| 110 |
+ SelfLink string `json:"selfLink,omitempty" description:"URL for the object; populated by the system, read-only"` |
|
| 111 |
+ |
|
| 112 |
+ // UID is the unique in time and space value for this object. It is typically generated by |
|
| 113 |
+ // the server on successful creation of a resource and is not allowed to change on PUT |
|
| 114 |
+ // operations. |
|
| 115 |
+ UID types.UID `json:"uid,omitempty" description:"unique UUID across space and time; populated by the system; read-only"` |
|
| 116 |
+ |
|
| 117 |
+ // An opaque value that represents the version of this resource. May be used for optimistic |
|
| 118 |
+ // concurrency, change detection, and the watch operation on a resource or set of resources. |
|
| 119 |
+ // Clients must treat these values as opaque and values may only be valid for a particular |
|
| 120 |
+ // resource or set of resources. Only servers will generate resource versions. |
|
| 121 |
+ ResourceVersion string `json:"resourceVersion,omitempty" description:"string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system, read-only; value must be treated as opaque by clients and passed unmodified back to the server: http://releases.k8s.io/v1.0.0/docs/api-conventions.md#concurrency-control-and-consistency"` |
|
| 122 |
+ |
|
| 123 |
+ // A sequence number representing a specific generation of the desired state. |
|
| 124 |
+ // Currently only implemented by replication controllers. |
|
| 125 |
+ Generation int64 `json:"generation,omitempty" description:"a sequence number representing a specific generation of the desired state; populated by the system; read-only"` |
|
| 126 |
+ |
|
| 127 |
+ // CreationTimestamp is a timestamp representing the server time when this object was |
|
| 128 |
+ // created. It is not guaranteed to be set in happens-before order across separate operations. |
|
| 129 |
+ // Clients may not set this value. It is represented in RFC3339 form and is in UTC. |
|
| 130 |
+ CreationTimestamp util.Time `json:"creationTimestamp,omitempty" description:"RFC 3339 date and time at which the object was created; populated by the system, read-only; null for lists"` |
|
| 131 |
+ |
|
| 132 |
+ // DeletionTimestamp is the time after which this resource will be deleted. This |
|
| 133 |
+ // field is set by the server when a graceful deletion is requested by the user, and is not |
|
| 134 |
+ // directly settable by a client. The resource will be deleted (no longer visible from |
|
| 135 |
+ // resource lists, and not reachable by name) after the time in this field. Once set, this |
|
| 136 |
+ // value may not be unset or be set further into the future, although it may be shortened |
|
| 137 |
+ // or the resource may be deleted prior to this time. For example, a user may request that |
|
| 138 |
+ // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination |
|
| 139 |
+ // signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet |
|
| 140 |
+ // will send a hard termination signal to the container. |
|
| 141 |
+ DeletionTimestamp *util.Time `json:"deletionTimestamp,omitempty" description:"RFC 3339 date and time at which the object will be deleted; populated by the system when a graceful deletion is requested, read-only; if not set, graceful deletion of the object has not been requested"` |
|
| 142 |
+ |
|
| 143 |
+ // Number of seconds allowed for this object to gracefully terminate before |
|
| 144 |
+ // it will be removed from the system. Only set when deletionTimestamp is also set. |
|
| 145 |
+ // May only be shortened. |
|
| 146 |
+ // Read-only. |
|
| 147 |
+ DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` |
|
| 148 |
+ |
|
| 149 |
+ // Labels are key value pairs that may be used to scope and select individual resources. |
|
| 150 |
+ // TODO: replace map[string]string with labels.LabelSet type |
|
| 151 |
+ Labels map[string]string `json:"labels,omitempty" description:"map of string keys and values that can be used to organize and categorize objects; may match selectors of replication controllers and services"` |
|
| 152 |
+ |
|
| 153 |
+ // Annotations are unstructured key value data stored with a resource that may be set by |
|
| 154 |
+ // external tooling. They are not queryable and should be preserved when modifying |
|
| 155 |
+ // objects. |
|
| 156 |
+ Annotations map[string]string `json:"annotations,omitempty" description:"map of string keys and values that can be used by external tooling to store and retrieve arbitrary metadata about objects"` |
|
| 157 |
+} |
|
| 158 |
+ |
|
| 159 |
+const ( |
|
| 160 |
+ // NamespaceDefault means the object is in the default namespace which is applied when not specified by clients |
|
| 161 |
+ NamespaceDefault string = "default" |
|
| 162 |
+ // NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces |
|
| 163 |
+ NamespaceAll string = "" |
|
| 164 |
+) |
|
| 165 |
+ |
|
| 166 |
+// Volume represents a named volume in a pod that may be accessed by any containers in the pod. |
|
| 167 |
+type Volume struct {
|
|
| 168 |
+ // Required: This must be a DNS_LABEL. Each volume in a pod must have |
|
| 169 |
+ // a unique name. |
|
| 170 |
+ Name string `json:"name" description:"volume name; must be a DNS_LABEL and unique within the pod"` |
|
| 171 |
+ // Source represents the location and type of a volume to mount. |
|
| 172 |
+ // This is optional for now. If not specified, the Volume is implied to be an EmptyDir. |
|
| 173 |
+ // This implied behavior is deprecated and will be removed in a future version. |
|
| 174 |
+ VolumeSource `json:",inline"` |
|
| 175 |
+} |
|
| 176 |
+ |
|
| 177 |
+// VolumeSource represents the source location of a volume to mount. |
|
| 178 |
+// Only one of its members may be specified. |
|
| 179 |
+type VolumeSource struct {
|
|
| 180 |
+ // HostPath represents a pre-existing file or directory on the host |
|
| 181 |
+ // machine that is directly exposed to the container. This is generally |
|
| 182 |
+ // used for system agents or other privileged things that are allowed |
|
| 183 |
+ // to see the host machine. Most containers will NOT need this. |
|
| 184 |
+ // TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not |
|
| 185 |
+ // mount host directories as read/write. |
|
| 186 |
+ HostPath *HostPathVolumeSource `json:"hostPath,omitempty" description:"pre-existing host file or directory; generally for privileged system daemons or other agents tied to the host"` |
|
| 187 |
+ // EmptyDir represents a temporary directory that shares a pod's lifetime. |
|
| 188 |
+ EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" description:"temporary directory that shares a pod's lifetime"` |
|
| 189 |
+ // GCEPersistentDisk represents a GCE Disk resource that is attached to a |
|
| 190 |
+ // kubelet's host machine and then exposed to the pod. |
|
| 191 |
+ GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" description:"GCE disk resource attached to the host machine on demand"` |
|
| 192 |
+ // AWSElasticBlockStore represents an AWS Disk resource that is attached to a |
|
| 193 |
+ // kubelet's host machine and then exposed to the pod. |
|
| 194 |
+ AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" description:"AWS disk resource attached to the host machine on demand"` |
|
| 195 |
+ // GitRepo represents a git repository at a particular revision. |
|
| 196 |
+ GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" description:"git repository at a particular revision"` |
|
| 197 |
+ // Secret represents a secret that should populate this volume. |
|
| 198 |
+ Secret *SecretVolumeSource `json:"secret,omitempty" description:"secret to populate volume"` |
|
| 199 |
+ // NFS represents an NFS mount on the host that shares a pod's lifetime |
|
| 200 |
+ NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume that will be mounted in the host machine"` |
|
| 201 |
+ // ISCSI represents an ISCSI Disk resource that is attached to a |
|
| 202 |
+ // kubelet's host machine and then exposed to the pod. |
|
| 203 |
+ ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"iSCSI disk attached to host machine on demand"` |
|
| 204 |
+ // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime |
|
| 205 |
+ Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" description:"Glusterfs volume that will be mounted on the host machine "` |
|
| 206 |
+ // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace |
|
| 207 |
+ PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" description:"a reference to a PersistentVolumeClaim in the same namespace"` |
|
| 208 |
+ // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime |
|
| 209 |
+ RBD *RBDVolumeSource `json:"rbd,omitempty" description:"rados block volume that will be mounted on the host machine"` |
|
| 210 |
+ // Cinder represents a cinder volume attached and mounted on kubelets host machine |
|
| 211 |
+ // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md |
|
| 212 |
+ Cinder *CinderVolumeSource `json:"cinder,omitempty"` |
|
| 213 |
+ // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime |
|
| 214 |
+ CephFS *CephFSVolumeSource `json:"cephfs,omitempty" description:"Ceph filesystem that will be mounted on the host machine"` |
|
| 215 |
+ // DownwardAPI represents metadata about the pod that should populate this volume |
|
| 216 |
+ DownwardAPI *DownwardAPIVolumeSource `json:"metadata,omitempty" description: "Metadata volume containing information about the pod"` |
|
| 217 |
+} |
|
| 218 |
+ |
|
| 219 |
+type PersistentVolumeClaimVolumeSource struct {
|
|
| 220 |
+ // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume |
|
| 221 |
+ ClaimName string `json:"claimName,omitempty" description:"the name of the claim in the same namespace to be mounted as a volume"` |
|
| 222 |
+ // Optional: Defaults to false (read/write). ReadOnly here |
|
| 223 |
+ // will force the ReadOnly setting in VolumeMounts |
|
| 224 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"mount volume as read-only when true; default false"` |
|
| 225 |
+} |
|
| 226 |
+ |
|
| 227 |
+// Similar to VolumeSource but meant for the administrator who creates PVs. |
|
| 228 |
+// Exactly one of its members must be set. |
|
| 229 |
+type PersistentVolumeSource struct {
|
|
| 230 |
+ // GCEPersistentDisk represents a GCE Disk resource that is attached to a |
|
| 231 |
+ // kubelet's host machine and then exposed to the pod. |
|
| 232 |
+ GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" description:"GCE disk resource provisioned by an admin"` |
|
| 233 |
+ // AWSElasticBlockStore represents an AWS Disk resource that is attached to a |
|
| 234 |
+ // kubelet's host machine and then exposed to the pod. |
|
| 235 |
+ AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" description:"AWS disk resource provisioned by an admin"` |
|
| 236 |
+ // HostPath represents a directory on the host. |
|
| 237 |
+ // This is useful for development and testing only. |
|
| 238 |
+ // on-host storage is not supported in any way. |
|
| 239 |
+ HostPath *HostPathVolumeSource `json:"hostPath,omitempty" description:"a HostPath provisioned by a developer or tester; for develment use only"` |
|
| 240 |
+ // Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod |
|
| 241 |
+ Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" description:"Glusterfs volume resource provisioned by an admin"` |
|
| 242 |
+ // NFS represents an NFS mount on the host |
|
| 243 |
+ NFS *NFSVolumeSource `json:"nfs,omitempty" description:"NFS volume resource provisioned by an admin"` |
|
| 244 |
+ // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime |
|
| 245 |
+ RBD *RBDVolumeSource `json:"rbd,omitempty" description:"rados block volume that will be mounted on the host machine"` |
|
| 246 |
+ // ISCSI represents an ISCSI Disk resource that is attached to a |
|
| 247 |
+ // kubelet's host machine and then exposed to the pod. |
|
| 248 |
+ ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" description:"an iSCSI disk resource provisioned by an admin"` |
|
| 249 |
+ // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime |
|
| 250 |
+ CephFS *CephFSVolumeSource `json:"cephfs,omitempty" description:"Ceph filesystem that will be mounted on the host machine"` |
|
| 251 |
+ // Cinder represents a cinder volume attached and mounted on kubelets host machine |
|
| 252 |
+ // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md |
|
| 253 |
+ Cinder *CinderVolumeSource `json:"cinder,omitempty"` |
|
| 254 |
+} |
|
| 255 |
+ |
|
| 256 |
+type PersistentVolume struct {
|
|
| 257 |
+ TypeMeta `json:",inline"` |
|
| 258 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 259 |
+ |
|
| 260 |
+ //Spec defines a persistent volume owned by the cluster |
|
| 261 |
+ Spec PersistentVolumeSpec `json:"spec,omitempty" description:"specification of a persistent volume as provisioned by an administrator"` |
|
| 262 |
+ |
|
| 263 |
+ // Status represents the current information about persistent volume. |
|
| 264 |
+ Status PersistentVolumeStatus `json:"status,omitempty" description:"current status of a persistent volume; populated by the system, read-only"` |
|
| 265 |
+} |
|
| 266 |
+ |
|
| 267 |
+type PersistentVolumeSpec struct {
|
|
| 268 |
+ // Resources represents the actual resources of the volume |
|
| 269 |
+ Capacity ResourceList `json:"capacity,omitempty" description:"a description of the persistent volume's resources and capacity"` |
|
| 270 |
+ // Source represents the location and type of a volume to mount. |
|
| 271 |
+ PersistentVolumeSource `json:",inline" description:"the actual volume backing the persistent volume"` |
|
| 272 |
+ // AccessModes contains all ways the volume can be mounted |
|
| 273 |
+ AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" description:"all ways the volume can be mounted"` |
|
| 274 |
+ // ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. |
|
| 275 |
+ // ClaimRef is expected to be non-nil when bound. |
|
| 276 |
+ // claim.VolumeName is the authoritative bind between PV and PVC. |
|
| 277 |
+ ClaimRef *ObjectReference `json:"claimRef,omitempty" description:"when bound, a reference to the bound claim"` |
|
| 278 |
+ // Optional: what happens to a persistent volume when released from its claim. |
|
| 279 |
+ PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" description:"what happens to a volume when released from its claim; Valid options are Retain (default) and Recycle. Recyling must be supported by the volume plugin underlying this persistent volume."` |
|
| 280 |
+} |
|
| 281 |
+ |
|
| 282 |
+// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes |
|
| 283 |
+type PersistentVolumeReclaimPolicy string |
|
| 284 |
+ |
|
| 285 |
+const ( |
|
| 286 |
+ // PersistentVolumeReclaimRecycle means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. |
|
| 287 |
+ // The volume plugin must support Recycling. |
|
| 288 |
+ PersistentVolumeReclaimRecycle PersistentVolumeReclaimPolicy = "Recycle" |
|
| 289 |
+ // PersistentVolumeReclaimDelete means the volume will be deleted from Kubernetes on release from its claim. |
|
| 290 |
+ // The volume plugin must support Deletion. |
|
| 291 |
+ // TODO: implement w/ DeletableVolumePlugin |
|
| 292 |
+ // PersistentVolumeReclaimDelete PersistentVolumeReclaimPolicy = "Delete" |
|
| 293 |
+ // PersistentVolumeReclaimRetain means the volume will left in its current phase (Released) for manual reclamation by the administrator. |
|
| 294 |
+ // The default policy is Retain. |
|
| 295 |
+ PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain" |
|
| 296 |
+) |
|
| 297 |
+ |
|
| 298 |
+type PersistentVolumeStatus struct {
|
|
| 299 |
+ // Phase indicates if a volume is available, bound to a claim, or released by a claim |
|
| 300 |
+ Phase PersistentVolumePhase `json:"phase,omitempty" description:"the current phase of a persistent volume"` |
|
| 301 |
+ // A human-readable message indicating details about why the volume is in this state. |
|
| 302 |
+ Message string `json:"message,omitempty" description:"human-readable message indicating details about why the volume is in this state"` |
|
| 303 |
+ // Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI |
|
| 304 |
+ Reason string `json:"reason,omitempty" description:"(brief) reason the volume is not is not available"` |
|
| 305 |
+} |
|
| 306 |
+ |
|
| 307 |
+type PersistentVolumeList struct {
|
|
| 308 |
+ TypeMeta `json:",inline"` |
|
| 309 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#types-kinds"` |
|
| 310 |
+ Items []PersistentVolume `json:"items,omitempty" description:"list of persistent volumes"` |
|
| 311 |
+} |
|
| 312 |
+ |
|
| 313 |
+// PersistentVolumeClaim is a user's request for and claim to a persistent volume |
|
| 314 |
+type PersistentVolumeClaim struct {
|
|
| 315 |
+ TypeMeta `json:",inline"` |
|
| 316 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 317 |
+ |
|
| 318 |
+ // Spec defines the volume requested by a pod author |
|
| 319 |
+ Spec PersistentVolumeClaimSpec `json:"spec,omitempty" description:"the desired characteristics of a volume"` |
|
| 320 |
+ |
|
| 321 |
+ // Status represents the current information about a claim |
|
| 322 |
+ Status PersistentVolumeClaimStatus `json:"status,omitempty" description:"the current status of a persistent volume claim; read-only"` |
|
| 323 |
+} |
|
| 324 |
+ |
|
| 325 |
+type PersistentVolumeClaimList struct {
|
|
| 326 |
+ TypeMeta `json:",inline"` |
|
| 327 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#types-kinds"` |
|
| 328 |
+ Items []PersistentVolumeClaim `json:"items,omitempty" description:"a list of persistent volume claims"` |
|
| 329 |
+} |
|
| 330 |
+ |
|
| 331 |
+// PersistentVolumeClaimSpec describes the common attributes of storage devices |
|
| 332 |
+// and allows a Source for provider-specific attributes |
|
| 333 |
+type PersistentVolumeClaimSpec struct {
|
|
| 334 |
+ // Contains the types of access modes required |
|
| 335 |
+ AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" description:"the desired access modes the volume should have"` |
|
| 336 |
+ // Resources represents the minimum resources required |
|
| 337 |
+ Resources ResourceRequirements `json:"resources,omitempty" description:"the desired resources the volume should have"` |
|
| 338 |
+ // VolumeName is the binding reference to the PersistentVolume backing this claim |
|
| 339 |
+ VolumeName string `json:"volumeName,omitempty" description:"the binding reference to the persistent volume backing this claim"` |
|
| 340 |
+} |
|
| 341 |
+ |
|
| 342 |
+type PersistentVolumeClaimStatus struct {
|
|
| 343 |
+ // Phase represents the current phase of PersistentVolumeClaim |
|
| 344 |
+ Phase PersistentVolumeClaimPhase `json:"phase,omitempty" description:"the current phase of the claim"` |
|
| 345 |
+ // AccessModes contains all ways the volume backing the PVC can be mounted |
|
| 346 |
+ AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" description:"the actual access modes the volume has"` |
|
| 347 |
+ // Represents the actual resources of the underlying volume |
|
| 348 |
+ Capacity ResourceList `json:"capacity,omitempty" description:"the actual resources the volume has"` |
|
| 349 |
+} |
|
| 350 |
+ |
|
| 351 |
+type PersistentVolumeAccessMode string |
|
| 352 |
+ |
|
| 353 |
+const ( |
|
| 354 |
+ // can be mounted read/write mode to exactly 1 host |
|
| 355 |
+ ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce" |
|
| 356 |
+ // can be mounted in read-only mode to many hosts |
|
| 357 |
+ ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany" |
|
| 358 |
+ // can be mounted in read/write mode to many hosts |
|
| 359 |
+ ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany" |
|
| 360 |
+) |
|
| 361 |
+ |
|
| 362 |
+type PersistentVolumePhase string |
|
| 363 |
+ |
|
| 364 |
+const ( |
|
| 365 |
+ // used for PersistentVolumes that are not available |
|
| 366 |
+ VolumePending PersistentVolumePhase = "Pending" |
|
| 367 |
+ // used for PersistentVolumes that are not yet bound |
|
| 368 |
+ // Available volumes are held by the binder and matched to PersistentVolumeClaims |
|
| 369 |
+ VolumeAvailable PersistentVolumePhase = "Available" |
|
| 370 |
+ // used for PersistentVolumes that are bound |
|
| 371 |
+ VolumeBound PersistentVolumePhase = "Bound" |
|
| 372 |
+ // used for PersistentVolumes where the bound PersistentVolumeClaim was deleted |
|
| 373 |
+ // released volumes must be recycled before becoming available again |
|
| 374 |
+ // this phase is used by the persistent volume claim binder to signal to another process to reclaim the resource |
|
| 375 |
+ VolumeReleased PersistentVolumePhase = "Released" |
|
| 376 |
+ // used for PersistentVolumes that failed to be correctly recycled or deleted after being released from a claim |
|
| 377 |
+ VolumeFailed PersistentVolumePhase = "Failed" |
|
| 378 |
+) |
|
| 379 |
+ |
|
| 380 |
+type PersistentVolumeClaimPhase string |
|
| 381 |
+ |
|
| 382 |
+const ( |
|
| 383 |
+ // used for PersistentVolumeClaims that are not yet bound |
|
| 384 |
+ ClaimPending PersistentVolumeClaimPhase = "Pending" |
|
| 385 |
+ // used for PersistentVolumeClaims that are bound |
|
| 386 |
+ ClaimBound PersistentVolumeClaimPhase = "Bound" |
|
| 387 |
+) |
|
| 388 |
+ |
|
| 389 |
+// HostPathVolumeSource represents bare host directory volume. |
|
| 390 |
+type HostPathVolumeSource struct {
|
|
| 391 |
+ Path string `json:"path" description:"path of the directory on the host"` |
|
| 392 |
+} |
|
| 393 |
+ |
|
| 394 |
+type EmptyDirVolumeSource struct {
|
|
| 395 |
+ // Optional: what type of storage medium should back this directory. |
|
| 396 |
+ // The default is "" which means to use the node's default medium. |
|
| 397 |
+ Medium StorageMedium `json:"medium,omitempty" description:"type of storage used to back the volume; must be an empty string (default) or Memory"` |
|
| 398 |
+} |
|
| 399 |
+ |
|
| 400 |
+// GlusterfsVolumeSource represents a Glusterfs Mount that lasts the lifetime of a pod |
|
| 401 |
+type GlusterfsVolumeSource struct {
|
|
| 402 |
+ // Required: EndpointsName is the endpoint name that details Glusterfs topology |
|
| 403 |
+ EndpointsName string `json:"endpoints" description:"gluster hosts endpoints name"` |
|
| 404 |
+ |
|
| 405 |
+ // Required: Path is the Glusterfs volume path |
|
| 406 |
+ Path string `json:"path" description:"path to gluster volume"` |
|
| 407 |
+ |
|
| 408 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 409 |
+ // the Glusterfs volume to be mounted with read-only permissions |
|
| 410 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"glusterfs volume to be mounted with read-only permissions"` |
|
| 411 |
+} |
|
| 412 |
+ |
|
| 413 |
+// DownwardAPIVolumeSource represents a volume containing metadata about a pod. |
|
| 414 |
+type DownwardAPIVolumeSource struct {
|
|
| 415 |
+ // Items is a list of metadata file name |
|
| 416 |
+ Items []DownwardAPIVolumeFile `json:"items,omitempty" description:"list of metadata files"` |
|
| 417 |
+} |
|
| 418 |
+ |
|
| 419 |
+// DownwardAPIVolumeFile expresses information about a file holding pod metadata. |
|
| 420 |
+type DownwardAPIVolumeFile struct {
|
|
| 421 |
+ // Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..' |
|
| 422 |
+ Path string `json:"path" description:"the path of the file to be created"` |
|
| 423 |
+ // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. |
|
| 424 |
+ FieldRef ObjectFieldSelector `json:"fieldRef" description:"selects a field of the pod. Supported fields: metadata.annotations, metadata.labels, metadata.name, metadata.namespace"` |
|
| 425 |
+} |
|
| 426 |
+ |
|
| 427 |
+// StorageMedium defines ways that storage can be allocated to a volume. |
|
| 428 |
+type StorageMedium string |
|
| 429 |
+ |
|
| 430 |
+// RBDVolumeSource represents a Rados Block Device Mount that lasts the lifetime of a pod |
|
| 431 |
+type RBDVolumeSource struct {
|
|
| 432 |
+ // Required: CephMonitors is a collection of Ceph monitors |
|
| 433 |
+ CephMonitors []string `json:"monitors" description:"a collection of Ceph monitors"` |
|
| 434 |
+ // Required: RBDImage is the rados image name |
|
| 435 |
+ RBDImage string `json:"image" description:"rados image name"` |
|
| 436 |
+ // Required: Filesystem type to mount. |
|
| 437 |
+ // Must be a filesystem type supported by the host operating system. |
|
| 438 |
+ // Ex. "ext4", "xfs", "ntfs" |
|
| 439 |
+ // TODO: how do we prevent errors in the filesystem from compromising the machine |
|
| 440 |
+ FSType string `json:"fsType,omitempty" description:"file system type to mount, such as ext4, xfs, ntfs"` |
|
| 441 |
+ // Optional: RadosPool is the rados pool name,default is rbd |
|
| 442 |
+ RBDPool string `json:"pool" description:"rados pool name; default is rbd; optional"` |
|
| 443 |
+ // Optional: RBDUser is the rados user name, default is admin |
|
| 444 |
+ RadosUser string `json:"user" description:"rados user name; default is admin; optional"` |
|
| 445 |
+ // Optional: Keyring is the path to key ring for RBDUser, default is /etc/ceph/keyring |
|
| 446 |
+ Keyring string `json:"keyring" description:"keyring is the path to key ring for rados user; default is /etc/ceph/keyring; optional"` |
|
| 447 |
+ // Optional: SecretRef is name of the authentication secret for RBDUser, default is empty. |
|
| 448 |
+ SecretRef *LocalObjectReference `json:"secretRef" description:"name of a secret to authenticate the RBD user; if provided overrides keyring; optional"` |
|
| 449 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 450 |
+ // the ReadOnly setting in VolumeMounts. |
|
| 451 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"rbd volume to be mounted with read-only permissions"` |
|
| 452 |
+} |
|
| 453 |
+ |
|
| 454 |
+// CinderVolumeSource represents a cinder volume resource in Openstack. |
|
| 455 |
+// A Cinder volume must exist before mounting to a container. |
|
| 456 |
+// The volume must also be in the same region as the kubelet. |
|
| 457 |
+type CinderVolumeSource struct {
|
|
| 458 |
+ // volume id used to identify the volume in cinder |
|
| 459 |
+ // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md |
|
| 460 |
+ VolumeID string `json:"volumeID"` |
|
| 461 |
+ // Required: Filesystem type to mount. |
|
| 462 |
+ // Must be a filesystem type supported by the host operating system. |
|
| 463 |
+ // Only ext3 and ext4 are allowed |
|
| 464 |
+ // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md |
|
| 465 |
+ FSType string `json:"fsType,omitempty"` |
|
| 466 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 467 |
+ // the ReadOnly setting in VolumeMounts. |
|
| 468 |
+ // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md |
|
| 469 |
+ ReadOnly bool `json:"readOnly,omitempty"` |
|
| 470 |
+} |
|
| 471 |
+ |
|
| 472 |
+// CephFSVolumeSource represents a Ceph Filesystem Mount that lasts the lifetime of a pod |
|
| 473 |
+type CephFSVolumeSource struct {
|
|
| 474 |
+ // Required: Monitors is a collection of Ceph monitors |
|
| 475 |
+ Monitors []string `json:"monitors" description:"a collection of Ceph monitors"` |
|
| 476 |
+ // Optional: User is the rados user name, default is admin |
|
| 477 |
+ User string `json:"user,omitempty" description:"rados user name; default is admin; optional"` |
|
| 478 |
+ // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret |
|
| 479 |
+ SecretFile string `json:"secretFile,omitempty" description:"path to secret for rados user; default is /etc/ceph/user.secret; optional"` |
|
| 480 |
+ // Optional: SecretRef is reference to the authentication secret for User, default is empty. |
|
| 481 |
+ SecretRef *LocalObjectReference `json:"secretRef,omitempty" description:"name of a secret to authenticate the user; if provided overrides keyring; optional"` |
|
| 482 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 483 |
+ // the ReadOnly setting in VolumeMounts. |
|
| 484 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"Ceph fs to be mounted with read-only permissions"` |
|
| 485 |
+} |
|
| 486 |
+ |
|
| 487 |
+const ( |
|
| 488 |
+ StorageMediumDefault StorageMedium = "" // use whatever the default is for the node |
|
| 489 |
+ StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs) |
|
| 490 |
+) |
|
| 491 |
+ |
|
| 492 |
+// Protocol defines network protocols supported for things like conatiner ports. |
|
| 493 |
+type Protocol string |
|
| 494 |
+ |
|
| 495 |
+const ( |
|
| 496 |
+ // ProtocolTCP is the TCP protocol. |
|
| 497 |
+ ProtocolTCP Protocol = "TCP" |
|
| 498 |
+ // ProtocolUDP is the UDP protocol. |
|
| 499 |
+ ProtocolUDP Protocol = "UDP" |
|
| 500 |
+) |
|
| 501 |
+ |
|
| 502 |
+// GCEPersistentDiskVolumeSource represents a Persistent Disk resource in Google Compute Engine. |
|
| 503 |
+// |
|
| 504 |
+// A GCE PD must exist and be formatted before mounting to a container. |
|
| 505 |
+// The disk must also be in the same GCE project and zone as the kubelet. |
|
| 506 |
+// A GCE PD can only be mounted as read/write once. |
|
| 507 |
+type GCEPersistentDiskVolumeSource struct {
|
|
| 508 |
+ // Unique name of the PD resource. Used to identify the disk in GCE |
|
| 509 |
+ PDName string `json:"pdName" description:"unique name of the PD resource in GCE"` |
|
| 510 |
+ // Required: Filesystem type to mount. |
|
| 511 |
+ // Must be a filesystem type supported by the host operating system. |
|
| 512 |
+ // Ex. "ext4", "xfs", "ntfs" |
|
| 513 |
+ // TODO: how do we prevent errors in the filesystem from compromising the machine |
|
| 514 |
+ FSType string `json:"fsType" description:"file system type to mount, such as ext4, xfs, ntfs"` |
|
| 515 |
+ // Optional: Partition on the disk to mount. |
|
| 516 |
+ // If omitted, kubelet will attempt to mount the device name. |
|
| 517 |
+ // Ex. For /dev/sda1, this field is "1", for /dev/sda, this field is 0 or empty. |
|
| 518 |
+ Partition int `json:"partition,omitempty" description:"partition on the disk to mount (e.g., '1' for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted"` |
|
| 519 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 520 |
+ // the ReadOnly setting in VolumeMounts. |
|
| 521 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"` |
|
| 522 |
+} |
|
| 523 |
+ |
|
| 524 |
+// AWSElasticBlockStoreVolumeSource represents a Persistent Disk resource in AWS. |
|
| 525 |
+// |
|
| 526 |
+// An AWS PD must exist and be formatted before mounting to a container. |
|
| 527 |
+// The disk must also be in the same AWS zone as the kubelet. |
|
| 528 |
+// A AWS PD can only be mounted on a single machine. |
|
| 529 |
+type AWSElasticBlockStoreVolumeSource struct {
|
|
| 530 |
+ // Unique id of the PD resource. Used to identify the disk in AWS |
|
| 531 |
+ VolumeID string `json:"volumeID" description:"unique id of the PD resource in AWS"` |
|
| 532 |
+ // Required: Filesystem type to mount. |
|
| 533 |
+ // Must be a filesystem type supported by the host operating system. |
|
| 534 |
+ // Ex. "ext4", "xfs", "ntfs" |
|
| 535 |
+ // TODO: how do we prevent errors in the filesystem from compromising the machine |
|
| 536 |
+ FSType string `json:"fsType" description:"file system type to mount, such as ext4, xfs, ntfs"` |
|
| 537 |
+ // Optional: Partition on the disk to mount. |
|
| 538 |
+ // If omitted, kubelet will attempt to mount the device name. |
|
| 539 |
+ // Ex. For /dev/sda1, this field is "1", for /dev/sda, this field 0 or empty. |
|
| 540 |
+ Partition int `json:"partition,omitempty" description:"partition on the disk to mount (e.g., '1' for /dev/sda1); if omitted the plain device name (e.g., /dev/sda) will be mounted"` |
|
| 541 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 542 |
+ // the ReadOnly setting in VolumeMounts. |
|
| 543 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"` |
|
| 544 |
+} |
|
| 545 |
+ |
|
| 546 |
+// GitRepoVolumeSource represents a volume that is pulled from git when the pod is created. |
|
| 547 |
+type GitRepoVolumeSource struct {
|
|
| 548 |
+ // Repository URL |
|
| 549 |
+ Repository string `json:"repository" description:"repository URL"` |
|
| 550 |
+ // Commit hash, this is optional |
|
| 551 |
+ Revision string `json:"revision,omitempty" description:"commit hash for the specified revision"` |
|
| 552 |
+} |
|
| 553 |
+ |
|
| 554 |
+// SecretVolumeSource adapts a Secret into a VolumeSource |
|
| 555 |
+// |
|
| 556 |
+// http://releases.k8s.io/v1.0.0/docs/design/secrets.md |
|
| 557 |
+type SecretVolumeSource struct {
|
|
| 558 |
+ // Name of the secret in the pod's namespace to use |
|
| 559 |
+ SecretName string `json:"secretName" description:"secretName is the name of a secret in the pod's namespace"` |
|
| 560 |
+} |
|
| 561 |
+ |
|
| 562 |
+// NFSVolumeSource represents an NFS mount that lasts the lifetime of a pod |
|
| 563 |
+type NFSVolumeSource struct {
|
|
| 564 |
+ // Server is the hostname or IP address of the NFS server |
|
| 565 |
+ Server string `json:"server" description:"the hostname or IP address of the NFS server"` |
|
| 566 |
+ |
|
| 567 |
+ // Path is the exported NFS share |
|
| 568 |
+ Path string `json:"path" description:"the path that is exported by the NFS server"` |
|
| 569 |
+ |
|
| 570 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 571 |
+ // the NFS export to be mounted with read-only permissions |
|
| 572 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"forces the NFS export to be mounted with read-only permissions"` |
|
| 573 |
+} |
|
| 574 |
+ |
|
| 575 |
+// A ISCSI Disk can only be mounted as read/write once. |
|
| 576 |
+type ISCSIVolumeSource struct {
|
|
| 577 |
+ // Required: iSCSI target portal |
|
| 578 |
+ // the portal is either an IP or ip_addr:port if port is other than default (typically TCP ports 860 and 3260) |
|
| 579 |
+ TargetPortal string `json:"targetPortal" description:"iSCSI target portal"` |
|
| 580 |
+ // Required: target iSCSI Qualified Name |
|
| 581 |
+ IQN string `json:"iqn" description:"iSCSI Qualified Name"` |
|
| 582 |
+ // Required: iSCSI target lun number |
|
| 583 |
+ Lun int `json:"lun" description:"iscsi target lun number"` |
|
| 584 |
+ // Required: Filesystem type to mount. |
|
| 585 |
+ // Must be a filesystem type supported by the host operating system. |
|
| 586 |
+ // Ex. "ext4", "xfs", "ntfs" |
|
| 587 |
+ // TODO: how do we prevent errors in the filesystem from compromising the machine |
|
| 588 |
+ FSType string `json:"fsType" description:"file system type to mount, such as ext4, xfs, ntfs"` |
|
| 589 |
+ // Optional: Defaults to false (read/write). ReadOnly here will force |
|
| 590 |
+ // the ReadOnly setting in VolumeMounts. |
|
| 591 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"read-only if true, read-write otherwise (false or unspecified)"` |
|
| 592 |
+} |
|
| 593 |
+ |
|
| 594 |
+// ContainerPort represents a network port in a single container. |
|
| 595 |
+type ContainerPort struct {
|
|
| 596 |
+ // Optional: If specified, this must be a IANA_SVC_NAME. Each named port |
|
| 597 |
+ // in a pod must have a unique name. |
|
| 598 |
+ Name string `json:"name,omitempty" description:"name for the port that can be referred to by services; must be a IANA_SVC_NAME and unique within the pod"` |
|
| 599 |
+ // Optional: If specified, this must be a valid port number, 0 < x < 65536. |
|
| 600 |
+ // If HostNetwork is specified, this must match ContainerPort. |
|
| 601 |
+ HostPort int `json:"hostPort,omitempty" description:"number of port to expose on the host; most containers do not need this"` |
|
| 602 |
+ // Required: This must be a valid port number, 0 < x < 65536. |
|
| 603 |
+ ContainerPort int `json:"containerPort" description:"number of port to expose on the pod's IP address"` |
|
| 604 |
+ // Optional: Defaults to "TCP". |
|
| 605 |
+ Protocol Protocol `json:"protocol,omitempty" description:"protocol for port; must be UDP or TCP; TCP if unspecified"` |
|
| 606 |
+ // Optional: What host IP to bind the external port to. |
|
| 607 |
+ HostIP string `json:"hostIP,omitempty" description:"host IP to bind the port to"` |
|
| 608 |
+} |
|
| 609 |
+ |
|
| 610 |
+// VolumeMount describes a mounting of a Volume within a container. |
|
| 611 |
+type VolumeMount struct {
|
|
| 612 |
+ // Required: This must match the Name of a Volume [above]. |
|
| 613 |
+ Name string `json:"name" description:"name of the volume to mount"` |
|
| 614 |
+ // Optional: Defaults to false (read-write). |
|
| 615 |
+ ReadOnly bool `json:"readOnly,omitempty" description:"mounted read-only if true, read-write otherwise (false or unspecified)"` |
|
| 616 |
+ // Required. |
|
| 617 |
+ MountPath string `json:"mountPath" description:"path within the container at which the volume should be mounted"` |
|
| 618 |
+} |
|
| 619 |
+ |
|
| 620 |
+// EnvVar represents an environment variable present in a Container. |
|
| 621 |
+type EnvVar struct {
|
|
| 622 |
+ // Required: This must be a C_IDENTIFIER. |
|
| 623 |
+ Name string `json:"name" description:"name of the environment variable; must be a C_IDENTIFIER"` |
|
| 624 |
+ // Optional: no more than one of the following may be specified. |
|
| 625 |
+ // Optional: Defaults to ""; variable references $(VAR_NAME) are expanded |
|
| 626 |
+ // using the previous defined environment variables in the container and |
|
| 627 |
+ // any service environment variables. If a variable cannot be resolved, |
|
| 628 |
+ // the reference in the input string will be unchanged. The $(VAR_NAME) |
|
| 629 |
+ // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped |
|
| 630 |
+ // references will never be expanded, regardless of whether the variable |
|
| 631 |
+ // exists or not. |
|
| 632 |
+ Value string `json:"value,omitempty" description:"value of the environment variable; defaults to empty string; variable references $(VAR_NAME) are expanded using the previously defined environment varibles in the container and any service environment variables; if a variable cannot be resolved, the reference in the input string will be unchanged; the $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME) ; escaped references will never be expanded, regardless of whether the variable exists or not"` |
|
| 633 |
+ // Optional: Specifies a source the value of this var should come from. |
|
| 634 |
+ ValueFrom *EnvVarSource `json:"valueFrom,omitempty" description:"source for the environment variable's value; cannot be used if value is not empty"` |
|
| 635 |
+} |
|
| 636 |
+ |
|
| 637 |
+// EnvVarSource represents a source for the value of an EnvVar. |
|
| 638 |
+type EnvVarSource struct {
|
|
| 639 |
+ // Required: Selects a field of the pod; only name and namespace are supported. |
|
| 640 |
+ FieldRef *ObjectFieldSelector `json:"fieldRef" description:"selects a field of the pod; only name and namespace are supported"` |
|
| 641 |
+} |
|
| 642 |
+ |
|
| 643 |
+// ObjectFieldSelector selects an APIVersioned field of an object. |
|
| 644 |
+type ObjectFieldSelector struct {
|
|
| 645 |
+ // Optional: Version of the schema the FieldPath is written in terms of, defaults to "v1beta3" |
|
| 646 |
+ APIVersion string `json:"apiVersion,omitempty" description:"version of the schema that fieldPath is written in terms of; defaults to v1beta3"` |
|
| 647 |
+ // Required: Path of the field to select in the specified API version |
|
| 648 |
+ FieldPath string `json:"fieldPath" description:"path of the field to select in the specified API version"` |
|
| 649 |
+} |
|
| 650 |
+ |
|
| 651 |
+// HTTPGetAction describes an action based on HTTP Get requests. |
|
| 652 |
+type HTTPGetAction struct {
|
|
| 653 |
+ // Optional: Path to access on the HTTP server. |
|
| 654 |
+ Path string `json:"path,omitempty" description:"path to access on the HTTP server"` |
|
| 655 |
+ // Required: Name or number of the port to access on the container. |
|
| 656 |
+ Port util.IntOrString `json:"port" description:"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"` |
|
| 657 |
+ // Optional: Host name to connect to, defaults to the pod IP. |
|
| 658 |
+ Host string `json:"host,omitempty" description:"hostname to connect to; defaults to pod IP"` |
|
| 659 |
+ // Optional: Scheme to use for connecting to the host, defaults to HTTP. |
|
| 660 |
+ Scheme URIScheme `json:"scheme,omitempty" description:"scheme to connect with, must be HTTP or HTTPS, defaults to HTTP"` |
|
| 661 |
+} |
|
| 662 |
+ |
|
| 663 |
+// URIScheme identifies the scheme used for connection to a host for Get actions |
|
| 664 |
+type URIScheme string |
|
| 665 |
+ |
|
| 666 |
+const ( |
|
| 667 |
+ // URISchemeHTTP means that the scheme used will be http:// |
|
| 668 |
+ URISchemeHTTP URIScheme = "HTTP" |
|
| 669 |
+ // URISchemeHTTPS means that the scheme used will be https:// |
|
| 670 |
+ URISchemeHTTPS URIScheme = "HTTPS" |
|
| 671 |
+) |
|
| 672 |
+ |
|
| 673 |
+// TCPSocketAction describes an action based on opening a socket |
|
| 674 |
+type TCPSocketAction struct {
|
|
| 675 |
+ // Required: Port to connect to. |
|
| 676 |
+ Port util.IntOrString `json:"port" description:"number or name of the port to access on the container; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"` |
|
| 677 |
+} |
|
| 678 |
+ |
|
| 679 |
+// ExecAction describes a "run in container" action. |
|
| 680 |
+type ExecAction struct {
|
|
| 681 |
+ // Command is the command line to execute inside the container, the working directory for the |
|
| 682 |
+ // command is root ('/') in the container's filesystem. The command is simply exec'd, it is
|
|
| 683 |
+ // not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
|
|
| 684 |
+ // a shell, you need to explicitly call out to that shell. |
|
| 685 |
+ Command []string `json:"command,omitempty" description:"command line to execute inside the container; working directory for the command is root ('/') in the container's file system; the command is exec'd, not run inside a shell; exit status of 0 is treated as live/healthy and non-zero is unhealthy"`
|
|
| 686 |
+} |
|
| 687 |
+ |
|
| 688 |
+// Probe describes a liveness probe to be examined to the container. |
|
| 689 |
+type Probe struct {
|
|
| 690 |
+ // The action taken to determine the health of a container |
|
| 691 |
+ Handler `json:",inline"` |
|
| 692 |
+ // Length of time before health checking is activated. In seconds. |
|
| 693 |
+ InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty" description:"number of seconds after the container has started before liveness probes are initiated"` |
|
| 694 |
+ // Length of time before health checking times out. In seconds. |
|
| 695 |
+ TimeoutSeconds int64 `json:"timeoutSeconds,omitempty" description:"number of seconds after which liveness probes timeout; defaults to 1 second"` |
|
| 696 |
+} |
|
| 697 |
+ |
|
| 698 |
+// PullPolicy describes a policy for if/when to pull a container image |
|
| 699 |
+type PullPolicy string |
|
| 700 |
+ |
|
| 701 |
+const ( |
|
| 702 |
+ // PullAlways means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. |
|
| 703 |
+ PullAlways PullPolicy = "Always" |
|
| 704 |
+ // PullNever means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present |
|
| 705 |
+ PullNever PullPolicy = "Never" |
|
| 706 |
+ // PullIfNotPresent means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. |
|
| 707 |
+ PullIfNotPresent PullPolicy = "IfNotPresent" |
|
| 708 |
+) |
|
| 709 |
+ |
|
| 710 |
+// Capability represent POSIX capabilities type |
|
| 711 |
+type Capability string |
|
| 712 |
+ |
|
| 713 |
+// Capabilities represent POSIX capabilities that can be added or removed to a running container. |
|
| 714 |
+type Capabilities struct {
|
|
| 715 |
+ // Added capabilities |
|
| 716 |
+ Add []Capability `json:"add,omitempty" description:"added capabilities"` |
|
| 717 |
+ // Removed capabilities |
|
| 718 |
+ Drop []Capability `json:"drop,omitempty" description:"droped capabilities"` |
|
| 719 |
+} |
|
| 720 |
+ |
|
| 721 |
+// ResourceRequirements describes the compute resource requirements. |
|
| 722 |
+type ResourceRequirements struct {
|
|
| 723 |
+ // Limits describes the maximum amount of compute resources required. |
|
| 724 |
+ Limits ResourceList `json:"limits,omitempty" description:"Maximum amount of compute resources allowed"` |
|
| 725 |
+ // Requests describes the minimum amount of compute resources required. |
|
| 726 |
+ // Note: 'Requests' are honored only for Persistent Volumes as of now. |
|
| 727 |
+ // TODO: Update the scheduler to use 'Requests' in addition to 'Limits'. If Request is omitted for a container, |
|
| 728 |
+ // it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value |
|
| 729 |
+ Requests ResourceList `json:"requests,omitempty" description:"Minimum amount of resources requested; requests are honored only for persistent volumes as of now"` |
|
| 730 |
+} |
|
| 731 |
+ |
|
| 732 |
+const ( |
|
| 733 |
+ // TerminationMessagePathDefault means the default path to capture the application termination message running in a container |
|
| 734 |
+ TerminationMessagePathDefault string = "/dev/termination-log" |
|
| 735 |
+) |
|
| 736 |
+ |
|
| 737 |
+// Container represents a single container that is expected to be run on the host. |
|
| 738 |
+type Container struct {
|
|
| 739 |
+ // Required: This must be a DNS_LABEL. Each container in a pod must |
|
| 740 |
+ // have a unique name. |
|
| 741 |
+ Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated"` |
|
| 742 |
+ // Required. |
|
| 743 |
+ Image string `json:"image" description:"Docker image name"` |
|
| 744 |
+ // Optional: The docker image's entrypoint is used if this is not provided; cannot be updated. |
|
| 745 |
+ // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable |
|
| 746 |
+ // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax |
|
| 747 |
+ // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, |
|
| 748 |
+ // regardless of whether the variable exists or not. |
|
| 749 |
+ Command []string `json:"command,omitempty" description:"entrypoint array; not executed within a shell; the docker image's entrypoint is used if this is not provided; cannot be updated; variable references $(VAR_NAME) are expanded using the container's environment variables; if a variable cannot be resolved, the reference in the input string will be unchanged; the $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME) ; escaped references will never be expanded, regardless of whether the variable exists or not"` |
|
| 750 |
+ // Optional: The docker image's cmd is used if this is not provided; cannot be updated. |
|
| 751 |
+ // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable |
|
| 752 |
+ // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax |
|
| 753 |
+ // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, |
|
| 754 |
+ // regardless of whether the variable exists or not. |
|
| 755 |
+ Args []string `json:"args,omitempty" description:"command array; the docker image's cmd is used if this is not provided; arguments to the entrypoint; cannot be updated; variable references $(VAR_NAME) are expanded using the container's environment variables; if a variable cannot be resolved, the reference in the input string will be unchanged; the $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME) ; escaped references will never be expanded, regardless of whether the variable exists or not"` |
|
| 756 |
+ // Optional: Defaults to Docker's default. |
|
| 757 |
+ WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default; cannot be updated"` |
|
| 758 |
+ Ports []ContainerPort `json:"ports,omitempty" description:"list of ports to expose from the container; cannot be updated" patchStrategy:"merge" patchMergeKey:"containerPort"` |
|
| 759 |
+ Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container; cannot be updated" patchStrategy:"merge" patchMergeKey:"name"` |
|
| 760 |
+ Resources ResourceRequirements `json:"resources,omitempty" description:"Compute Resources required by this container; cannot be updated"` |
|
| 761 |
+ VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" description:"pod volumes to mount into the container's filesyste; cannot be updated" patchStrategy:"merge" patchMergeKey:"name"` |
|
| 762 |
+ LivenessProbe *Probe `json:"livenessProbe,omitempty" description:"periodic probe of container liveness; container will be restarted if the probe fails; cannot be updated"` |
|
| 763 |
+ ReadinessProbe *Probe `json:"readinessProbe,omitempty" description:"periodic probe of container service readiness; container will be removed from service endpoints if the probe fails; cannot be updated"` |
|
| 764 |
+ Lifecycle *Lifecycle `json:"lifecycle,omitempty" description:"actions that the management system should take in response to container lifecycle events; cannot be updated"` |
|
| 765 |
+ // Optional: Defaults to /dev/termination-log |
|
| 766 |
+ TerminationMessagePath string `json:"terminationMessagePath,omitempty" description:"path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated"` |
|
| 767 |
+ // Deprecated - see SecurityContext. Optional: Default to false. |
|
| 768 |
+ Privileged bool `json:"privileged,omitempty" description:"whether or not the container is granted privileged status; defaults to false; cannot be updated; deprecated; See SecurityContext."` |
|
| 769 |
+ // Optional: Policy for pulling images for this container |
|
| 770 |
+ ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" description:"image pull policy; one of Always, Never, IfNotPresent; defaults to Always if :latest tag is specified, or IfNotPresent otherwise; cannot be updated"` |
|
| 771 |
+ // Deprecated - see SecurityContext. Optional: Capabilities for container. |
|
| 772 |
+ Capabilities Capabilities `json:"capabilities,omitempty" description:"capabilities for container; cannot be updated; deprecated; See SecurityContext."` |
|
| 773 |
+ // Optional: SecurityContext defines the security options the pod should be run with |
|
| 774 |
+ SecurityContext *SecurityContext `json:"securityContext,omitempty" description:"security options the pod should run with"` |
|
| 775 |
+ |
|
| 776 |
+ // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) |
|
| 777 |
+ // and shouldn't be used for general purpose containers. |
|
| 778 |
+ Stdin bool `json:"stdin,omitempty" description:"Whether this container should allocate a buffer for stdin in the container runtime; default is false"` |
|
| 779 |
+ TTY bool `json:"tty,omitempty" description:"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true; default is false"` |
|
| 780 |
+} |
|
| 781 |
+ |
|
| 782 |
+// Handler defines a specific action that should be taken |
|
| 783 |
+// TODO: pass structured data to these actions, and document that data here. |
|
| 784 |
+type Handler struct {
|
|
| 785 |
+ // One and only one of the following should be specified. |
|
| 786 |
+ // Exec specifies the action to take. |
|
| 787 |
+ Exec *ExecAction `json:"exec,omitempty" description:"exec-based handler"` |
|
| 788 |
+ // HTTPGet specifies the http request to perform. |
|
| 789 |
+ HTTPGet *HTTPGetAction `json:"httpGet,omitempty" description:"HTTP-based handler"` |
|
| 790 |
+ // TCPSocket specifies an action involving a TCP port. |
|
| 791 |
+ // TODO: implement a realistic TCP lifecycle hook |
|
| 792 |
+ TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" description:"TCP-based handler; TCP hooks not yet supported"` |
|
| 793 |
+} |
|
| 794 |
+ |
|
| 795 |
+// Lifecycle describes actions that the management system should take in response to container lifecycle |
|
| 796 |
+// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks |
|
| 797 |
+// until the action is complete, unless the container process fails, in which case the handler is aborted. |
|
| 798 |
+type Lifecycle struct {
|
|
| 799 |
+ // PostStart is called immediately after a container is created. If the handler fails, the container |
|
| 800 |
+ // is terminated and restarted. |
|
| 801 |
+ PostStart *Handler `json:"postStart,omitempty" description:"called immediately after a container is started; if the handler fails, the container is terminated and restarted according to its restart policy; other management of the container blocks until the hook completes"` |
|
| 802 |
+ // PreStop is called immediately before a container is terminated. The reason for termination is |
|
| 803 |
+ // passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. |
|
| 804 |
+ PreStop *Handler `json:"preStop,omitempty" description:"called before a container is terminated; the container is terminated after the handler completes; other management of the container blocks until the hook completes"` |
|
| 805 |
+} |
|
| 806 |
+ |
|
| 807 |
+type ConditionStatus string |
|
| 808 |
+ |
|
| 809 |
+// These are valid condition statuses. "ConditionTrue" means a resource is in the condition; |
|
| 810 |
+// "ConditionFalse" means a resource is not in the condition; "ConditionUnknown" means kubernetes |
|
| 811 |
+// can't decide if a resource is in the condition or not. In the future, we could add other |
|
| 812 |
+// intermediate conditions, e.g. ConditionDegraded. |
|
| 813 |
+const ( |
|
| 814 |
+ ConditionTrue ConditionStatus = "True" |
|
| 815 |
+ ConditionFalse ConditionStatus = "False" |
|
| 816 |
+ ConditionUnknown ConditionStatus = "Unknown" |
|
| 817 |
+) |
|
| 818 |
+ |
|
| 819 |
+type ContainerStateWaiting struct {
|
|
| 820 |
+ // Reason could be pulling image, |
|
| 821 |
+ Reason string `json:"reason,omitempty" description:"(brief) reason the container is not yet running, such as pulling its image"` |
|
| 822 |
+} |
|
| 823 |
+ |
|
| 824 |
+type ContainerStateRunning struct {
|
|
| 825 |
+ StartedAt util.Time `json:"startedAt,omitempty" description:"time at which the container was last (re-)started"` |
|
| 826 |
+} |
|
| 827 |
+ |
|
| 828 |
+type ContainerStateTerminated struct {
|
|
| 829 |
+ ExitCode int `json:"exitCode" description:"exit status from the last termination of the container"` |
|
| 830 |
+ Signal int `json:"signal,omitempty" description:"signal from the last termination of the container"` |
|
| 831 |
+ Reason string `json:"reason,omitempty" description:"(brief) reason from the last termination of the container"` |
|
| 832 |
+ Message string `json:"message,omitempty" description:"message regarding the last termination of the container"` |
|
| 833 |
+ StartedAt util.Time `json:"startedAt,omitempty" description:"time at which previous execution of the container started"` |
|
| 834 |
+ FinishedAt util.Time `json:"finishedAt,omitempty" description:"time at which the container last terminated"` |
|
| 835 |
+ ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://<container_id>'"` |
|
| 836 |
+} |
|
| 837 |
+ |
|
| 838 |
+// ContainerState holds a possible state of container. |
|
| 839 |
+// Only one of its members may be specified. |
|
| 840 |
+// If none of them is specified, the default one is ContainerStateWaiting. |
|
| 841 |
+type ContainerState struct {
|
|
| 842 |
+ Waiting *ContainerStateWaiting `json:"waiting,omitempty" description:"details about a waiting container"` |
|
| 843 |
+ Running *ContainerStateRunning `json:"running,omitempty" description:"details about a running container"` |
|
| 844 |
+ Termination *ContainerStateTerminated `json:"termination,omitempty" description:"details about a terminated container"` |
|
| 845 |
+} |
|
| 846 |
+ |
|
| 847 |
+type ContainerStatus struct {
|
|
| 848 |
+ // Required: This must be a DNS_LABEL. Each container in a pod must have a unique name. |
|
| 849 |
+ Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated"` |
|
| 850 |
+ // TODO(dchen1107): Should we rename PodStatus to a more generic name or have a separate states |
|
| 851 |
+ // defined for container? |
|
| 852 |
+ State ContainerState `json:"state,omitempty" description:"details about the container's current condition"` |
|
| 853 |
+ LastTerminationState ContainerState `json:"lastState,omitempty" description:"details about the container's last termination condition"` |
|
| 854 |
+ Ready bool `json:"ready" description:"specifies whether the container has passed its readiness probe"` |
|
| 855 |
+ // Note that this is calculated from dead containers. But those containers are subject to |
|
| 856 |
+ // garbage collection. This value will get capped at 5 by GC. |
|
| 857 |
+ RestartCount int `json:"restartCount" description:"the number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed"` |
|
| 858 |
+ // TODO(dchen1107): Which image the container is running with? |
|
| 859 |
+ // The image the container is running |
|
| 860 |
+ Image string `json:"image" description:"image of the container"` |
|
| 861 |
+ ImageID string `json:"imageID" description:"ID of the container's image"` |
|
| 862 |
+ ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://<container_id>'"` |
|
| 863 |
+} |
|
| 864 |
+ |
|
| 865 |
+// PodPhase is a label for the condition of a pod at the current time. |
|
| 866 |
+type PodPhase string |
|
| 867 |
+ |
|
| 868 |
+// These are the valid statuses of pods. |
|
| 869 |
+const ( |
|
| 870 |
+ // PodPending means the pod has been accepted by the system, but one or more of the containers |
|
| 871 |
+ // has not been started. This includes time before being bound to a node, as well as time spent |
|
| 872 |
+ // pulling images onto the host. |
|
| 873 |
+ PodPending PodPhase = "Pending" |
|
| 874 |
+ // PodRunning means the pod has been bound to a node and all of the containers have been started. |
|
| 875 |
+ // At least one container is still running or is in the process of being restarted. |
|
| 876 |
+ PodRunning PodPhase = "Running" |
|
| 877 |
+ // PodSucceeded means that all containers in the pod have voluntarily terminated |
|
| 878 |
+ // with a container exit code of 0, and the system is not going to restart any of these containers. |
|
| 879 |
+ PodSucceeded PodPhase = "Succeeded" |
|
| 880 |
+ // PodFailed means that all containers in the pod have terminated, and at least one container has |
|
| 881 |
+ // terminated in a failure (exited with a non-zero exit code or was stopped by the system). |
|
| 882 |
+ PodFailed PodPhase = "Failed" |
|
| 883 |
+ // PodUnknown means that for some reason the state of the pod could not be obtained, typically due |
|
| 884 |
+ // to an error in communicating with the host of the pod. |
|
| 885 |
+ PodUnknown PodPhase = "Unknown" |
|
| 886 |
+) |
|
| 887 |
+ |
|
| 888 |
+// PodConditionType is a valid value for PodCondition.Type |
|
| 889 |
+type PodConditionType string |
|
| 890 |
+ |
|
| 891 |
+// These are valid conditions of pod. |
|
| 892 |
+const ( |
|
| 893 |
+ // PodReady means the pod is able to service requests and should be added to the |
|
| 894 |
+ // load balancing pools of all matching services. |
|
| 895 |
+ PodReady PodConditionType = "Ready" |
|
| 896 |
+) |
|
| 897 |
+ |
|
| 898 |
+// TODO: add LastTransitionTime, Reason, Message to match NodeCondition api. |
|
| 899 |
+type PodCondition struct {
|
|
| 900 |
+ // Type is the type of the condition |
|
| 901 |
+ Type PodConditionType `json:"type" description:"kind of the condition, currently only Ready"` |
|
| 902 |
+ // Status is the status of the condition |
|
| 903 |
+ Status ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` |
|
| 904 |
+} |
|
| 905 |
+ |
|
| 906 |
+// RestartPolicy describes how the container should be restarted. |
|
| 907 |
+// Only one of the following restart policies may be specified. |
|
| 908 |
+// If none of the following policies is specified, the default one |
|
| 909 |
+// is RestartPolicyAlways. |
|
| 910 |
+type RestartPolicy string |
|
| 911 |
+ |
|
| 912 |
+const ( |
|
| 913 |
+ RestartPolicyAlways RestartPolicy = "Always" |
|
| 914 |
+ RestartPolicyOnFailure RestartPolicy = "OnFailure" |
|
| 915 |
+ RestartPolicyNever RestartPolicy = "Never" |
|
| 916 |
+) |
|
| 917 |
+ |
|
| 918 |
+// DNSPolicy defines how a pod's DNS will be configured. |
|
| 919 |
+type DNSPolicy string |
|
| 920 |
+ |
|
| 921 |
+const ( |
|
| 922 |
+ // DNSClusterFirst indicates that the pod should use cluster DNS |
|
| 923 |
+ // first, if it is available, then fall back on the default (as |
|
| 924 |
+ // determined by kubelet) DNS settings. |
|
| 925 |
+ DNSClusterFirst DNSPolicy = "ClusterFirst" |
|
| 926 |
+ |
|
| 927 |
+ // DNSDefault indicates that the pod should use the default (as |
|
| 928 |
+ // determined by kubelet) DNS settings. |
|
| 929 |
+ DNSDefault DNSPolicy = "Default" |
|
| 930 |
+) |
|
| 931 |
+ |
|
| 932 |
+// PodSpec is a description of a pod |
|
| 933 |
+type PodSpec struct {
|
|
| 934 |
+ Volumes []Volume `json:"volumes,omitempty" description:"list of volumes that can be mounted by containers belonging to the pod" patchStrategy:"merge" patchMergeKey:"name"` |
|
| 935 |
+ // Required: there must be at least one container in a pod. |
|
| 936 |
+ Containers []Container `json:"containers" description:"list of containers belonging to the pod; cannot be updated; containers cannot currently be added or removed; there must be at least one container in a Pod" patchStrategy:"merge" patchMergeKey:"name"` |
|
| 937 |
+ RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of Always, OnFailure, Never; defaults to Always"` |
|
| 938 |
+ // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. |
|
| 939 |
+ // Value must be non-negative integer. The value zero indicates delete immediately. |
|
| 940 |
+ // If this value is nil, the default grace period will be used instead. |
|
| 941 |
+ // The grace period is the duration in seconds after the processes running in the pod are sent |
|
| 942 |
+ // a termination signal and the time when the processes are forcibly halted with a kill signal. |
|
| 943 |
+ // Set this value longer than the expected cleanup time for your process. |
|
| 944 |
+ TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" description:"optional duration in seconds the pod needs to terminate gracefully; may be decreased in delete request; value must be non-negative integer; the value zero indicates delete immediately; if this value is not set, the default grace period will be used instead; the grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal; set this value longer than the expected cleanup time for your process"` |
|
| 945 |
+ ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" description:"optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers; value must be a positive integer` |
|
| 946 |
+ // Optional: Set DNS policy. Defaults to "ClusterFirst" |
|
| 947 |
+ DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"` |
|
| 948 |
+ // NodeSelector is a selector which must be true for the pod to fit on a node |
|
| 949 |
+ NodeSelector map[string]string `json:"nodeSelector,omitempty" description:"selector which must match a node's labels for the pod to be scheduled on that node"` |
|
| 950 |
+ |
|
| 951 |
+ // ServiceAccount is the name of the ServiceAccount to use to run this pod |
|
| 952 |
+ ServiceAccount string `json:"serviceAccount,omitempty" description:"name of the ServiceAccount to use to run this pod"` |
|
| 953 |
+ |
|
| 954 |
+ // Host is a request to schedule this pod onto a specific host. If it is non-empty, |
|
| 955 |
+ // the the scheduler simply schedules this pod onto that host, assuming that it fits |
|
| 956 |
+ // resource requirements. |
|
| 957 |
+ Host string `json:"host,omitempty" description:"host requested for this pod"` |
|
| 958 |
+ // Uses the host's network namespace. If this option is set, the ports that will be |
|
| 959 |
+ // used must be specified. |
|
| 960 |
+ // Optional: Default to false. |
|
| 961 |
+ HostNetwork bool `json:"hostNetwork,omitempty" description:"host networking requested for this pod"` |
|
| 962 |
+ // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. |
|
| 963 |
+ // If specified, these secrets will be passed to individual puller implementations for them to use. For example, |
|
| 964 |
+ // in the case of docker, only DockerConfig type secrets are honored. |
|
| 965 |
+ ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" description:"list of references to secrets in the same namespace available for pulling the container images" patchStrategy:"merge" patchMergeKey:"name"` |
|
| 966 |
+} |
|
| 967 |
+ |
|
| 968 |
+// PodStatus represents information about the status of a pod. Status may trail the actual |
|
| 969 |
+// state of a system. |
|
| 970 |
+type PodStatus struct {
|
|
| 971 |
+ Phase PodPhase `json:"phase,omitempty" description:"current condition of the pod."` |
|
| 972 |
+ Conditions []PodCondition `json:"Condition,omitempty" description:"current service state of pod" patchStrategy:"merge" patchMergeKey:"type"` |
|
| 973 |
+ // A human readable message indicating details about why the pod is in this state. |
|
| 974 |
+ Message string `json:"message,omitempty" description:"human readable message indicating details about why the pod is in this condition"` |
|
| 975 |
+ // A brief CamelCase message indicating details about why the pod is in this state. e.g. 'OutOfDisk' |
|
| 976 |
+ Reason string `json:"reason,omitempty" description:"(brief-CamelCase) reason indicating details about why the pod is in this condition"` |
|
| 977 |
+ |
|
| 978 |
+ HostIP string `json:"hostIP,omitempty" description:"IP address of the host to which the pod is assigned; empty if not yet scheduled"` |
|
| 979 |
+ PodIP string `json:"podIP,omitempty" description:"IP address allocated to the pod; routable at least within the cluster; empty if not yet allocated"` |
|
| 980 |
+ |
|
| 981 |
+ StartTime *util.Time `json:"startTime,omitempty" description:"RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod."` |
|
| 982 |
+ |
|
| 983 |
+ // The list has one entry per container in the manifest. Each entry is currently the output |
|
| 984 |
+ // of `docker inspect`. |
|
| 985 |
+ ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" description:"list of container statuses"` |
|
| 986 |
+} |
|
| 987 |
+ |
|
| 988 |
+// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded |
|
| 989 |
+type PodStatusResult struct {
|
|
| 990 |
+ TypeMeta `json:",inline"` |
|
| 991 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 992 |
+ // Status represents the current information about a pod. This data may not be up |
|
| 993 |
+ // to date. |
|
| 994 |
+ Status PodStatus `json:"status,omitempty" description:"most recently observed status of the pod; populated by the system, read-only; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 995 |
+} |
|
| 996 |
+ |
|
| 997 |
+// Pod is a collection of containers that can run on a host. This resource is created |
|
| 998 |
+// by clients and scheduled onto hosts. |
|
| 999 |
+type Pod struct {
|
|
| 1000 |
+ TypeMeta `json:",inline"` |
|
| 1001 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1002 |
+ |
|
| 1003 |
+ // Spec defines the behavior of a pod. |
|
| 1004 |
+ Spec PodSpec `json:"spec,omitempty" description:"specification of the desired behavior of the pod; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1005 |
+ |
|
| 1006 |
+ // Status represents the current information about a pod. This data may not be up |
|
| 1007 |
+ // to date. |
|
| 1008 |
+ Status PodStatus `json:"status,omitempty" description:"most recently observed status of the pod; populated by the system, read-only; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1009 |
+} |
|
| 1010 |
+ |
|
| 1011 |
+// PodList is a list of Pods. |
|
| 1012 |
+type PodList struct {
|
|
| 1013 |
+ TypeMeta `json:",inline"` |
|
| 1014 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#types-kinds"` |
|
| 1015 |
+ |
|
| 1016 |
+ Items []Pod `json:"items" description:"list of pods"` |
|
| 1017 |
+} |
|
| 1018 |
+ |
|
| 1019 |
+// PodTemplateSpec describes the data a pod should have when created from a template |
|
| 1020 |
+type PodTemplateSpec struct {
|
|
| 1021 |
+ // Metadata of the pods created from this template. |
|
| 1022 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1023 |
+ |
|
| 1024 |
+ // Spec defines the behavior of a pod. |
|
| 1025 |
+ Spec PodSpec `json:"spec,omitempty" description:"specification of the desired behavior of the pod; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1026 |
+} |
|
| 1027 |
+ |
|
| 1028 |
+// PodTemplate describes a template for creating copies of a predefined pod. |
|
| 1029 |
+type PodTemplate struct {
|
|
| 1030 |
+ TypeMeta `json:",inline"` |
|
| 1031 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1032 |
+ |
|
| 1033 |
+ // Template defines the pods that will be created from this pod template |
|
| 1034 |
+ Template PodTemplateSpec `json:"template,omitempty" description:"the template of the desired behavior of the pod; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1035 |
+} |
|
| 1036 |
+ |
|
| 1037 |
+// PodTemplateList is a list of PodTemplates. |
|
| 1038 |
+type PodTemplateList struct {
|
|
| 1039 |
+ TypeMeta `json:",inline"` |
|
| 1040 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1041 |
+ |
|
| 1042 |
+ Items []PodTemplate `json:"items" description:"list of pod templates"` |
|
| 1043 |
+} |
|
| 1044 |
+ |
|
| 1045 |
+// ReplicationControllerSpec is the specification of a replication controller. |
|
| 1046 |
+type ReplicationControllerSpec struct {
|
|
| 1047 |
+ // Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. |
|
| 1048 |
+ Replicas *int `json:"replicas,omitempty" description:"number of replicas desired"` |
|
| 1049 |
+ |
|
| 1050 |
+ // Selector is a label query over pods that should match the Replicas count. |
|
| 1051 |
+ // If Selector is empty, it is defaulted to the labels present on the Pod template. |
|
| 1052 |
+ Selector map[string]string `json:"selector,omitempty" description:"label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template"` |
|
| 1053 |
+ |
|
| 1054 |
+ // TemplateRef is a reference to an object that describes the pod that will be created if |
|
| 1055 |
+ // insufficient replicas are detected. |
|
| 1056 |
+ //TemplateRef *ObjectReference `json:"templateRef,omitempty" description:"reference to an object that describes the pod that will be created if insufficient replicas are detected"` |
|
| 1057 |
+ |
|
| 1058 |
+ // Template is the object that describes the pod that will be created if |
|
| 1059 |
+ // insufficient replicas are detected. This takes precedence over a |
|
| 1060 |
+ // TemplateRef. |
|
| 1061 |
+ Template *PodTemplateSpec `json:"template,omitempty" description:"object that describes the pod that will be created if insufficient replicas are detected; takes precendence over templateRef"` |
|
| 1062 |
+} |
|
| 1063 |
+ |
|
| 1064 |
+// ReplicationControllerStatus represents the current status of a replication |
|
| 1065 |
+// controller. |
|
| 1066 |
+type ReplicationControllerStatus struct {
|
|
| 1067 |
+ // Replicas is the number of actual replicas. |
|
| 1068 |
+ Replicas int `json:"replicas" description:"most recently oberved number of replicas"` |
|
| 1069 |
+ |
|
| 1070 |
+ // ObservedGeneration is the most recent generation observed by the controller. |
|
| 1071 |
+ ObservedGeneration int64 `json:"observedGeneration,omitempty" description:"reflects the generation of the most recently observed replication controller"` |
|
| 1072 |
+} |
|
| 1073 |
+ |
|
| 1074 |
+// ReplicationController represents the configuration of a replication controller. |
|
| 1075 |
+type ReplicationController struct {
|
|
| 1076 |
+ TypeMeta `json:",inline"` |
|
| 1077 |
+ // If the Labels of a ReplicationController are empty, they are defaulted to be the same as the Pod(s) that the replication controller manages. |
|
| 1078 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1079 |
+ |
|
| 1080 |
+ // Spec defines the desired behavior of this replication controller. |
|
| 1081 |
+ Spec ReplicationControllerSpec `json:"spec,omitempty" description:"specification of the desired behavior of the replication controller; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1082 |
+ |
|
| 1083 |
+ // Status is the current status of this replication controller. This data may be |
|
| 1084 |
+ // out of date by some window of time. |
|
| 1085 |
+ Status ReplicationControllerStatus `json:"status,omitempty" description:"most recently observed status of the replication controller; populated by the system, read-only; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1086 |
+} |
|
| 1087 |
+ |
|
| 1088 |
+// ReplicationControllerList is a collection of replication controllers. |
|
| 1089 |
+type ReplicationControllerList struct {
|
|
| 1090 |
+ TypeMeta `json:",inline"` |
|
| 1091 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1092 |
+ |
|
| 1093 |
+ Items []ReplicationController `json:"items" description:"list of replication controllers"` |
|
| 1094 |
+} |
|
| 1095 |
+ |
|
| 1096 |
+// Session Affinity Type string |
|
| 1097 |
+type ServiceAffinity string |
|
| 1098 |
+ |
|
| 1099 |
+const ( |
|
| 1100 |
+ // ServiceAffinityClientIP is the Client IP based. |
|
| 1101 |
+ ServiceAffinityClientIP ServiceAffinity = "ClientIP" |
|
| 1102 |
+ |
|
| 1103 |
+ // ServiceAffinityNone - no session affinity. |
|
| 1104 |
+ ServiceAffinityNone ServiceAffinity = "None" |
|
| 1105 |
+) |
|
| 1106 |
+ |
|
| 1107 |
+// Service Type string describes ingress methods for a service |
|
| 1108 |
+type ServiceType string |
|
| 1109 |
+ |
|
| 1110 |
+const ( |
|
| 1111 |
+ // ServiceTypeClusterIP means a service will only be accessible inside the |
|
| 1112 |
+ // cluster, via the portal IP. |
|
| 1113 |
+ ServiceTypeClusterIP ServiceType = "ClusterIP" |
|
| 1114 |
+ |
|
| 1115 |
+ // ServiceTypeNodePort means a service will be exposed on one port of |
|
| 1116 |
+ // every node, in addition to 'ClusterIP' type. |
|
| 1117 |
+ ServiceTypeNodePort ServiceType = "NodePort" |
|
| 1118 |
+ |
|
| 1119 |
+ // ServiceTypeLoadBalancer means a service will be exposed via an |
|
| 1120 |
+ // external load balancer (if the cloud provider supports it), in addition |
|
| 1121 |
+ // to 'NodePort' type. |
|
| 1122 |
+ ServiceTypeLoadBalancer ServiceType = "LoadBalancer" |
|
| 1123 |
+) |
|
| 1124 |
+ |
|
| 1125 |
+// ServiceStatus represents the current status of a service |
|
| 1126 |
+type ServiceStatus struct {
|
|
| 1127 |
+ // LoadBalancer contains the current status of the load-balancer, |
|
| 1128 |
+ // if one is present. |
|
| 1129 |
+ LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty" description:"status of load-balancer"` |
|
| 1130 |
+} |
|
| 1131 |
+ |
|
| 1132 |
+// LoadBalancerStatus represents the status of a load-balancer |
|
| 1133 |
+type LoadBalancerStatus struct {
|
|
| 1134 |
+ // Ingress is a list containing ingress points for the load-balancer; |
|
| 1135 |
+ // traffic intended for the service should be sent to these ingress points. |
|
| 1136 |
+ Ingress []LoadBalancerIngress `json:"ingress,omitempty" description:"load-balancer ingress points"` |
|
| 1137 |
+} |
|
| 1138 |
+ |
|
| 1139 |
+// LoadBalancerIngress represents the status of a load-balancer ingress point: |
|
| 1140 |
+// traffic intended for the service should be sent to an ingress point. |
|
| 1141 |
+type LoadBalancerIngress struct {
|
|
| 1142 |
+ // IP is set for load-balancer ingress points that are IP based |
|
| 1143 |
+ // (typically GCE or OpenStack load-balancers) |
|
| 1144 |
+ IP string `json:"ip,omitempty" description:"IP address of ingress point"` |
|
| 1145 |
+ |
|
| 1146 |
+ // Hostname is set for load-balancer ingress points that are DNS based |
|
| 1147 |
+ // (typically AWS load-balancers) |
|
| 1148 |
+ Hostname string `json:"hostname,omitempty" description:"hostname of ingress point"` |
|
| 1149 |
+} |
|
| 1150 |
+ |
|
| 1151 |
+// ServiceSpec describes the attributes that a user creates on a service |
|
| 1152 |
+type ServiceSpec struct {
|
|
| 1153 |
+ // Required: The list of ports that are exposed by this service. |
|
| 1154 |
+ Ports []ServicePort `json:"ports" description:"ports exposed by the service"` |
|
| 1155 |
+ |
|
| 1156 |
+ // This service will route traffic to pods having labels matching this selector. If null, no endpoints will be automatically created. If empty, all pods will be selected. |
|
| 1157 |
+ Selector map[string]string `json:"selector,omitempty" description:"label keys and values that must match in order to receive traffic for this service; if empty, all pods are selected, if not specified, endpoints must be manually specified"` |
|
| 1158 |
+ |
|
| 1159 |
+ // PortalIP is usually assigned by the master. If specified by the user |
|
| 1160 |
+ // we will try to respect it or else fail the request. This field can |
|
| 1161 |
+ // not be changed by updates. |
|
| 1162 |
+ // Valid values are None, empty string (""), or a valid IP address
|
|
| 1163 |
+ // None can be specified for headless services when proxying is not required |
|
| 1164 |
+ PortalIP string `json:"portalIP,omitempty description: IP address of the service; usually assigned by the system; if specified, it will be allocated to the service if unused, and creation of the service will fail otherwise; cannot be updated; 'None' can be specified for a headless service when proxying is not required"` |
|
| 1165 |
+ |
|
| 1166 |
+ // CreateExternalLoadBalancer indicates whether a load balancer should be created for this service. |
|
| 1167 |
+ CreateExternalLoadBalancer bool `json:"createExternalLoadBalancer,omitempty" description:"set up a cloud-provider-specific load balancer on an external IP"` |
|
| 1168 |
+ |
|
| 1169 |
+ // Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer |
|
| 1170 |
+ Type ServiceType `json:"type,omitempty" description:"type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP"` |
|
| 1171 |
+ |
|
| 1172 |
+ // Deprecated. PublicIPs are used by external load balancers, or can be set by |
|
| 1173 |
+ // users to handle external traffic that arrives at a node. |
|
| 1174 |
+ PublicIPs []string `json:"publicIPs,omitempty" description:"deprecated. externally visible IPs (e.g. load balancers) that should be proxied to this service"` |
|
| 1175 |
+ |
|
| 1176 |
+ // Optional: Supports "ClientIP" and "None". Used to maintain session affinity. |
|
| 1177 |
+ SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty" description:"enable client IP based session affinity; must be ClientIP or None; defaults to None"` |
|
| 1178 |
+} |
|
| 1179 |
+ |
|
| 1180 |
+type ServicePort struct {
|
|
| 1181 |
+ // Optional if only one ServicePort is defined on this service: The |
|
| 1182 |
+ // name of this port within the service. This must be a DNS_LABEL. |
|
| 1183 |
+ // All ports within a ServiceSpec must have unique names. This maps to |
|
| 1184 |
+ // the 'Name' field in EndpointPort objects. |
|
| 1185 |
+ Name string `json:"name,omitempty" description:"the name of this port; optional if only one port is defined"` |
|
| 1186 |
+ |
|
| 1187 |
+ // Optional: The IP protocol for this port. Supports "TCP" and "UDP", |
|
| 1188 |
+ // default is TCP. |
|
| 1189 |
+ Protocol Protocol `json:"protocol,omitempty" description:"the protocol used by this port; must be UDP or TCP; TCP if unspecified"` |
|
| 1190 |
+ |
|
| 1191 |
+ // Required: The port that will be exposed by this service. |
|
| 1192 |
+ Port int `json:"port" description:"the port number that is exposed"` |
|
| 1193 |
+ |
|
| 1194 |
+ // Optional: The target port on pods selected by this service. |
|
| 1195 |
+ // If this is a string, it will be looked up as a named port in the |
|
| 1196 |
+ // target Pod's container ports. If this is not specified, the value |
|
| 1197 |
+ // of Port is used (an identity map). |
|
| 1198 |
+ TargetPort util.IntOrString `json:"targetPort,omitempty" description:"number or name of the port to access on the pods targeted by the service; defaults to the service port; number must be in the range 1 to 65535; name must be a IANA_SVC_NAME"` |
|
| 1199 |
+ |
|
| 1200 |
+ // The port on each node on which this service is exposed. |
|
| 1201 |
+ // Default is to auto-allocate a port if the ServiceType of this Service requires one. |
|
| 1202 |
+ NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"` |
|
| 1203 |
+} |
|
| 1204 |
+ |
|
| 1205 |
+// Service is a named abstraction of software service (for example, mysql) consisting of local port |
|
| 1206 |
+// (for example 3306) that the proxy listens on, and the selector that determines which pods |
|
| 1207 |
+// will answer requests sent through the proxy. |
|
| 1208 |
+type Service struct {
|
|
| 1209 |
+ TypeMeta `json:",inline"` |
|
| 1210 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1211 |
+ |
|
| 1212 |
+ // Spec defines the behavior of a service. |
|
| 1213 |
+ Spec ServiceSpec `json:"spec,omitempty" description:"specification of the desired behavior of the service; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1214 |
+ |
|
| 1215 |
+ // Status represents the current status of a service. |
|
| 1216 |
+ Status ServiceStatus `json:"status,omitempty" description:"most recently observed status of the service; populated by the system, read-only; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1217 |
+} |
|
| 1218 |
+ |
|
| 1219 |
+const ( |
|
| 1220 |
+ // PortalIPNone - do not assign a portal IP |
|
| 1221 |
+ // no proxying required and no environment variables should be created for pods |
|
| 1222 |
+ PortalIPNone = "None" |
|
| 1223 |
+) |
|
| 1224 |
+ |
|
| 1225 |
+// ServiceList holds a list of services. |
|
| 1226 |
+type ServiceList struct {
|
|
| 1227 |
+ TypeMeta `json:",inline"` |
|
| 1228 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1229 |
+ |
|
| 1230 |
+ Items []Service `json:"items" description:"list of services"` |
|
| 1231 |
+} |
|
| 1232 |
+ |
|
| 1233 |
+// ServiceAccount binds together: |
|
| 1234 |
+// * a name, understood by users, and perhaps by peripheral systems, for an identity |
|
| 1235 |
+// * a principal that can be authenticated and authorized |
|
| 1236 |
+// * a set of secrets |
|
| 1237 |
+type ServiceAccount struct {
|
|
| 1238 |
+ TypeMeta `json:",inline"` |
|
| 1239 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1240 |
+ |
|
| 1241 |
+ // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount |
|
| 1242 |
+ Secrets []ObjectReference `json:"secrets,omitempty" description:"list of secrets that can be used by pods running as this service account" patchStrategy:"merge" patchMergeKey:"name"` |
|
| 1243 |
+ |
|
| 1244 |
+ // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images |
|
| 1245 |
+ // in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets |
|
| 1246 |
+ // can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. |
|
| 1247 |
+ ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" description:"list of references to secrets in the same namespace available for pulling container images"` |
|
| 1248 |
+} |
|
| 1249 |
+ |
|
| 1250 |
+// ServiceAccountList is a list of ServiceAccount objects |
|
| 1251 |
+type ServiceAccountList struct {
|
|
| 1252 |
+ TypeMeta `json:",inline"` |
|
| 1253 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1254 |
+ |
|
| 1255 |
+ Items []ServiceAccount `json:"items" description:"list of ServiceAccounts"` |
|
| 1256 |
+} |
|
| 1257 |
+ |
|
| 1258 |
+// Endpoints is a collection of endpoints that implement the actual service. Example: |
|
| 1259 |
+// Name: "mysvc", |
|
| 1260 |
+// Subsets: [ |
|
| 1261 |
+// {
|
|
| 1262 |
+// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
|
|
| 1263 |
+// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
|
|
| 1264 |
+// }, |
|
| 1265 |
+// {
|
|
| 1266 |
+// Addresses: [{"ip": "10.10.3.3"}],
|
|
| 1267 |
+// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
|
|
| 1268 |
+// }, |
|
| 1269 |
+// ] |
|
| 1270 |
+type Endpoints struct {
|
|
| 1271 |
+ TypeMeta `json:",inline"` |
|
| 1272 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1273 |
+ |
|
| 1274 |
+ // The set of all endpoints is the union of all subsets. |
|
| 1275 |
+ Subsets []EndpointSubset `json:"subsets" description:"sets of addresses and ports that comprise a service"` |
|
| 1276 |
+} |
|
| 1277 |
+ |
|
| 1278 |
+// EndpointSubset is a group of addresses with a common set of ports. The |
|
| 1279 |
+// expanded set of endpoints is the Cartesian product of Addresses x Ports. |
|
| 1280 |
+// For example, given: |
|
| 1281 |
+// {
|
|
| 1282 |
+// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
|
|
| 1283 |
+// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
|
|
| 1284 |
+// } |
|
| 1285 |
+// The resulting set of endpoints can be viewed as: |
|
| 1286 |
+// a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], |
|
| 1287 |
+// b: [ 10.10.1.1:309, 10.10.2.2:309 ] |
|
| 1288 |
+type EndpointSubset struct {
|
|
| 1289 |
+ Addresses []EndpointAddress `json:"addresses,omitempty" description:"IP addresses which offer the related ports"` |
|
| 1290 |
+ Ports []EndpointPort `json:"ports,omitempty" description:"port numbers available on the related IP addresses"` |
|
| 1291 |
+} |
|
| 1292 |
+ |
|
| 1293 |
+// EndpointAddress is a tuple that describes single IP address. |
|
| 1294 |
+type EndpointAddress struct {
|
|
| 1295 |
+ // The IP of this endpoint. |
|
| 1296 |
+ // TODO: This should allow hostname or IP, see #4447. |
|
| 1297 |
+ IP string `json:"IP" description:"IP address of the endpoint"` |
|
| 1298 |
+ |
|
| 1299 |
+ // Optional: The kubernetes object related to the entry point. |
|
| 1300 |
+ TargetRef *ObjectReference `json:"targetRef,omitempty" description:"reference to object providing the endpoint"` |
|
| 1301 |
+} |
|
| 1302 |
+ |
|
| 1303 |
+// EndpointPort is a tuple that describes a single port. |
|
| 1304 |
+type EndpointPort struct {
|
|
| 1305 |
+ // The name of this port (corresponds to ServicePort.Name). Optional |
|
| 1306 |
+ // if only one port is defined. Must be a DNS_LABEL. |
|
| 1307 |
+ Name string `json:"name,omitempty" description:"name of this port"` |
|
| 1308 |
+ |
|
| 1309 |
+ // The port number. |
|
| 1310 |
+ Port int `json:"port" description:"port number of the endpoint"` |
|
| 1311 |
+ |
|
| 1312 |
+ // The IP protocol for this port. |
|
| 1313 |
+ Protocol Protocol `json:"protocol,omitempty" description:"protocol for this port; must be UDP or TCP; TCP if unspecified"` |
|
| 1314 |
+} |
|
| 1315 |
+ |
|
| 1316 |
+// EndpointsList is a list of endpoints. |
|
| 1317 |
+type EndpointsList struct {
|
|
| 1318 |
+ TypeMeta `json:",inline"` |
|
| 1319 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1320 |
+ |
|
| 1321 |
+ Items []Endpoints `json:"items" description:"list of endpoints"` |
|
| 1322 |
+} |
|
| 1323 |
+ |
|
| 1324 |
+// NodeSpec describes the attributes that a node is created with. |
|
| 1325 |
+type NodeSpec struct {
|
|
| 1326 |
+ // PodCIDR represents the pod IP range assigned to the node |
|
| 1327 |
+ PodCIDR string `json:"podCIDR,omitempty" description:"pod IP range assigned to the node"` |
|
| 1328 |
+ // External ID of the node assigned by some machine database (e.g. a cloud provider) |
|
| 1329 |
+ ExternalID string `json:"externalID,omitempty" description:"deprecated. External ID assigned to the node by some machine database (e.g. a cloud provider). Defaults to node name when empty."` |
|
| 1330 |
+ // ID of the node assigned by the cloud provider |
|
| 1331 |
+ ProviderID string `json:"providerID,omitempty" description:"ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>"` |
|
| 1332 |
+ // Unschedulable controls node schedulability of new pods. By default node is schedulable. |
|
| 1333 |
+ Unschedulable bool `json:"unschedulable,omitempty" description:"disable pod scheduling on the node"` |
|
| 1334 |
+} |
|
| 1335 |
+ |
|
| 1336 |
+// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. |
|
| 1337 |
+type NodeSystemInfo struct {
|
|
| 1338 |
+ // MachineID is the machine-id reported by the node |
|
| 1339 |
+ MachineID string `json:"machineID" description:"machine-id reported by the node"` |
|
| 1340 |
+ // SystemUUID is the system-uuid reported by the node |
|
| 1341 |
+ SystemUUID string `json:"systemUUID" description:"system-uuid reported by the node"` |
|
| 1342 |
+ // BootID is the boot-id reported by the node |
|
| 1343 |
+ BootID string `json:"bootID" description:"boot id is the boot-id reported by the node"` |
|
| 1344 |
+ // Kernel version reported by the node |
|
| 1345 |
+ KernelVersion string `json:"kernelVersion" description:"Kernel version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64)"` |
|
| 1346 |
+ // OS image used reported by the node |
|
| 1347 |
+ OsImage string `json:"osImage" description:"OS image used reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy))"` |
|
| 1348 |
+ // Container runtime version reported by the node |
|
| 1349 |
+ ContainerRuntimeVersion string `json:"containerRuntimeVersion" description:"Container runtime version reported by the node through runtime remote API (e.g. docker://1.5.0)"` |
|
| 1350 |
+ // Kubelet version reported by the node |
|
| 1351 |
+ KubeletVersion string `json:"kubeletVersion" description:"Kubelet version reported by the node"` |
|
| 1352 |
+ // Kube-proxy version reported by the node |
|
| 1353 |
+ KubeProxyVersion string `json:"kubeProxyVersion" description:"Kube-proxy version reported by the node"` |
|
| 1354 |
+} |
|
| 1355 |
+ |
|
| 1356 |
+// NodeStatus is information about the current status of a node. |
|
| 1357 |
+type NodeStatus struct {
|
|
| 1358 |
+ // Capacity represents the available resources of a node. |
|
| 1359 |
+ // see http://releases.k8s.io/v1.0.0/docs/resources.md for more details. |
|
| 1360 |
+ Capacity ResourceList `json:"capacity,omitempty" description:"compute resource capacity of the node; http://releases.k8s.io/v1.0.0/docs/resources.md"` |
|
| 1361 |
+ // NodePhase is the current lifecycle phase of the node. |
|
| 1362 |
+ Phase NodePhase `json:"phase,omitempty" description:"most recently observed lifecycle phase of the node"` |
|
| 1363 |
+ // Conditions is an array of current node conditions. |
|
| 1364 |
+ Conditions []NodeCondition `json:"conditions,omitempty" description:"list of node conditions observed" patchStrategy:"merge" patchMergeKey:"type"` |
|
| 1365 |
+ // Queried from cloud provider, if available. |
|
| 1366 |
+ Addresses []NodeAddress `json:"addresses,omitempty" description:"list of addresses reachable to the node" patchStrategy:"merge" patchMergeKey:"type"` |
|
| 1367 |
+ // NodeSystemInfo is a set of ids/uuids to uniquely identify the node |
|
| 1368 |
+ NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" description:"set of ids/uuids to uniquely identify the node"` |
|
| 1369 |
+} |
|
| 1370 |
+ |
|
| 1371 |
+type NodePhase string |
|
| 1372 |
+ |
|
| 1373 |
+// These are the valid phases of node. |
|
| 1374 |
+const ( |
|
| 1375 |
+ // NodePending means the node has been created/added by the system, but not configured. |
|
| 1376 |
+ NodePending NodePhase = "Pending" |
|
| 1377 |
+ // NodeRunning means the node has been configured and has Kubernetes components running. |
|
| 1378 |
+ NodeRunning NodePhase = "Running" |
|
| 1379 |
+ // NodeTerminated means the node has been removed from the cluster. |
|
| 1380 |
+ NodeTerminated NodePhase = "Terminated" |
|
| 1381 |
+) |
|
| 1382 |
+ |
|
| 1383 |
+type NodeConditionType string |
|
| 1384 |
+ |
|
| 1385 |
+// These are valid conditions of node. Currently, we don't have enough information to decide |
|
| 1386 |
+// node condition. In the future, we will add more. The proposed set of conditions are: |
|
| 1387 |
+// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable. |
|
| 1388 |
+const ( |
|
| 1389 |
+ // NodeReady means kubelet is healthy and ready to accept pods. |
|
| 1390 |
+ NodeReady NodeConditionType = "Ready" |
|
| 1391 |
+) |
|
| 1392 |
+ |
|
| 1393 |
+type NodeCondition struct {
|
|
| 1394 |
+ Type NodeConditionType `json:"type" description:"type of node condition, currently only Ready"` |
|
| 1395 |
+ Status ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` |
|
| 1396 |
+ LastHeartbeatTime util.Time `json:"lastHeartbeatTime,omitempty" description:"last time we got an update on a given condition"` |
|
| 1397 |
+ LastTransitionTime util.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"` |
|
| 1398 |
+ Reason string `json:"reason,omitempty" description:"(brief) reason for the condition's last transition"` |
|
| 1399 |
+ Message string `json:"message,omitempty" description:"human readable message indicating details about last transition"` |
|
| 1400 |
+} |
|
| 1401 |
+ |
|
| 1402 |
+type NodeAddressType string |
|
| 1403 |
+ |
|
| 1404 |
+// These are valid address type of node. |
|
| 1405 |
+const ( |
|
| 1406 |
+ NodeHostName NodeAddressType = "Hostname" |
|
| 1407 |
+ NodeExternalIP NodeAddressType = "ExternalIP" |
|
| 1408 |
+ NodeInternalIP NodeAddressType = "InternalIP" |
|
| 1409 |
+) |
|
| 1410 |
+ |
|
| 1411 |
+type NodeAddress struct {
|
|
| 1412 |
+ Type NodeAddressType `json:"type" description:"node address type, one of Hostname, ExternalIP or InternalIP"` |
|
| 1413 |
+ Address string `json:"address" description:"the node address"` |
|
| 1414 |
+} |
|
| 1415 |
+ |
|
| 1416 |
+// ResourceName is the name identifying various resources in a ResourceList. |
|
| 1417 |
+type ResourceName string |
|
| 1418 |
+ |
|
| 1419 |
+const ( |
|
| 1420 |
+ // CPU, in cores. (500m = .5 cores) |
|
| 1421 |
+ ResourceCPU ResourceName = "cpu" |
|
| 1422 |
+ // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) |
|
| 1423 |
+ ResourceMemory ResourceName = "memory" |
|
| 1424 |
+ // Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024) |
|
| 1425 |
+ ResourceStorage ResourceName = "storage" |
|
| 1426 |
+) |
|
| 1427 |
+ |
|
| 1428 |
+// ResourceList is a set of (resource name, quantity) pairs. |
|
| 1429 |
+type ResourceList map[ResourceName]resource.Quantity |
|
| 1430 |
+ |
|
| 1431 |
+// Node is a worker node in Kubernetes. |
|
| 1432 |
+// The name of the node according to etcd is in ID. |
|
| 1433 |
+type Node struct {
|
|
| 1434 |
+ TypeMeta `json:",inline"` |
|
| 1435 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1436 |
+ |
|
| 1437 |
+ // Spec defines the behavior of a node. |
|
| 1438 |
+ Spec NodeSpec `json:"spec,omitempty" description:"specification of a node; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1439 |
+ |
|
| 1440 |
+ // Status describes the current status of a Node |
|
| 1441 |
+ Status NodeStatus `json:"status,omitempty" description:"most recently observed status of the node; populated by the system, read-only; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1442 |
+} |
|
| 1443 |
+ |
|
| 1444 |
+// NodeList is a list of minions. |
|
| 1445 |
+type NodeList struct {
|
|
| 1446 |
+ TypeMeta `json:",inline"` |
|
| 1447 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1448 |
+ |
|
| 1449 |
+ Items []Node `json:"items" description:"list of nodes"` |
|
| 1450 |
+} |
|
| 1451 |
+ |
|
| 1452 |
+type FinalizerName string |
|
| 1453 |
+ |
|
| 1454 |
+// These are internal finalizer values to Kubernetes, must be qualified name unless defined here |
|
| 1455 |
+const ( |
|
| 1456 |
+ FinalizerKubernetes FinalizerName = "kubernetes" |
|
| 1457 |
+) |
|
| 1458 |
+ |
|
| 1459 |
+// NamespaceSpec describes the attributes on a Namespace |
|
| 1460 |
+type NamespaceSpec struct {
|
|
| 1461 |
+ // Finalizers is an opaque list of values that must be empty to permanently remove object from storage |
|
| 1462 |
+ Finalizers []FinalizerName `json:"finalizers,omitempty" description:"an opaque list of values that must be empty to permanently remove object from storage"` |
|
| 1463 |
+} |
|
| 1464 |
+ |
|
| 1465 |
+// NamespaceStatus is information about the current status of a Namespace. |
|
| 1466 |
+type NamespaceStatus struct {
|
|
| 1467 |
+ // Phase is the current lifecycle phase of the namespace. |
|
| 1468 |
+ Phase NamespacePhase `json:"phase,omitempty" description:"phase is the current lifecycle phase of the namespace"` |
|
| 1469 |
+} |
|
| 1470 |
+ |
|
| 1471 |
+type NamespacePhase string |
|
| 1472 |
+ |
|
| 1473 |
+// These are the valid phases of a namespace. |
|
| 1474 |
+const ( |
|
| 1475 |
+ // NamespaceActive means the namespace is available for use in the system |
|
| 1476 |
+ NamespaceActive NamespacePhase = "Active" |
|
| 1477 |
+ // NamespaceTerminating means the namespace is undergoing graceful termination |
|
| 1478 |
+ NamespaceTerminating NamespacePhase = "Terminating" |
|
| 1479 |
+) |
|
| 1480 |
+ |
|
| 1481 |
+// A namespace provides a scope for Names. |
|
| 1482 |
+// Use of multiple namespaces is optional |
|
| 1483 |
+type Namespace struct {
|
|
| 1484 |
+ TypeMeta `json:",inline"` |
|
| 1485 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1486 |
+ |
|
| 1487 |
+ // Spec defines the behavior of the Namespace. |
|
| 1488 |
+ Spec NamespaceSpec `json:"spec,omitempty" description:"spec defines the behavior of the Namespace; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1489 |
+ |
|
| 1490 |
+ // Status describes the current status of a Namespace |
|
| 1491 |
+ Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1492 |
+} |
|
| 1493 |
+ |
|
| 1494 |
+// NamespaceList is a list of Namespaces. |
|
| 1495 |
+type NamespaceList struct {
|
|
| 1496 |
+ TypeMeta `json:",inline"` |
|
| 1497 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1498 |
+ |
|
| 1499 |
+ // Items is the list of Namespace objects in the list |
|
| 1500 |
+ Items []Namespace `json:"items" description:"items is the list of Namespace objects in the list"` |
|
| 1501 |
+} |
|
| 1502 |
+ |
|
| 1503 |
+// Binding ties one object to another - for example, a pod is bound to a node by a scheduler. |
|
| 1504 |
+type Binding struct {
|
|
| 1505 |
+ TypeMeta `json:",inline"` |
|
| 1506 |
+ // ObjectMeta describes the object that is being bound. |
|
| 1507 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1508 |
+ |
|
| 1509 |
+ // Target is the object to bind to. |
|
| 1510 |
+ Target ObjectReference `json:"target" description:"an object to bind to"` |
|
| 1511 |
+} |
|
| 1512 |
+ |
|
| 1513 |
+// DeleteOptions may be provided when deleting an API object |
|
| 1514 |
+type DeleteOptions struct {
|
|
| 1515 |
+ TypeMeta `json:",inline"` |
|
| 1516 |
+ |
|
| 1517 |
+ // Optional duration in seconds before the object should be deleted. Value must be non-negative integer. |
|
| 1518 |
+ // The value zero indicates delete immediately. If this value is nil, the default grace period for the |
|
| 1519 |
+ // specified type will be used. |
|
| 1520 |
+ GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" description:"the duration in seconds to wait before deleting this object; defaults to a per object value if not specified; zero means delete immediately"` |
|
| 1521 |
+} |
|
| 1522 |
+ |
|
| 1523 |
+// ListOptions is the query options to a standard REST list call |
|
| 1524 |
+type ListOptions struct {
|
|
| 1525 |
+ TypeMeta `json:",inline"` |
|
| 1526 |
+ |
|
| 1527 |
+ // A selector based on labels |
|
| 1528 |
+ LabelSelector string `json:"labelSelector,omitempty" description:"a selector to restrict the list of returned objects by their labels; defaults to everything"` |
|
| 1529 |
+ // A selector based on fields |
|
| 1530 |
+ FieldSelector string `json:"fieldSelector,omitempty" description:"a selector to restrict the list of returned objects by their fields; defaults to everything"` |
|
| 1531 |
+ // If true, watch for changes to the selected resources |
|
| 1532 |
+ Watch bool `json:"watch,omitempty" description:"watch for changes to the described resources and return them as a stream of add, update, and remove notifications; specify resourceVersion"` |
|
| 1533 |
+ // The desired resource version to watch |
|
| 1534 |
+ ResourceVersion string `json:"resourceVersion,omitempty" description:"when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history"` |
|
| 1535 |
+} |
|
| 1536 |
+ |
|
| 1537 |
+// PodLogOptions is the query options for a Pod's logs REST call |
|
| 1538 |
+type PodLogOptions struct {
|
|
| 1539 |
+ TypeMeta `json:",inline"` |
|
| 1540 |
+ |
|
| 1541 |
+ // Container for which to return logs |
|
| 1542 |
+ Container string `json:"container,omitempty" description:"the container for which to stream logs; defaults to only container if there is one container in the pod"` |
|
| 1543 |
+ |
|
| 1544 |
+ // If true, follow the logs for the pod |
|
| 1545 |
+ Follow bool `json:"follow,omitempty" description:"follow the log stream of the pod; defaults to false"` |
|
| 1546 |
+ |
|
| 1547 |
+ // If true, return previous terminated container logs |
|
| 1548 |
+ Previous bool `json:"previous,omitempty" description:"return previous terminated container logs; defaults to false"` |
|
| 1549 |
+} |
|
| 1550 |
+ |
|
| 1551 |
+// PodExecOptions is the query options to a Pod's remote exec call |
|
| 1552 |
+type PodExecOptions struct {
|
|
| 1553 |
+ TypeMeta `json:",inline"` |
|
| 1554 |
+ |
|
| 1555 |
+ // Stdin if true indicates that stdin is to be redirected for the exec call |
|
| 1556 |
+ Stdin bool `json:"stdin,omitempty" description:"redirect the standard input stream of the pod for this call; defaults to false"` |
|
| 1557 |
+ |
|
| 1558 |
+ // Stdout if true indicates that stdout is to be redirected for the exec call |
|
| 1559 |
+ Stdout bool `json:"stdout,omitempty" description:"redirect the standard output stream of the pod for this call; defaults to true"` |
|
| 1560 |
+ |
|
| 1561 |
+ // Stderr if true indicates that stderr is to be redirected for the exec call |
|
| 1562 |
+ Stderr bool `json:"stderr,omitempty" description:"redirect the standard error stream of the pod for this call; defaults to true"` |
|
| 1563 |
+ |
|
| 1564 |
+ // TTY if true indicates that a tty will be allocated for the exec call |
|
| 1565 |
+ TTY bool `json:"tty,omitempty" description:"allocate a terminal for this exec call; defaults to false"` |
|
| 1566 |
+ |
|
| 1567 |
+ // Container in which to execute the command. |
|
| 1568 |
+ Container string `json:"container,omitempty" description:"the container in which to execute the command. Defaults to only container if there is only one container in the pod."` |
|
| 1569 |
+ |
|
| 1570 |
+ // Command is the remote command to execute; argv array; not executed within a shell. |
|
| 1571 |
+ Command []string `json:"command" description:"the command to execute; argv array; not executed within a shell"` |
|
| 1572 |
+} |
|
| 1573 |
+ |
|
| 1574 |
+// PodProxyOptions is the query options to a Pod's proxy call |
|
| 1575 |
+type PodProxyOptions struct {
|
|
| 1576 |
+ TypeMeta `json:",inline"` |
|
| 1577 |
+ |
|
| 1578 |
+ // Path is the URL path to use for the current proxy request |
|
| 1579 |
+ Path string `json:"path,omitempty" description:"URL path to use in proxy request to pod"` |
|
| 1580 |
+} |
|
| 1581 |
+ |
|
| 1582 |
+// Status is a return value for calls that don't return other objects. |
|
| 1583 |
+type Status struct {
|
|
| 1584 |
+ TypeMeta `json:",inline"` |
|
| 1585 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1586 |
+ |
|
| 1587 |
+ // One of: "Success" or "Failure" |
|
| 1588 |
+ Status string `json:"status,omitempty" description:"status of the operation; either Success, or Failure"` |
|
| 1589 |
+ // A human-readable description of the status of this operation. |
|
| 1590 |
+ Message string `json:"message,omitempty" description:"human-readable description of the status of this operation"` |
|
| 1591 |
+ // A machine-readable description of why this operation is in the |
|
| 1592 |
+ // "Failure" status. If this value is empty there |
|
| 1593 |
+ // is no information available. A Reason clarifies an HTTP status |
|
| 1594 |
+ // code but does not override it. |
|
| 1595 |
+ Reason StatusReason `json:"reason,omitempty" description:"machine-readable description of why this operation is in the 'Failure' status; if this value is empty there is no information available; a reason clarifies an HTTP status code but does not override it"` |
|
| 1596 |
+ // Extended data associated with the reason. Each reason may define its |
|
| 1597 |
+ // own extended details. This field is optional and the data returned |
|
| 1598 |
+ // is not guaranteed to conform to any schema except that defined by |
|
| 1599 |
+ // the reason type. |
|
| 1600 |
+ Details *StatusDetails `json:"details,omitempty" description:"extended data associated with the reason; each reason may define its own extended details; this field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type"` |
|
| 1601 |
+ // Suggested HTTP return code for this status, 0 if not set. |
|
| 1602 |
+ Code int `json:"code,omitempty" description:"suggested HTTP return code for this status; 0 if not set"` |
|
| 1603 |
+} |
|
| 1604 |
+ |
|
| 1605 |
+// StatusDetails is a set of additional properties that MAY be set by the |
|
| 1606 |
+// server to provide additional information about a response. The Reason |
|
| 1607 |
+// field of a Status object defines what attributes will be set. Clients |
|
| 1608 |
+// must ignore fields that do not match the defined type of each attribute, |
|
| 1609 |
+// and should assume that any attribute may be empty, invalid, or under |
|
| 1610 |
+// defined. |
|
| 1611 |
+type StatusDetails struct {
|
|
| 1612 |
+ // The ID attribute of the resource associated with the status StatusReason |
|
| 1613 |
+ // (when there is a single ID which can be described). |
|
| 1614 |
+ ID string `json:"id,omitempty" description:"the ID attribute of the resource associated with the status StatusReason (when there is a single ID which can be described)"` |
|
| 1615 |
+ // The kind attribute of the resource associated with the status StatusReason. |
|
| 1616 |
+ // On some operations may differ from the requested resource Kind. |
|
| 1617 |
+ Kind string `json:"kind,omitempty" description:"the kind attribute of the resource associated with the status StatusReason; on some operations may differ from the requested resource Kind"` |
|
| 1618 |
+ // The Causes array includes more details associated with the StatusReason |
|
| 1619 |
+ // failure. Not all StatusReasons may provide detailed causes. |
|
| 1620 |
+ Causes []StatusCause `json:"causes,omitempty" description:"the Causes array includes more details associated with the StatusReason failure; not all StatusReasons may provide detailed causes"` |
|
| 1621 |
+ // If specified, the time in seconds before the operation should be retried. |
|
| 1622 |
+ RetryAfterSeconds int `json:"retryAfterSeconds,omitempty" description:"the number of seconds before the client should attempt to retry this operation"` |
|
| 1623 |
+} |
|
| 1624 |
+ |
|
| 1625 |
+// Values of Status.Status |
|
| 1626 |
+const ( |
|
| 1627 |
+ StatusSuccess = "Success" |
|
| 1628 |
+ StatusFailure = "Failure" |
|
| 1629 |
+) |
|
| 1630 |
+ |
|
| 1631 |
+// StatusReason is an enumeration of possible failure causes. Each StatusReason |
|
| 1632 |
+// must map to a single HTTP status code, but multiple reasons may map |
|
| 1633 |
+// to the same HTTP status code. |
|
| 1634 |
+// TODO: move to apiserver |
|
| 1635 |
+type StatusReason string |
|
| 1636 |
+ |
|
| 1637 |
+const ( |
|
| 1638 |
+ // StatusReasonUnknown means the server has declined to indicate a specific reason. |
|
| 1639 |
+ // The details field may contain other information about this error. |
|
| 1640 |
+ // Status code 500. |
|
| 1641 |
+ StatusReasonUnknown StatusReason = "" |
|
| 1642 |
+ |
|
| 1643 |
+ // StatusReasonNotFound means one or more resources required for this operation |
|
| 1644 |
+ // could not be found. |
|
| 1645 |
+ // Details (optional): |
|
| 1646 |
+ // "kind" string - the kind attribute of the missing resource |
|
| 1647 |
+ // on some operations may differ from the requested |
|
| 1648 |
+ // resource. |
|
| 1649 |
+ // "id" string - the identifier of the missing resource |
|
| 1650 |
+ // Status code 404 |
|
| 1651 |
+ StatusReasonNotFound StatusReason = "NotFound" |
|
| 1652 |
+ |
|
| 1653 |
+ // StatusReasonAlreadyExists means the resource you are creating already exists. |
|
| 1654 |
+ // Details (optional): |
|
| 1655 |
+ // "kind" string - the kind attribute of the conflicting resource |
|
| 1656 |
+ // "id" string - the identifier of the conflicting resource |
|
| 1657 |
+ // Status code 409 |
|
| 1658 |
+ StatusReasonAlreadyExists StatusReason = "AlreadyExists" |
|
| 1659 |
+ |
|
| 1660 |
+ // StatusReasonConflict means the requested update operation cannot be completed |
|
| 1661 |
+ // due to a conflict in the operation. The client may need to alter the request. |
|
| 1662 |
+ // Each resource may define custom details that indicate the nature of the |
|
| 1663 |
+ // conflict. |
|
| 1664 |
+ // Status code 409 |
|
| 1665 |
+ StatusReasonConflict StatusReason = "Conflict" |
|
| 1666 |
+ |
|
| 1667 |
+ // StatusReasonInvalid means the requested create or update operation cannot be |
|
| 1668 |
+ // completed due to invalid data provided as part of the request. The client may |
|
| 1669 |
+ // need to alter the request. When set, the client may use the StatusDetails |
|
| 1670 |
+ // message field as a summary of the issues encountered. |
|
| 1671 |
+ // Details (optional): |
|
| 1672 |
+ // "kind" string - the kind attribute of the invalid resource |
|
| 1673 |
+ // "id" string - the identifier of the invalid resource |
|
| 1674 |
+ // "causes" - one or more StatusCause entries indicating the data in the |
|
| 1675 |
+ // provided resource that was invalid. The code, message, and |
|
| 1676 |
+ // field attributes will be set. |
|
| 1677 |
+ // Status code 422 |
|
| 1678 |
+ StatusReasonInvalid StatusReason = "Invalid" |
|
| 1679 |
+ |
|
| 1680 |
+ // StatusReasonServerTimeout means the server can be reached and understood the request, |
|
| 1681 |
+ // but cannot complete the action in a reasonable time. The client should retry the request. |
|
| 1682 |
+ // This is may be due to temporary server load or a transient communication issue with |
|
| 1683 |
+ // another server. Status code 500 is used because the HTTP spec provides no suitable |
|
| 1684 |
+ // server-requested client retry and the 5xx class represents actionable errors. |
|
| 1685 |
+ // Details (optional): |
|
| 1686 |
+ // "kind" string - the kind attribute of the resource being acted on. |
|
| 1687 |
+ // "id" string - the operation that is being attempted. |
|
| 1688 |
+ // Status code 500 |
|
| 1689 |
+ StatusReasonServerTimeout StatusReason = "ServerTimeout" |
|
| 1690 |
+) |
|
| 1691 |
+ |
|
| 1692 |
+// StatusCause provides more information about an api.Status failure, including |
|
| 1693 |
+// cases when multiple errors are encountered. |
|
| 1694 |
+type StatusCause struct {
|
|
| 1695 |
+ // A machine-readable description of the cause of the error. If this value is |
|
| 1696 |
+ // empty there is no information available. |
|
| 1697 |
+ Type CauseType `json:"reason,omitempty" description:"machine-readable description of the cause of the error; if this value is empty there is no information available"` |
|
| 1698 |
+ // A human-readable description of the cause of the error. This field may be |
|
| 1699 |
+ // presented as-is to a reader. |
|
| 1700 |
+ Message string `json:"message,omitempty" description:"human-readable description of the cause of the error; this field may be presented as-is to a reader"` |
|
| 1701 |
+ // The field of the resource that has caused this error, as named by its JSON |
|
| 1702 |
+ // serialization. May include dot and postfix notation for nested attributes. |
|
| 1703 |
+ // Arrays are zero-indexed. Fields may appear more than once in an array of |
|
| 1704 |
+ // causes due to fields having multiple errors. |
|
| 1705 |
+ // Optional. |
|
| 1706 |
+ // |
|
| 1707 |
+ // Examples: |
|
| 1708 |
+ // "name" - the field "name" on the current resource |
|
| 1709 |
+ // "items[0].name" - the field "name" on the first array entry in "items" |
|
| 1710 |
+ Field string `json:"field,omitempty" description:"field of the resource that has caused this error, as named by its JSON serialization; may include dot and postfix notation for nested attributes; arrays are zero-indexed; fields may appear more than once in an array of causes due to fields having multiple errors"` |
|
| 1711 |
+} |
|
| 1712 |
+ |
|
| 1713 |
+// CauseType is a machine readable value providing more detail about what |
|
| 1714 |
+// occured in a status response. An operation may have multiple causes for a |
|
| 1715 |
+// status (whether Failure or Success). |
|
| 1716 |
+type CauseType string |
|
| 1717 |
+ |
|
| 1718 |
+const ( |
|
| 1719 |
+ // CauseTypeFieldValueNotFound is used to report failure to find a requested value |
|
| 1720 |
+ // (e.g. looking up an ID). |
|
| 1721 |
+ CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound" |
|
| 1722 |
+ // CauseTypeFieldValueRequired is used to report required values that are not |
|
| 1723 |
+ // provided (e.g. empty strings, null values, or empty arrays). |
|
| 1724 |
+ CauseTypeFieldValueRequired CauseType = "FieldValueRequired" |
|
| 1725 |
+ // CauseTypeFieldValueDuplicate is used to report collisions of values that must be |
|
| 1726 |
+ // unique (e.g. unique IDs). |
|
| 1727 |
+ CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate" |
|
| 1728 |
+ // CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex |
|
| 1729 |
+ // match). |
|
| 1730 |
+ CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid" |
|
| 1731 |
+ // CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules) |
|
| 1732 |
+ // values that can not be handled (e.g. an enumerated string). |
|
| 1733 |
+ CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported" |
|
| 1734 |
+) |
|
| 1735 |
+ |
|
| 1736 |
+// ObjectReference contains enough information to let you inspect or modify the referred object. |
|
| 1737 |
+type ObjectReference struct {
|
|
| 1738 |
+ Kind string `json:"kind,omitempty" description:"kind of the referent"` |
|
| 1739 |
+ Namespace string `json:"namespace,omitempty" description:"namespace of the referent"` |
|
| 1740 |
+ Name string `json:"name,omitempty" description:"name of the referent"` |
|
| 1741 |
+ UID types.UID `json:"uid,omitempty" description:"uid of the referent"` |
|
| 1742 |
+ APIVersion string `json:"apiVersion,omitempty" description:"API version of the referent"` |
|
| 1743 |
+ ResourceVersion string `json:"resourceVersion,omitempty" description:"specific resourceVersion to which this reference is made, if any: http://releases.k8s.io/v1.0.0/docs/api-conventions.md#concurrency-control-and-consistency"` |
|
| 1744 |
+ |
|
| 1745 |
+ // Optional. If referring to a piece of an object instead of an entire object, this string |
|
| 1746 |
+ // should contain information to identify the sub-object. For example, if the object |
|
| 1747 |
+ // reference is to a container within a pod, this would take on a value like: |
|
| 1748 |
+ // "spec.containers{name}" (where "name" refers to the name of the container that triggered
|
|
| 1749 |
+ // the event) or if no container name is specified "spec.containers[2]" (container with |
|
| 1750 |
+ // index 2 in this pod). This syntax is chosen only to have some well-defined way of |
|
| 1751 |
+ // referencing a part of an object. |
|
| 1752 |
+ // TODO: this design is not final and this field is subject to change in the future. |
|
| 1753 |
+ FieldPath string `json:"fieldPath,omitempty" description:"if referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]"` |
|
| 1754 |
+} |
|
| 1755 |
+ |
|
| 1756 |
+// LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. |
|
| 1757 |
+type LocalObjectReference struct {
|
|
| 1758 |
+ //TODO: Add other useful fields. apiVersion, kind, uid? |
|
| 1759 |
+ Name string `json:"name,omitempty" description:"name of the referent"` |
|
| 1760 |
+} |
|
| 1761 |
+ |
|
| 1762 |
+type SerializedReference struct {
|
|
| 1763 |
+ TypeMeta `json:",inline"` |
|
| 1764 |
+ Reference ObjectReference `json:"reference,omitempty" description:"the reference to an object in the system"` |
|
| 1765 |
+} |
|
| 1766 |
+ |
|
| 1767 |
+type EventSource struct {
|
|
| 1768 |
+ // Component from which the event is generated. |
|
| 1769 |
+ Component string `json:"component,omitempty" description:"component that generated the event"` |
|
| 1770 |
+ // Host name on which the event is generated. |
|
| 1771 |
+ Host string `json:"host,omitempty" description:"name of the host where the event is generated"` |
|
| 1772 |
+} |
|
| 1773 |
+ |
|
| 1774 |
+// Event is a report of an event somewhere in the cluster. |
|
| 1775 |
+// TODO: Decide whether to store these separately or with the object they apply to. |
|
| 1776 |
+type Event struct {
|
|
| 1777 |
+ TypeMeta `json:",inline"` |
|
| 1778 |
+ ObjectMeta `json:"metadata" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1779 |
+ |
|
| 1780 |
+ // Required. The object that this event is about. |
|
| 1781 |
+ InvolvedObject ObjectReference `json:"involvedObject" description:"object this event is about"` |
|
| 1782 |
+ |
|
| 1783 |
+ // Optional; this should be a short, machine understandable string that gives the reason |
|
| 1784 |
+ // for this event being generated. |
|
| 1785 |
+ // TODO: provide exact specification for format. |
|
| 1786 |
+ Reason string `json:"reason,omitempty" description:"short, machine understandable string that gives the reason for the transition into the object's current status"` |
|
| 1787 |
+ |
|
| 1788 |
+ // Optional. A human-readable description of the status of this operation. |
|
| 1789 |
+ // TODO: decide on maximum length. |
|
| 1790 |
+ Message string `json:"message,omitempty" description:"human-readable description of the status of this operation"` |
|
| 1791 |
+ |
|
| 1792 |
+ // Optional. The component reporting this event. Should be a short machine understandable string. |
|
| 1793 |
+ Source EventSource `json:"source,omitempty" description:"component reporting this event"` |
|
| 1794 |
+ |
|
| 1795 |
+ // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) |
|
| 1796 |
+ FirstTimestamp util.Time `json:"firstTimestamp,omitempty" description:"the time at which the event was first recorded"` |
|
| 1797 |
+ |
|
| 1798 |
+ // The time at which the most recent occurance of this event was recorded. |
|
| 1799 |
+ LastTimestamp util.Time `json:"lastTimestamp,omitempty" description:"the time at which the most recent occurance of this event was recorded"` |
|
| 1800 |
+ |
|
| 1801 |
+ // The number of times this event has occurred. |
|
| 1802 |
+ Count int `json:"count,omitempty" description:"the number of times this event has occurred"` |
|
| 1803 |
+} |
|
| 1804 |
+ |
|
| 1805 |
+// EventList is a list of events. |
|
| 1806 |
+type EventList struct {
|
|
| 1807 |
+ TypeMeta `json:",inline"` |
|
| 1808 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1809 |
+ |
|
| 1810 |
+ Items []Event `json:"items" description:"list of events"` |
|
| 1811 |
+} |
|
| 1812 |
+ |
|
| 1813 |
+// List holds a list of objects, which may not be known by the server. |
|
| 1814 |
+type List struct {
|
|
| 1815 |
+ TypeMeta `json:",inline"` |
|
| 1816 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1817 |
+ |
|
| 1818 |
+ Items []runtime.RawExtension `json:"items" description:"list of objects"` |
|
| 1819 |
+} |
|
| 1820 |
+ |
|
| 1821 |
+// A type of object that is limited |
|
| 1822 |
+type LimitType string |
|
| 1823 |
+ |
|
| 1824 |
+const ( |
|
| 1825 |
+ // Limit that applies to all pods in a namespace |
|
| 1826 |
+ LimitTypePod LimitType = "Pod" |
|
| 1827 |
+ // Limit that applies to all containers in a namespace |
|
| 1828 |
+ LimitTypeContainer LimitType = "Container" |
|
| 1829 |
+) |
|
| 1830 |
+ |
|
| 1831 |
+// LimitRangeItem defines a min/max usage limit for any resource that matches on kind |
|
| 1832 |
+type LimitRangeItem struct {
|
|
| 1833 |
+ // Type of resource that this limit applies to |
|
| 1834 |
+ Type LimitType `json:"type,omitempty" description:"type of resource that this limit applies to"` |
|
| 1835 |
+ // Max usage constraints on this kind by resource name |
|
| 1836 |
+ Max ResourceList `json:"max,omitempty" description:"max usage constraints on this kind by resource name"` |
|
| 1837 |
+ // Min usage constraints on this kind by resource name |
|
| 1838 |
+ Min ResourceList `json:"min,omitempty" description:"min usage constraints on this kind by resource name"` |
|
| 1839 |
+ // Default usage constraints on this kind by resource name |
|
| 1840 |
+ Default ResourceList `json:"default,omitempty" description:"default values on this kind by resource name if omitted"` |
|
| 1841 |
+ // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted. |
|
| 1842 |
+ DefaultRequest ResourceList `json:"defaultRequest,omitempty"` |
|
| 1843 |
+ // MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. |
|
| 1844 |
+ MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty"` |
|
| 1845 |
+} |
|
| 1846 |
+ |
|
| 1847 |
+// LimitRangeSpec defines a min/max usage limit for resources that match on kind |
|
| 1848 |
+type LimitRangeSpec struct {
|
|
| 1849 |
+ // Limits is the list of LimitRangeItem objects that are enforced |
|
| 1850 |
+ Limits []LimitRangeItem `json:"limits" description:"limits is the list of LimitRangeItem objects that are enforced"` |
|
| 1851 |
+} |
|
| 1852 |
+ |
|
| 1853 |
+// LimitRange sets resource usage limits for each kind of resource in a Namespace |
|
| 1854 |
+type LimitRange struct {
|
|
| 1855 |
+ TypeMeta `json:",inline"` |
|
| 1856 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1857 |
+ |
|
| 1858 |
+ // Spec defines the limits enforced |
|
| 1859 |
+ Spec LimitRangeSpec `json:"spec,omitempty" description:"spec defines the limits enforced; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1860 |
+} |
|
| 1861 |
+ |
|
| 1862 |
+// LimitRangeList is a list of LimitRange items. |
|
| 1863 |
+type LimitRangeList struct {
|
|
| 1864 |
+ TypeMeta `json:",inline"` |
|
| 1865 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1866 |
+ |
|
| 1867 |
+ // Items is a list of LimitRange objects |
|
| 1868 |
+ Items []LimitRange `json:"items" description:"items is a list of LimitRange objects"` |
|
| 1869 |
+} |
|
| 1870 |
+ |
|
| 1871 |
+// The following identify resource constants for Kubernetes object types |
|
| 1872 |
+const ( |
|
| 1873 |
+ // Pods, number |
|
| 1874 |
+ ResourcePods ResourceName = "pods" |
|
| 1875 |
+ // Services, number |
|
| 1876 |
+ ResourceServices ResourceName = "services" |
|
| 1877 |
+ // ReplicationControllers, number |
|
| 1878 |
+ ResourceReplicationControllers ResourceName = "replicationcontrollers" |
|
| 1879 |
+ // ResourceQuotas, number |
|
| 1880 |
+ ResourceQuotas ResourceName = "resourcequotas" |
|
| 1881 |
+ // ResourceSecrets, number |
|
| 1882 |
+ ResourceSecrets ResourceName = "secrets" |
|
| 1883 |
+ // ResourcePersistentVolumeClaims, number |
|
| 1884 |
+ ResourcePersistentVolumeClaims ResourceName = "persistentvolumeclaims" |
|
| 1885 |
+) |
|
| 1886 |
+ |
|
| 1887 |
+// ResourceQuotaSpec defines the desired hard limits to enforce for Quota |
|
| 1888 |
+type ResourceQuotaSpec struct {
|
|
| 1889 |
+ // Hard is the set of desired hard limits for each named resource |
|
| 1890 |
+ Hard ResourceList `json:"hard,omitempty" description:"hard is the set of desired hard limits for each named resource"` |
|
| 1891 |
+} |
|
| 1892 |
+ |
|
| 1893 |
+// ResourceQuotaStatus defines the enforced hard limits and observed use |
|
| 1894 |
+type ResourceQuotaStatus struct {
|
|
| 1895 |
+ // Hard is the set of enforced hard limits for each named resource |
|
| 1896 |
+ Hard ResourceList `json:"hard,omitempty" description:"hard is the set of enforced hard limits for each named resource"` |
|
| 1897 |
+ // Used is the current observed total usage of the resource in the namespace |
|
| 1898 |
+ Used ResourceList `json:"used,omitempty" description:"used is the current observed total usage of the resource in the namespace"` |
|
| 1899 |
+} |
|
| 1900 |
+ |
|
| 1901 |
+// ResourceQuota sets aggregate quota restrictions enforced per namespace |
|
| 1902 |
+type ResourceQuota struct {
|
|
| 1903 |
+ TypeMeta `json:",inline"` |
|
| 1904 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1905 |
+ |
|
| 1906 |
+ // Spec defines the desired quota |
|
| 1907 |
+ Spec ResourceQuotaSpec `json:"spec,omitempty" description:"spec defines the desired quota; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1908 |
+ |
|
| 1909 |
+ // Status defines the actual enforced quota and its current usage |
|
| 1910 |
+ Status ResourceQuotaStatus `json:"status,omitempty" description:"status defines the actual enforced quota and current usage; http://releases.k8s.io/v1.0.0/docs/api-conventions.md#spec-and-status"` |
|
| 1911 |
+} |
|
| 1912 |
+ |
|
| 1913 |
+// ResourceQuotaList is a list of ResourceQuota items |
|
| 1914 |
+type ResourceQuotaList struct {
|
|
| 1915 |
+ TypeMeta `json:",inline"` |
|
| 1916 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1917 |
+ |
|
| 1918 |
+ // Items is a list of ResourceQuota objects |
|
| 1919 |
+ Items []ResourceQuota `json:"items" description:"items is a list of ResourceQuota objects"` |
|
| 1920 |
+} |
|
| 1921 |
+ |
|
| 1922 |
+// Secret holds secret data of a certain type. The total bytes of the values in |
|
| 1923 |
+// the Data field must be less than MaxSecretSize bytes. |
|
| 1924 |
+type Secret struct {
|
|
| 1925 |
+ TypeMeta `json:",inline"` |
|
| 1926 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1927 |
+ |
|
| 1928 |
+ // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN |
|
| 1929 |
+ // or leading dot followed by valid DNS_SUBDOMAIN. |
|
| 1930 |
+ // The serialized form of the secret data is a base64 encoded string, |
|
| 1931 |
+ // representing the arbitrary (possibly non-string) data value here. |
|
| 1932 |
+ Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN or leading dot followed by valid DNS_SUBDOMAIN. Each value must be a base64 encoded string as described in https://tools.ietf.org/html/rfc4648#section-4"` |
|
| 1933 |
+ |
|
| 1934 |
+ // Used to facilitate programmatic handling of secret data. |
|
| 1935 |
+ Type SecretType `json:"type,omitempty" description:"type facilitates programmatic handling of secret data"` |
|
| 1936 |
+} |
|
| 1937 |
+ |
|
| 1938 |
+const MaxSecretSize = 1 * 1024 * 1024 |
|
| 1939 |
+ |
|
| 1940 |
+type SecretType string |
|
| 1941 |
+ |
|
| 1942 |
+const ( |
|
| 1943 |
+ // SecretTypeOpaque is the default; arbitrary user-defined data |
|
| 1944 |
+ SecretTypeOpaque SecretType = "Opaque" |
|
| 1945 |
+ |
|
| 1946 |
+ // SecretTypeServiceAccountToken contains a token that identifies a service account to the API |
|
| 1947 |
+ // |
|
| 1948 |
+ // Required fields: |
|
| 1949 |
+ // - Secret.Annotations["kubernetes.io/service-account.name"] - the name of the ServiceAccount the token identifies |
|
| 1950 |
+ // - Secret.Annotations["kubernetes.io/service-account.uid"] - the UID of the ServiceAccount the token identifies |
|
| 1951 |
+ // - Secret.Data["token"] - a token that identifies the service account to the API |
|
| 1952 |
+ SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token" |
|
| 1953 |
+ |
|
| 1954 |
+ // ServiceAccountNameKey is the key of the required annotation for SecretTypeServiceAccountToken secrets |
|
| 1955 |
+ ServiceAccountNameKey = "kubernetes.io/service-account.name" |
|
| 1956 |
+ // ServiceAccountUIDKey is the key of the required annotation for SecretTypeServiceAccountToken secrets |
|
| 1957 |
+ ServiceAccountUIDKey = "kubernetes.io/service-account.uid" |
|
| 1958 |
+ // ServiceAccountTokenKey is the key of the required data for SecretTypeServiceAccountToken secrets |
|
| 1959 |
+ ServiceAccountTokenKey = "token" |
|
| 1960 |
+ // ServiceAccountKubeconfigKey is the key of the optional kubeconfig data for SecretTypeServiceAccountToken secrets |
|
| 1961 |
+ ServiceAccountKubeconfigKey = "kubernetes.kubeconfig" |
|
| 1962 |
+ // ServiceAccountRootCAKey is the key of the optional root certificate authority for SecretTypeServiceAccountToken secrets |
|
| 1963 |
+ ServiceAccountRootCAKey = "ca.crt" |
|
| 1964 |
+ |
|
| 1965 |
+ // SecretTypeDockercfg contains a dockercfg file that follows the same format rules as ~/.dockercfg |
|
| 1966 |
+ // |
|
| 1967 |
+ // Required fields: |
|
| 1968 |
+ // - Secret.Data[".dockercfg"] - a serialized ~/.dockercfg file |
|
| 1969 |
+ SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg" |
|
| 1970 |
+ |
|
| 1971 |
+ // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets |
|
| 1972 |
+ DockerConfigKey = ".dockercfg" |
|
| 1973 |
+) |
|
| 1974 |
+ |
|
| 1975 |
+type SecretList struct {
|
|
| 1976 |
+ TypeMeta `json:",inline"` |
|
| 1977 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 1978 |
+ |
|
| 1979 |
+ Items []Secret `json:"items" description:"items is a list of secret objects"` |
|
| 1980 |
+} |
|
| 1981 |
+ |
|
| 1982 |
+// Type and constants for component health validation. |
|
| 1983 |
+type ComponentConditionType string |
|
| 1984 |
+ |
|
| 1985 |
+// These are the valid conditions for the component. |
|
| 1986 |
+const ( |
|
| 1987 |
+ ComponentHealthy ComponentConditionType = "Healthy" |
|
| 1988 |
+) |
|
| 1989 |
+ |
|
| 1990 |
+type ComponentCondition struct {
|
|
| 1991 |
+ Type ComponentConditionType `json:"type" description:"type of component condition, currently only Healthy"` |
|
| 1992 |
+ Status ConditionStatus `json:"status" description:"current status of this component condition, one of True, False, Unknown"` |
|
| 1993 |
+ Message string `json:"message,omitempty" description:"health check message received from the component"` |
|
| 1994 |
+ Error string `json:"error,omitempty" description:"error code from health check attempt (if any)"` |
|
| 1995 |
+} |
|
| 1996 |
+ |
|
| 1997 |
+// ComponentStatus (and ComponentStatusList) holds the cluster validation info. |
|
| 1998 |
+type ComponentStatus struct {
|
|
| 1999 |
+ TypeMeta `json:",inline"` |
|
| 2000 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard object metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 2001 |
+ |
|
| 2002 |
+ Conditions []ComponentCondition `json:"conditions,omitempty" description:"list of component conditions observed" patchStrategy:"merge" patchMergeKey:"type"` |
|
| 2003 |
+} |
|
| 2004 |
+ |
|
| 2005 |
+type ComponentStatusList struct {
|
|
| 2006 |
+ TypeMeta `json:",inline"` |
|
| 2007 |
+ ListMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 2008 |
+ |
|
| 2009 |
+ Items []ComponentStatus `json:"items" description:"list of component status objects"` |
|
| 2010 |
+} |
|
| 2011 |
+ |
|
| 2012 |
+// SecurityContext holds security configuration that will be applied to a container. SecurityContext |
|
| 2013 |
+// contains duplication of some existing fields from the Container resource. These duplicate fields |
|
| 2014 |
+// will be populated based on the Container configuration if they are not set. Defining them on |
|
| 2015 |
+// both the Container AND the SecurityContext will result in an error. |
|
| 2016 |
+type SecurityContext struct {
|
|
| 2017 |
+ // Capabilities are the capabilities to add/drop when running the container |
|
| 2018 |
+ // Must match Container.Capabilities or be unset. Will be defaulted to Container.Capabilities if left unset |
|
| 2019 |
+ Capabilities *Capabilities `json:"capabilities,omitempty" description:"the linux capabilites that should be added or removed"` |
|
| 2020 |
+ |
|
| 2021 |
+ // Run the container in privileged mode |
|
| 2022 |
+ // Must match Container.Privileged or be unset. Will be defaulted to Container.Privileged if left unset |
|
| 2023 |
+ Privileged *bool `json:"privileged,omitempty" description:"run the container in privileged mode"` |
|
| 2024 |
+ |
|
| 2025 |
+ // SELinuxOptions are the labels to be applied to the container |
|
| 2026 |
+ // and volumes |
|
| 2027 |
+ SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" description:"options that control the SELinux labels applied"` |
|
| 2028 |
+ |
|
| 2029 |
+ // RunAsUser is the UID to run the entrypoint of the container process. |
|
| 2030 |
+ RunAsUser *int64 `json:"runAsUser,omitempty" description:"the user id that runs the first process in the container"` |
|
| 2031 |
+ |
|
| 2032 |
+ // RunAsNonRoot indicates that the container should be run as a non-root user. If the RunAsUser |
|
| 2033 |
+ // field is not explicitly set then the kubelet may check the image for a specified user or |
|
| 2034 |
+ // perform defaulting to specify a user. |
|
| 2035 |
+ RunAsNonRoot bool `json:"runAsNonRoot,omitempty" description:"indicates the container be must run as a non-root user either by specifying the runAsUser or in the image specification"` |
|
| 2036 |
+} |
|
| 2037 |
+ |
|
| 2038 |
+// SELinuxOptions are the labels to be applied to the container. |
|
| 2039 |
+type SELinuxOptions struct {
|
|
| 2040 |
+ // SELinux user label |
|
| 2041 |
+ User string `json:"user,omitempty" description:"the user label to apply to the container"` |
|
| 2042 |
+ |
|
| 2043 |
+ // SELinux role label |
|
| 2044 |
+ Role string `json:"role,omitempty" description:"the role label to apply to the container"` |
|
| 2045 |
+ |
|
| 2046 |
+ // SELinux type label |
|
| 2047 |
+ Type string `json:"type,omitempty" description:"the type label to apply to the container"` |
|
| 2048 |
+ |
|
| 2049 |
+ // SELinux level label. |
|
| 2050 |
+ Level string `json:"level,omitempty" description:"the level label to apply to the container"` |
|
| 2051 |
+} |
|
| 2052 |
+ |
|
| 2053 |
+// RangeAllocation is not a public type |
|
| 2054 |
+type RangeAllocation struct {
|
|
| 2055 |
+ TypeMeta `json:",inline"` |
|
| 2056 |
+ ObjectMeta `json:"metadata,omitempty" description:"standard list metadata; see http://releases.k8s.io/v1.0.0/docs/api-conventions.md#metadata"` |
|
| 2057 |
+ |
|
| 2058 |
+ Range string `json:"range" description:"a range string that identifies the range represented by 'data'; required"` |
|
| 2059 |
+ Data []byte `json:"data" description:"a bit array containing all allocated addresses in the previous segment"` |
|
| 2060 |
+} |
|
| 2061 |
+ |
|
| 2062 |
+// SecurityContextConstraints governs the ability to make requests that affect the SecurityContext |
|
| 2063 |
+// that will be applied to a container. |
|
| 2064 |
+type SecurityContextConstraints struct {
|
|
| 2065 |
+ TypeMeta `json:",inline"` |
|
| 2066 |
+ ObjectMeta `json:"metadata,omitempty"` |
|
| 2067 |
+ |
|
| 2068 |
+ // AllowPrivilegedContainer determines if a container can request to be run as privileged. |
|
| 2069 |
+ AllowPrivilegedContainer bool `json:"allowPrivilegedContainer" description:"allow containers to run as privileged"` |
|
| 2070 |
+ // AllowedCapabilities is a list of capabilities that can be requested to add to the container. |
|
| 2071 |
+ AllowedCapabilities []Capability `json:"allowedCapabilities" description:"capabilities that are allowed to be added"` |
|
| 2072 |
+ // AllowHostDirVolumePlugin determines if the policy allow containers to use the HostDir volume plugin |
|
| 2073 |
+ AllowHostDirVolumePlugin bool `json:"allowHostDirVolumePlugin" description:"allow the use of the host dir volume plugin"` |
|
| 2074 |
+ // AllowHostNetwork determines if the policy allows the use of HostNetwork in the pod spec. |
|
| 2075 |
+ AllowHostNetwork bool `json:"allowHostNetwork" description:"allow the use of the hostNetwork in the pod spec"` |
|
| 2076 |
+ // AllowHostPorts determines if the policy allows host ports in the containers. |
|
| 2077 |
+ AllowHostPorts bool `json:"allowHostPorts" description:"allow the use of the host ports in the containers"` |
|
| 2078 |
+ // SELinuxContext is the strategy that will dictate what labels will be set in the SecurityContext. |
|
| 2079 |
+ SELinuxContext SELinuxContextStrategyOptions `json:"seLinuxContext,omitempty" description:"strategy used to generate SELinuxOptions"` |
|
| 2080 |
+ // RunAsUser is the strategy that will dictate what RunAsUser is used in the SecurityContext. |
|
| 2081 |
+ RunAsUser RunAsUserStrategyOptions `json:"runAsUser,omitempty" description:"strategy used to generate RunAsUser"` |
|
| 2082 |
+ |
|
| 2083 |
+ // The users who have permissions to use this security context constraints |
|
| 2084 |
+ Users []string `json:"users,omitempty" description:"users allowed to use this SecurityContextConstraints"` |
|
| 2085 |
+ // The groups that have permission to use this security context constraints |
|
| 2086 |
+ Groups []string `json:"groups,omitempty" description:"groups allowed to use this SecurityContextConstraints"` |
|
| 2087 |
+} |
|
| 2088 |
+ |
|
| 2089 |
+// SELinuxContextStrategyOptions defines the strategy type and any options used to create the strategy. |
|
| 2090 |
+type SELinuxContextStrategyOptions struct {
|
|
| 2091 |
+ // Type is the strategy that will dictate what SELinux context is used in the SecurityContext. |
|
| 2092 |
+ Type SELinuxContextStrategyType `json:"type,omitempty" description:"strategy used to generate the SELinux context"` |
|
| 2093 |
+ // seLinuxOptions required to run as; required for MustRunAs |
|
| 2094 |
+ SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" description:"seLinuxOptions required to run as; required for MustRunAs"` |
|
| 2095 |
+} |
|
| 2096 |
+ |
|
| 2097 |
+// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. |
|
| 2098 |
+type RunAsUserStrategyOptions struct {
|
|
| 2099 |
+ // Type is the strategy that will dictate what RunAsUser is used in the SecurityContext. |
|
| 2100 |
+ Type RunAsUserStrategyType `json:"type,omitempty" description:"strategy used to generate RunAsUser"` |
|
| 2101 |
+ // UID is the user id that containers must run as. Required for the MustRunAs strategy if not using |
|
| 2102 |
+ // namespace/service account allocated uids. |
|
| 2103 |
+ UID *int64 `json:"uid,omitempty" description:"the uid to always run as; required for MustRunAs"` |
|
| 2104 |
+ // UIDRangeMin defines the min value for a strategy that allocates by range. |
|
| 2105 |
+ UIDRangeMin *int64 `json:"uidRangeMin,omitempty" description:"min value for range based allocators"` |
|
| 2106 |
+ // UIDRangeMax defines the max value for a strategy that allocates by range. |
|
| 2107 |
+ UIDRangeMax *int64 `json:"uidRangeMax,omitempty" description:"max value for range based allocators"` |
|
| 2108 |
+} |
|
| 2109 |
+ |
|
| 2110 |
+// SELinuxContextStrategyType denotes strategy types for generating SELinux options for a |
|
| 2111 |
+// SecurityContext |
|
| 2112 |
+type SELinuxContextStrategyType string |
|
| 2113 |
+ |
|
| 2114 |
+// RunAsUserStrategyType denotes strategy types for generating RunAsUser values for a |
|
| 2115 |
+// SecurityContext |
|
| 2116 |
+type RunAsUserStrategyType string |
|
| 2117 |
+ |
|
| 2118 |
+const ( |
|
| 2119 |
+ // container must have SELinux labels of X applied. |
|
| 2120 |
+ SELinuxStrategyMustRunAs SELinuxContextStrategyType = "MustRunAs" |
|
| 2121 |
+ // container may make requests for any SELinux context labels. |
|
| 2122 |
+ SELinuxStrategyRunAsAny SELinuxContextStrategyType = "RunAsAny" |
|
| 2123 |
+ |
|
| 2124 |
+ // container must run as a particular uid. |
|
| 2125 |
+ RunAsUserStrategyMustRunAs RunAsUserStrategyType = "MustRunAs" |
|
| 2126 |
+ // container must run as a particular uid. |
|
| 2127 |
+ RunAsUserStrategyMustRunAsRange RunAsUserStrategyType = "MustRunAsRange" |
|
| 2128 |
+ // container must run as a non-root uid |
|
| 2129 |
+ RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategyType = "MustRunAsNonRoot" |
|
| 2130 |
+ // container may make requests for any uid. |
|
| 2131 |
+ RunAsUserStrategyRunAsAny RunAsUserStrategyType = "RunAsAny" |
|
| 2132 |
+) |
|
| 2133 |
+ |
|
| 2134 |
+// SecurityContextConstraintsList is a list of SecurityContextConstraints objects |
|
| 2135 |
+type SecurityContextConstraintsList struct {
|
|
| 2136 |
+ TypeMeta `json:",inline"` |
|
| 2137 |
+ ListMeta `json:"metadata,omitempty"` |
|
| 2138 |
+ |
|
| 2139 |
+ Items []SecurityContextConstraints `json:"items"` |
|
| 2140 |
+} |
| ... | ... |
@@ -321,6 +321,40 @@ func (v versionToResourceToFieldMapping) filterField(apiVersion, resourceType, f |
| 321 | 321 |
} |
| 322 | 322 |
|
| 323 | 323 |
var fieldMappings = versionToResourceToFieldMapping{
|
| 324 |
+ "v1beta3": resourceTypeToFieldMapping{
|
|
| 325 |
+ "nodes": clientFieldNameToAPIVersionFieldName{
|
|
| 326 |
+ ObjectNameField: "metadata.name", |
|
| 327 |
+ NodeUnschedulable: "spec.unschedulable", |
|
| 328 |
+ }, |
|
| 329 |
+ "minions": clientFieldNameToAPIVersionFieldName{
|
|
| 330 |
+ ObjectNameField: "metadata.name", |
|
| 331 |
+ NodeUnschedulable: "spec.unschedulable", |
|
| 332 |
+ }, |
|
| 333 |
+ "pods": clientFieldNameToAPIVersionFieldName{
|
|
| 334 |
+ PodHost: "spec.host", |
|
| 335 |
+ }, |
|
| 336 |
+ "secrets": clientFieldNameToAPIVersionFieldName{
|
|
| 337 |
+ SecretType: "type", |
|
| 338 |
+ }, |
|
| 339 |
+ "serviceAccounts": clientFieldNameToAPIVersionFieldName{
|
|
| 340 |
+ ObjectNameField: "metadata.name", |
|
| 341 |
+ }, |
|
| 342 |
+ "endpoints": clientFieldNameToAPIVersionFieldName{
|
|
| 343 |
+ ObjectNameField: "metadata.name", |
|
| 344 |
+ }, |
|
| 345 |
+ "events": clientFieldNameToAPIVersionFieldName{
|
|
| 346 |
+ ObjectNameField: "metadata.name", |
|
| 347 |
+ EventReason: "reason", |
|
| 348 |
+ EventSource: "source", |
|
| 349 |
+ EventInvolvedKind: "involvedObject.kind", |
|
| 350 |
+ EventInvolvedNamespace: "involvedObject.namespace", |
|
| 351 |
+ EventInvolvedName: "involvedObject.name", |
|
| 352 |
+ EventInvolvedUID: "involvedObject.uid", |
|
| 353 |
+ EventInvolvedAPIVersion: "involvedObject.apiVersion", |
|
| 354 |
+ EventInvolvedResourceVersion: "involvedObject.resourceVersion", |
|
| 355 |
+ EventInvolvedFieldPath: "involvedObject.fieldPath", |
|
| 356 |
+ }, |
|
| 357 |
+ }, |
|
| 324 | 358 |
"v1": resourceTypeToFieldMapping{
|
| 325 | 359 |
"nodes": clientFieldNameToAPIVersionFieldName{
|
| 326 | 360 |
ObjectNameField: "metadata.name", |
| ... | ... |
@@ -30,6 +30,7 @@ import ( |
| 30 | 30 |
"k8s.io/kubernetes/pkg/api/errors" |
| 31 | 31 |
"k8s.io/kubernetes/pkg/api/meta" |
| 32 | 32 |
"k8s.io/kubernetes/pkg/api/v1" |
| 33 |
+ "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 33 | 34 |
"k8s.io/kubernetes/pkg/kubectl" |
| 34 | 35 |
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" |
| 35 | 36 |
"k8s.io/kubernetes/pkg/kubectl/resource" |
| ... | ... |
@@ -343,6 +344,10 @@ func isReplicasDefaulted(info *resource.Info) bool {
|
| 343 | 343 |
return false |
| 344 | 344 |
} |
| 345 | 345 |
switch info.Mapping.APIVersion {
|
| 346 |
+ case "v1beta3": |
|
| 347 |
+ if rc, ok := info.VersionedObject.(*v1beta3.ReplicationController); ok {
|
|
| 348 |
+ return rc.Spec.Replicas == nil |
|
| 349 |
+ } |
|
| 346 | 350 |
case "v1": |
| 347 | 351 |
if rc, ok := info.VersionedObject.(*v1.ReplicationController); ok {
|
| 348 | 352 |
return rc.Spec.Replicas == nil |
| ... | ... |
@@ -37,6 +37,7 @@ import ( |
| 37 | 37 |
"k8s.io/kubernetes/pkg/api/meta" |
| 38 | 38 |
"k8s.io/kubernetes/pkg/api/rest" |
| 39 | 39 |
"k8s.io/kubernetes/pkg/api/v1" |
| 40 |
+ "k8s.io/kubernetes/pkg/api/v1beta3" |
|
| 40 | 41 |
"k8s.io/kubernetes/pkg/apis/experimental" |
| 41 | 42 |
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest" |
| 42 | 43 |
"k8s.io/kubernetes/pkg/apiserver" |
| ... | ... |
@@ -110,6 +111,8 @@ type Config struct {
|
| 110 | 110 |
EnableUISupport bool |
| 111 | 111 |
// allow downstream consumers to disable swagger |
| 112 | 112 |
EnableSwaggerSupport bool |
| 113 |
+ // allow v1beta3 to be conditionally enabled |
|
| 114 |
+ EnableV1Beta3 bool |
|
| 113 | 115 |
// allow api versions to be conditionally disabled |
| 114 | 116 |
DisableV1 bool |
| 115 | 117 |
EnableExp bool |
| ... | ... |
@@ -202,6 +205,7 @@ type Master struct {
|
| 202 | 202 |
authorizer authorizer.Authorizer |
| 203 | 203 |
admissionControl admission.Interface |
| 204 | 204 |
masterCount int |
| 205 |
+ v1beta3 bool |
|
| 205 | 206 |
v1 bool |
| 206 | 207 |
exp bool |
| 207 | 208 |
requestContextMapper api.RequestContextMapper |
| ... | ... |
@@ -360,6 +364,7 @@ func New(c *Config) *Master {
|
| 360 | 360 |
authenticator: c.Authenticator, |
| 361 | 361 |
authorizer: c.Authorizer, |
| 362 | 362 |
admissionControl: c.AdmissionControl, |
| 363 |
+ v1beta3: c.EnableV1Beta3, |
|
| 363 | 364 |
v1: !c.DisableV1, |
| 364 | 365 |
exp: c.EnableExp, |
| 365 | 366 |
requestContextMapper: c.RequestContextMapper, |
| ... | ... |
@@ -558,6 +563,12 @@ func (m *Master) init(c *Config) {
|
| 558 | 558 |
} |
| 559 | 559 |
|
| 560 | 560 |
apiVersions := []string{}
|
| 561 |
+ if m.v1beta3 {
|
|
| 562 |
+ if err := m.api_v1beta3().InstallREST(m.handlerContainer); err != nil {
|
|
| 563 |
+ glog.Fatalf("Unable to setup API v1beta3: %v", err)
|
|
| 564 |
+ } |
|
| 565 |
+ apiVersions = append(apiVersions, "v1beta3") |
|
| 566 |
+ } |
|
| 561 | 567 |
if m.v1 {
|
| 562 | 568 |
if err := m.api_v1().InstallREST(m.handlerContainer); err != nil {
|
| 563 | 569 |
glog.Fatalf("Unable to setup API v1: %v", err)
|
| ... | ... |
@@ -762,6 +773,22 @@ func (m *Master) defaultAPIGroupVersion() *apiserver.APIGroupVersion {
|
| 762 | 762 |
} |
| 763 | 763 |
} |
| 764 | 764 |
|
| 765 |
+// api_v1beta3 returns the resources and codec for API version v1beta3. |
|
| 766 |
+func (m *Master) api_v1beta3() *apiserver.APIGroupVersion {
|
|
| 767 |
+ storage := make(map[string]rest.Storage) |
|
| 768 |
+ for k, v := range m.storage {
|
|
| 769 |
+ if k == "minions" || k == "minions/status" {
|
|
| 770 |
+ continue |
|
| 771 |
+ } |
|
| 772 |
+ storage[strings.ToLower(k)] = v |
|
| 773 |
+ } |
|
| 774 |
+ version := m.defaultAPIGroupVersion() |
|
| 775 |
+ version.Storage = storage |
|
| 776 |
+ version.Version = "v1beta3" |
|
| 777 |
+ version.Codec = v1beta3.Codec |
|
| 778 |
+ return version |
|
| 779 |
+} |
|
| 780 |
+ |
|
| 765 | 781 |
// api_v1 returns the resources and codec for API version v1. |
| 766 | 782 |
func (m *Master) api_v1() *apiserver.APIGroupVersion {
|
| 767 | 783 |
storage := make(map[string]rest.Storage) |
| ... | ... |
@@ -5,7 +5,7 @@ import ( |
| 5 | 5 |
|
| 6 | 6 |
"k8s.io/kubernetes/pkg/api" |
| 7 | 7 |
"k8s.io/kubernetes/pkg/conversion" |
| 8 |
- "k8s.io/kubernetes/pkg/util" |
|
| 8 |
+ "k8s.io/kubernetes/pkg/util/sets" |
|
| 9 | 9 |
|
| 10 | 10 |
newer "github.com/openshift/origin/pkg/authorization/api" |
| 11 | 11 |
uservalidation "github.com/openshift/origin/pkg/user/api/validation" |
| ... | ... |
@@ -63,7 +63,7 @@ func convert_v1beta3_SubjectAccessReview_To_api_SubjectAccessReview(in *SubjectA |
| 63 | 63 |
return err |
| 64 | 64 |
} |
| 65 | 65 |
|
| 66 |
- out.Groups = util.NewStringSet(in.GroupsSlice...) |
|
| 66 |
+ out.Groups = sets.NewString(in.GroupsSlice...) |
|
| 67 | 67 |
|
| 68 | 68 |
return nil |
| 69 | 69 |
} |
| ... | ... |
@@ -89,7 +89,7 @@ func convert_v1beta3_LocalSubjectAccessReview_To_api_LocalSubjectAccessReview(in |
| 89 | 89 |
return err |
| 90 | 90 |
} |
| 91 | 91 |
|
| 92 |
- out.Groups = util.NewStringSet(in.GroupsSlice...) |
|
| 92 |
+ out.Groups = sets.NewString(in.GroupsSlice...) |
|
| 93 | 93 |
|
| 94 | 94 |
return nil |
| 95 | 95 |
} |
| ... | ... |
@@ -112,8 +112,8 @@ func convert_v1beta3_ResourceAccessReviewResponse_To_api_ResourceAccessReviewRes |
| 112 | 112 |
return err |
| 113 | 113 |
} |
| 114 | 114 |
|
| 115 |
- out.Users = util.NewStringSet(in.UsersSlice...) |
|
| 116 |
- out.Groups = util.NewStringSet(in.GroupsSlice...) |
|
| 115 |
+ out.Users = sets.NewString(in.UsersSlice...) |
|
| 116 |
+ out.Groups = sets.NewString(in.GroupsSlice...) |
|
| 117 | 117 |
|
| 118 | 118 |
return nil |
| 119 | 119 |
} |
| ... | ... |
@@ -134,16 +134,16 @@ func convert_v1beta3_PolicyRule_To_api_PolicyRule(in *PolicyRule, out *newer.Pol |
| 134 | 134 |
return err |
| 135 | 135 |
} |
| 136 | 136 |
|
| 137 |
- out.Resources = util.StringSet{}
|
|
| 137 |
+ out.Resources = sets.String{}
|
|
| 138 | 138 |
out.Resources.Insert(in.Resources...) |
| 139 | 139 |
out.Resources.Insert(in.ResourceKinds...) |
| 140 | 140 |
|
| 141 |
- out.Verbs = util.StringSet{}
|
|
| 141 |
+ out.Verbs = sets.String{}
|
|
| 142 | 142 |
out.Verbs.Insert(in.Verbs...) |
| 143 | 143 |
|
| 144 |
- out.ResourceNames = util.NewStringSet(in.ResourceNames...) |
|
| 144 |
+ out.ResourceNames = sets.NewString(in.ResourceNames...) |
|
| 145 | 145 |
|
| 146 |
- out.NonResourceURLs = util.NewStringSet(in.NonResourceURLsSlice...) |
|
| 146 |
+ out.NonResourceURLs = sets.NewString(in.NonResourceURLsSlice...) |
|
| 147 | 147 |
|
| 148 | 148 |
return nil |
| 149 | 149 |
} |