zz_generated.defaults.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. // +build !ignore_autogenerated
  2. /*
  3. Copyright The Kubernetes Authors.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. // Code generated by defaulter-gen. DO NOT EDIT.
  15. package v1beta1
  16. import (
  17. v1beta1 "k8s.io/api/batch/v1beta1"
  18. runtime "k8s.io/apimachinery/pkg/runtime"
  19. v1 "k8s.io/kubernetes/pkg/apis/core/v1"
  20. )
  21. // RegisterDefaults adds defaulters functions to the given scheme.
  22. // Public to allow building arbitrary schemes.
  23. // All generated defaulters are covering - they call all nested defaulters.
  24. func RegisterDefaults(scheme *runtime.Scheme) error {
  25. scheme.AddTypeDefaultingFunc(&v1beta1.CronJob{}, func(obj interface{}) { SetObjectDefaults_CronJob(obj.(*v1beta1.CronJob)) })
  26. scheme.AddTypeDefaultingFunc(&v1beta1.CronJobList{}, func(obj interface{}) { SetObjectDefaults_CronJobList(obj.(*v1beta1.CronJobList)) })
  27. scheme.AddTypeDefaultingFunc(&v1beta1.JobTemplate{}, func(obj interface{}) { SetObjectDefaults_JobTemplate(obj.(*v1beta1.JobTemplate)) })
  28. return nil
  29. }
  30. func SetObjectDefaults_CronJob(in *v1beta1.CronJob) {
  31. SetDefaults_CronJob(in)
  32. v1.SetDefaults_PodSpec(&in.Spec.JobTemplate.Spec.Template.Spec)
  33. for i := range in.Spec.JobTemplate.Spec.Template.Spec.Volumes {
  34. a := &in.Spec.JobTemplate.Spec.Template.Spec.Volumes[i]
  35. v1.SetDefaults_Volume(a)
  36. if a.VolumeSource.HostPath != nil {
  37. v1.SetDefaults_HostPathVolumeSource(a.VolumeSource.HostPath)
  38. }
  39. if a.VolumeSource.Secret != nil {
  40. v1.SetDefaults_SecretVolumeSource(a.VolumeSource.Secret)
  41. }
  42. if a.VolumeSource.ISCSI != nil {
  43. v1.SetDefaults_ISCSIVolumeSource(a.VolumeSource.ISCSI)
  44. }
  45. if a.VolumeSource.RBD != nil {
  46. v1.SetDefaults_RBDVolumeSource(a.VolumeSource.RBD)
  47. }
  48. if a.VolumeSource.DownwardAPI != nil {
  49. v1.SetDefaults_DownwardAPIVolumeSource(a.VolumeSource.DownwardAPI)
  50. for j := range a.VolumeSource.DownwardAPI.Items {
  51. b := &a.VolumeSource.DownwardAPI.Items[j]
  52. if b.FieldRef != nil {
  53. v1.SetDefaults_ObjectFieldSelector(b.FieldRef)
  54. }
  55. }
  56. }
  57. if a.VolumeSource.ConfigMap != nil {
  58. v1.SetDefaults_ConfigMapVolumeSource(a.VolumeSource.ConfigMap)
  59. }
  60. if a.VolumeSource.AzureDisk != nil {
  61. v1.SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk)
  62. }
  63. if a.VolumeSource.Projected != nil {
  64. v1.SetDefaults_ProjectedVolumeSource(a.VolumeSource.Projected)
  65. for j := range a.VolumeSource.Projected.Sources {
  66. b := &a.VolumeSource.Projected.Sources[j]
  67. if b.DownwardAPI != nil {
  68. for k := range b.DownwardAPI.Items {
  69. c := &b.DownwardAPI.Items[k]
  70. if c.FieldRef != nil {
  71. v1.SetDefaults_ObjectFieldSelector(c.FieldRef)
  72. }
  73. }
  74. }
  75. if b.ServiceAccountToken != nil {
  76. v1.SetDefaults_ServiceAccountTokenProjection(b.ServiceAccountToken)
  77. }
  78. }
  79. }
  80. if a.VolumeSource.ScaleIO != nil {
  81. v1.SetDefaults_ScaleIOVolumeSource(a.VolumeSource.ScaleIO)
  82. }
  83. }
  84. for i := range in.Spec.JobTemplate.Spec.Template.Spec.InitContainers {
  85. a := &in.Spec.JobTemplate.Spec.Template.Spec.InitContainers[i]
  86. v1.SetDefaults_Container(a)
  87. for j := range a.Ports {
  88. b := &a.Ports[j]
  89. v1.SetDefaults_ContainerPort(b)
  90. }
  91. for j := range a.Env {
  92. b := &a.Env[j]
  93. if b.ValueFrom != nil {
  94. if b.ValueFrom.FieldRef != nil {
  95. v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef)
  96. }
  97. }
  98. }
  99. v1.SetDefaults_ResourceList(&a.Resources.Limits)
  100. v1.SetDefaults_ResourceList(&a.Resources.Requests)
  101. if a.LivenessProbe != nil {
  102. v1.SetDefaults_Probe(a.LivenessProbe)
  103. if a.LivenessProbe.Handler.HTTPGet != nil {
  104. v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
  105. }
  106. }
  107. if a.ReadinessProbe != nil {
  108. v1.SetDefaults_Probe(a.ReadinessProbe)
  109. if a.ReadinessProbe.Handler.HTTPGet != nil {
  110. v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
  111. }
  112. }
  113. if a.Lifecycle != nil {
  114. if a.Lifecycle.PostStart != nil {
  115. if a.Lifecycle.PostStart.HTTPGet != nil {
  116. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet)
  117. }
  118. }
  119. if a.Lifecycle.PreStop != nil {
  120. if a.Lifecycle.PreStop.HTTPGet != nil {
  121. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet)
  122. }
  123. }
  124. }
  125. }
  126. for i := range in.Spec.JobTemplate.Spec.Template.Spec.Containers {
  127. a := &in.Spec.JobTemplate.Spec.Template.Spec.Containers[i]
  128. v1.SetDefaults_Container(a)
  129. for j := range a.Ports {
  130. b := &a.Ports[j]
  131. v1.SetDefaults_ContainerPort(b)
  132. }
  133. for j := range a.Env {
  134. b := &a.Env[j]
  135. if b.ValueFrom != nil {
  136. if b.ValueFrom.FieldRef != nil {
  137. v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef)
  138. }
  139. }
  140. }
  141. v1.SetDefaults_ResourceList(&a.Resources.Limits)
  142. v1.SetDefaults_ResourceList(&a.Resources.Requests)
  143. if a.LivenessProbe != nil {
  144. v1.SetDefaults_Probe(a.LivenessProbe)
  145. if a.LivenessProbe.Handler.HTTPGet != nil {
  146. v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
  147. }
  148. }
  149. if a.ReadinessProbe != nil {
  150. v1.SetDefaults_Probe(a.ReadinessProbe)
  151. if a.ReadinessProbe.Handler.HTTPGet != nil {
  152. v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
  153. }
  154. }
  155. if a.Lifecycle != nil {
  156. if a.Lifecycle.PostStart != nil {
  157. if a.Lifecycle.PostStart.HTTPGet != nil {
  158. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet)
  159. }
  160. }
  161. if a.Lifecycle.PreStop != nil {
  162. if a.Lifecycle.PreStop.HTTPGet != nil {
  163. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet)
  164. }
  165. }
  166. }
  167. }
  168. }
  169. func SetObjectDefaults_CronJobList(in *v1beta1.CronJobList) {
  170. for i := range in.Items {
  171. a := &in.Items[i]
  172. SetObjectDefaults_CronJob(a)
  173. }
  174. }
  175. func SetObjectDefaults_JobTemplate(in *v1beta1.JobTemplate) {
  176. v1.SetDefaults_PodSpec(&in.Template.Spec.Template.Spec)
  177. for i := range in.Template.Spec.Template.Spec.Volumes {
  178. a := &in.Template.Spec.Template.Spec.Volumes[i]
  179. v1.SetDefaults_Volume(a)
  180. if a.VolumeSource.HostPath != nil {
  181. v1.SetDefaults_HostPathVolumeSource(a.VolumeSource.HostPath)
  182. }
  183. if a.VolumeSource.Secret != nil {
  184. v1.SetDefaults_SecretVolumeSource(a.VolumeSource.Secret)
  185. }
  186. if a.VolumeSource.ISCSI != nil {
  187. v1.SetDefaults_ISCSIVolumeSource(a.VolumeSource.ISCSI)
  188. }
  189. if a.VolumeSource.RBD != nil {
  190. v1.SetDefaults_RBDVolumeSource(a.VolumeSource.RBD)
  191. }
  192. if a.VolumeSource.DownwardAPI != nil {
  193. v1.SetDefaults_DownwardAPIVolumeSource(a.VolumeSource.DownwardAPI)
  194. for j := range a.VolumeSource.DownwardAPI.Items {
  195. b := &a.VolumeSource.DownwardAPI.Items[j]
  196. if b.FieldRef != nil {
  197. v1.SetDefaults_ObjectFieldSelector(b.FieldRef)
  198. }
  199. }
  200. }
  201. if a.VolumeSource.ConfigMap != nil {
  202. v1.SetDefaults_ConfigMapVolumeSource(a.VolumeSource.ConfigMap)
  203. }
  204. if a.VolumeSource.AzureDisk != nil {
  205. v1.SetDefaults_AzureDiskVolumeSource(a.VolumeSource.AzureDisk)
  206. }
  207. if a.VolumeSource.Projected != nil {
  208. v1.SetDefaults_ProjectedVolumeSource(a.VolumeSource.Projected)
  209. for j := range a.VolumeSource.Projected.Sources {
  210. b := &a.VolumeSource.Projected.Sources[j]
  211. if b.DownwardAPI != nil {
  212. for k := range b.DownwardAPI.Items {
  213. c := &b.DownwardAPI.Items[k]
  214. if c.FieldRef != nil {
  215. v1.SetDefaults_ObjectFieldSelector(c.FieldRef)
  216. }
  217. }
  218. }
  219. if b.ServiceAccountToken != nil {
  220. v1.SetDefaults_ServiceAccountTokenProjection(b.ServiceAccountToken)
  221. }
  222. }
  223. }
  224. if a.VolumeSource.ScaleIO != nil {
  225. v1.SetDefaults_ScaleIOVolumeSource(a.VolumeSource.ScaleIO)
  226. }
  227. }
  228. for i := range in.Template.Spec.Template.Spec.InitContainers {
  229. a := &in.Template.Spec.Template.Spec.InitContainers[i]
  230. v1.SetDefaults_Container(a)
  231. for j := range a.Ports {
  232. b := &a.Ports[j]
  233. v1.SetDefaults_ContainerPort(b)
  234. }
  235. for j := range a.Env {
  236. b := &a.Env[j]
  237. if b.ValueFrom != nil {
  238. if b.ValueFrom.FieldRef != nil {
  239. v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef)
  240. }
  241. }
  242. }
  243. v1.SetDefaults_ResourceList(&a.Resources.Limits)
  244. v1.SetDefaults_ResourceList(&a.Resources.Requests)
  245. if a.LivenessProbe != nil {
  246. v1.SetDefaults_Probe(a.LivenessProbe)
  247. if a.LivenessProbe.Handler.HTTPGet != nil {
  248. v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
  249. }
  250. }
  251. if a.ReadinessProbe != nil {
  252. v1.SetDefaults_Probe(a.ReadinessProbe)
  253. if a.ReadinessProbe.Handler.HTTPGet != nil {
  254. v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
  255. }
  256. }
  257. if a.Lifecycle != nil {
  258. if a.Lifecycle.PostStart != nil {
  259. if a.Lifecycle.PostStart.HTTPGet != nil {
  260. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet)
  261. }
  262. }
  263. if a.Lifecycle.PreStop != nil {
  264. if a.Lifecycle.PreStop.HTTPGet != nil {
  265. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet)
  266. }
  267. }
  268. }
  269. }
  270. for i := range in.Template.Spec.Template.Spec.Containers {
  271. a := &in.Template.Spec.Template.Spec.Containers[i]
  272. v1.SetDefaults_Container(a)
  273. for j := range a.Ports {
  274. b := &a.Ports[j]
  275. v1.SetDefaults_ContainerPort(b)
  276. }
  277. for j := range a.Env {
  278. b := &a.Env[j]
  279. if b.ValueFrom != nil {
  280. if b.ValueFrom.FieldRef != nil {
  281. v1.SetDefaults_ObjectFieldSelector(b.ValueFrom.FieldRef)
  282. }
  283. }
  284. }
  285. v1.SetDefaults_ResourceList(&a.Resources.Limits)
  286. v1.SetDefaults_ResourceList(&a.Resources.Requests)
  287. if a.LivenessProbe != nil {
  288. v1.SetDefaults_Probe(a.LivenessProbe)
  289. if a.LivenessProbe.Handler.HTTPGet != nil {
  290. v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
  291. }
  292. }
  293. if a.ReadinessProbe != nil {
  294. v1.SetDefaults_Probe(a.ReadinessProbe)
  295. if a.ReadinessProbe.Handler.HTTPGet != nil {
  296. v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
  297. }
  298. }
  299. if a.Lifecycle != nil {
  300. if a.Lifecycle.PostStart != nil {
  301. if a.Lifecycle.PostStart.HTTPGet != nil {
  302. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PostStart.HTTPGet)
  303. }
  304. }
  305. if a.Lifecycle.PreStop != nil {
  306. if a.Lifecycle.PreStop.HTTPGet != nil {
  307. v1.SetDefaults_HTTPGetAction(a.Lifecycle.PreStop.HTTPGet)
  308. }
  309. }
  310. }
  311. }
  312. }