kube-dsl 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (857) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/Gemfile +6 -0
  4. data/Rakefile +89 -1
  5. data/kube-dsl.gemspec +2 -1
  6. data/lib/kube-dsl/allow_blank.rb +9 -0
  7. data/lib/kube-dsl/array_field_res.rb +18 -1
  8. data/lib/kube-dsl/builder.rb +50 -33
  9. data/lib/kube-dsl/default_field_res.rb +5 -0
  10. data/lib/kube-dsl/dsl/admissionregistration/v1/mutating_webhook.rb +50 -42
  11. data/lib/kube-dsl/dsl/admissionregistration/v1/mutating_webhook_configuration.rb +25 -17
  12. data/lib/kube-dsl/dsl/admissionregistration/v1/mutating_webhook_configuration_list.rb +25 -17
  13. data/lib/kube-dsl/dsl/admissionregistration/v1/rule_with_operations.rb +32 -24
  14. data/lib/kube-dsl/dsl/admissionregistration/v1/service_reference.rb +29 -21
  15. data/lib/kube-dsl/dsl/admissionregistration/v1/validating_webhook.rb +47 -39
  16. data/lib/kube-dsl/dsl/admissionregistration/v1/validating_webhook_configuration.rb +25 -17
  17. data/lib/kube-dsl/dsl/admissionregistration/v1/validating_webhook_configuration_list.rb +25 -17
  18. data/lib/kube-dsl/dsl/admissionregistration/v1/webhook_client_config.rb +26 -18
  19. data/lib/kube-dsl/dsl/admissionregistration.rb +0 -1
  20. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_column_definition.rb +35 -27
  21. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_conversion.rb +23 -15
  22. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition.rb +28 -20
  23. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition_condition.rb +32 -24
  24. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition_list.rb +25 -17
  25. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition_names.rb +35 -27
  26. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition_spec.rb +35 -27
  27. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition_status.rb +26 -18
  28. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_definition_version.rb +41 -27
  29. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_subresource_scale.rb +26 -18
  30. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_subresources.rb +23 -15
  31. data/lib/kube-dsl/dsl/apiextensions/v1/custom_resource_validation.rb +20 -12
  32. data/lib/kube-dsl/dsl/apiextensions/v1/external_documentation.rb +23 -15
  33. data/lib/kube-dsl/dsl/apiextensions/v1/json.rb +21 -0
  34. data/lib/kube-dsl/dsl/apiextensions/v1/json_schema_props.rb +140 -132
  35. data/lib/kube-dsl/dsl/apiextensions/v1/service_reference.rb +29 -21
  36. data/lib/kube-dsl/dsl/apiextensions/v1/webhook_client_config.rb +26 -18
  37. data/lib/kube-dsl/dsl/apiextensions/v1/webhook_conversion.rb +23 -15
  38. data/lib/kube-dsl/dsl/apiextensions/v1.rb +2 -1
  39. data/lib/kube-dsl/dsl/apiextensions.rb +0 -1
  40. data/lib/kube-dsl/dsl/apiregistration/v1/api_service.rb +28 -20
  41. data/lib/kube-dsl/dsl/apiregistration/v1/api_service_condition.rb +32 -24
  42. data/lib/kube-dsl/dsl/apiregistration/v1/api_service_list.rb +25 -17
  43. data/lib/kube-dsl/dsl/apiregistration/v1/api_service_spec.rb +38 -30
  44. data/lib/kube-dsl/dsl/apiregistration/v1/api_service_status.rb +20 -12
  45. data/lib/kube-dsl/dsl/apiregistration/v1/service_reference.rb +26 -18
  46. data/lib/kube-dsl/dsl/apiregistration.rb +0 -1
  47. data/lib/kube-dsl/dsl/apiserverinternal/v1alpha1/server_storage_version.rb +31 -0
  48. data/lib/kube-dsl/dsl/apiserverinternal/v1alpha1/storage_version.rb +33 -0
  49. data/lib/kube-dsl/dsl/apiserverinternal/v1alpha1/storage_version_condition.rb +40 -0
  50. data/lib/kube-dsl/dsl/apiserverinternal/v1alpha1/storage_version_list.rb +30 -0
  51. data/lib/kube-dsl/dsl/apiserverinternal/v1alpha1/storage_version_status.rb +31 -0
  52. data/lib/kube-dsl/dsl/apiserverinternal/v1alpha1.rb +7 -0
  53. data/lib/kube-dsl/dsl/apiserverinternal.rb +3 -0
  54. data/lib/kube-dsl/dsl/apps/v1/controller_revision.rb +28 -20
  55. data/lib/kube-dsl/dsl/apps/v1/controller_revision_list.rb +25 -17
  56. data/lib/kube-dsl/dsl/apps/v1/daemon_set.rb +28 -20
  57. data/lib/kube-dsl/dsl/apps/v1/daemon_set_condition.rb +32 -24
  58. data/lib/kube-dsl/dsl/apps/v1/daemon_set_list.rb +25 -17
  59. data/lib/kube-dsl/dsl/apps/v1/daemon_set_spec.rb +32 -24
  60. data/lib/kube-dsl/dsl/apps/v1/daemon_set_status.rb +47 -39
  61. data/lib/kube-dsl/dsl/apps/v1/daemon_set_update_strategy.rb +23 -15
  62. data/lib/kube-dsl/dsl/apps/v1/deployment.rb +28 -20
  63. data/lib/kube-dsl/dsl/apps/v1/deployment_condition.rb +35 -27
  64. data/lib/kube-dsl/dsl/apps/v1/deployment_list.rb +25 -17
  65. data/lib/kube-dsl/dsl/apps/v1/deployment_spec.rb +41 -33
  66. data/lib/kube-dsl/dsl/apps/v1/deployment_status.rb +41 -33
  67. data/lib/kube-dsl/dsl/apps/v1/deployment_strategy.rb +23 -15
  68. data/lib/kube-dsl/dsl/apps/v1/replica_set.rb +28 -20
  69. data/lib/kube-dsl/dsl/apps/v1/replica_set_condition.rb +32 -24
  70. data/lib/kube-dsl/dsl/apps/v1/replica_set_list.rb +25 -17
  71. data/lib/kube-dsl/dsl/apps/v1/replica_set_spec.rb +29 -21
  72. data/lib/kube-dsl/dsl/apps/v1/replica_set_status.rb +35 -27
  73. data/lib/kube-dsl/dsl/apps/v1/rolling_update_daemon_set.rb +23 -12
  74. data/lib/kube-dsl/dsl/apps/v1/rolling_update_deployment.rb +23 -15
  75. data/lib/kube-dsl/dsl/apps/v1/rolling_update_stateful_set_strategy.rb +20 -12
  76. data/lib/kube-dsl/dsl/apps/v1/stateful_set.rb +28 -20
  77. data/lib/kube-dsl/dsl/apps/v1/stateful_set_condition.rb +32 -24
  78. data/lib/kube-dsl/dsl/apps/v1/stateful_set_list.rb +25 -17
  79. data/lib/kube-dsl/dsl/apps/v1/stateful_set_spec.rb +44 -33
  80. data/lib/kube-dsl/dsl/apps/v1/stateful_set_status.rb +47 -36
  81. data/lib/kube-dsl/dsl/apps/v1/stateful_set_update_strategy.rb +23 -15
  82. data/lib/kube-dsl/dsl/apps.rb +0 -2
  83. data/lib/kube-dsl/dsl/authentication/v1/bound_object_reference.rb +29 -21
  84. data/lib/kube-dsl/dsl/authentication/v1/token_request.rb +28 -20
  85. data/lib/kube-dsl/dsl/authentication/v1/token_request_spec.rb +26 -18
  86. data/lib/kube-dsl/dsl/authentication/v1/token_request_status.rb +23 -15
  87. data/lib/kube-dsl/dsl/authentication/v1/token_review.rb +28 -20
  88. data/lib/kube-dsl/dsl/authentication/v1/token_review_spec.rb +23 -15
  89. data/lib/kube-dsl/dsl/authentication/v1/token_review_status.rb +29 -21
  90. data/lib/kube-dsl/dsl/authentication/v1/user_info.rb +29 -21
  91. data/lib/kube-dsl/dsl/authentication.rb +0 -1
  92. data/lib/kube-dsl/dsl/authorization/v1/local_subject_access_review.rb +28 -20
  93. data/lib/kube-dsl/dsl/authorization/v1/non_resource_attributes.rb +23 -15
  94. data/lib/kube-dsl/dsl/authorization/v1/non_resource_rule.rb +23 -15
  95. data/lib/kube-dsl/dsl/authorization/v1/resource_attributes.rb +38 -30
  96. data/lib/kube-dsl/dsl/authorization/v1/resource_rule.rb +29 -21
  97. data/lib/kube-dsl/dsl/authorization/v1/self_subject_access_review.rb +28 -20
  98. data/lib/kube-dsl/dsl/authorization/v1/self_subject_access_review_spec.rb +23 -15
  99. data/lib/kube-dsl/dsl/authorization/v1/self_subject_rules_review.rb +28 -20
  100. data/lib/kube-dsl/dsl/authorization/v1/self_subject_rules_review_spec.rb +20 -12
  101. data/lib/kube-dsl/dsl/authorization/v1/subject_access_review.rb +28 -20
  102. data/lib/kube-dsl/dsl/authorization/v1/subject_access_review_spec.rb +35 -27
  103. data/lib/kube-dsl/dsl/authorization/v1/subject_access_review_status.rb +29 -21
  104. data/lib/kube-dsl/dsl/authorization/v1/subject_rules_review_status.rb +29 -21
  105. data/lib/kube-dsl/dsl/authorization.rb +0 -1
  106. data/lib/kube-dsl/dsl/autoscaling/v1/cross_version_object_reference.rb +26 -18
  107. data/lib/kube-dsl/dsl/autoscaling/v1/horizontal_pod_autoscaler.rb +28 -20
  108. data/lib/kube-dsl/dsl/autoscaling/v1/horizontal_pod_autoscaler_list.rb +25 -17
  109. data/lib/kube-dsl/dsl/autoscaling/v1/horizontal_pod_autoscaler_spec.rb +29 -21
  110. data/lib/kube-dsl/dsl/autoscaling/v1/horizontal_pod_autoscaler_status.rb +32 -24
  111. data/lib/kube-dsl/dsl/autoscaling/v1/scale.rb +28 -20
  112. data/lib/kube-dsl/dsl/autoscaling/v1/scale_spec.rb +20 -12
  113. data/lib/kube-dsl/dsl/autoscaling/v1/scale_status.rb +23 -15
  114. data/lib/kube-dsl/dsl/autoscaling/v2beta1/container_resource_metric_source.rb +34 -0
  115. data/lib/kube-dsl/dsl/autoscaling/v2beta1/container_resource_metric_status.rb +34 -0
  116. data/lib/kube-dsl/dsl/autoscaling/v2beta1/cross_version_object_reference.rb +26 -18
  117. data/lib/kube-dsl/dsl/autoscaling/v2beta1/external_metric_source.rb +29 -21
  118. data/lib/kube-dsl/dsl/autoscaling/v2beta1/external_metric_status.rb +29 -21
  119. data/lib/kube-dsl/dsl/autoscaling/v2beta1/horizontal_pod_autoscaler.rb +28 -20
  120. data/lib/kube-dsl/dsl/autoscaling/v2beta1/horizontal_pod_autoscaler_condition.rb +32 -24
  121. data/lib/kube-dsl/dsl/autoscaling/v2beta1/horizontal_pod_autoscaler_list.rb +25 -17
  122. data/lib/kube-dsl/dsl/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rb +29 -21
  123. data/lib/kube-dsl/dsl/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rb +35 -27
  124. data/lib/kube-dsl/dsl/autoscaling/v2beta1/metric_spec.rb +35 -24
  125. data/lib/kube-dsl/dsl/autoscaling/v2beta1/metric_status.rb +35 -24
  126. data/lib/kube-dsl/dsl/autoscaling/v2beta1/object_metric_source.rb +32 -24
  127. data/lib/kube-dsl/dsl/autoscaling/v2beta1/object_metric_status.rb +32 -24
  128. data/lib/kube-dsl/dsl/autoscaling/v2beta1/pods_metric_source.rb +26 -18
  129. data/lib/kube-dsl/dsl/autoscaling/v2beta1/pods_metric_status.rb +26 -18
  130. data/lib/kube-dsl/dsl/autoscaling/v2beta1/resource_metric_source.rb +26 -18
  131. data/lib/kube-dsl/dsl/autoscaling/v2beta1/resource_metric_status.rb +26 -18
  132. data/lib/kube-dsl/dsl/autoscaling/v2beta1.rb +2 -0
  133. data/lib/kube-dsl/dsl/autoscaling/v2beta2/container_resource_metric_source.rb +31 -0
  134. data/lib/kube-dsl/dsl/autoscaling/v2beta2/container_resource_metric_status.rb +31 -0
  135. data/lib/kube-dsl/dsl/autoscaling/v2beta2/cross_version_object_reference.rb +26 -18
  136. data/lib/kube-dsl/dsl/autoscaling/v2beta2/external_metric_source.rb +23 -15
  137. data/lib/kube-dsl/dsl/autoscaling/v2beta2/external_metric_status.rb +23 -15
  138. data/lib/kube-dsl/dsl/autoscaling/v2beta2/horizontal_pod_autoscaler.rb +28 -20
  139. data/lib/kube-dsl/dsl/autoscaling/v2beta2/horizontal_pod_autoscaler_behavior.rb +28 -0
  140. data/lib/kube-dsl/dsl/autoscaling/v2beta2/horizontal_pod_autoscaler_condition.rb +32 -24
  141. data/lib/kube-dsl/dsl/autoscaling/v2beta2/horizontal_pod_autoscaler_list.rb +25 -17
  142. data/lib/kube-dsl/dsl/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rb +32 -21
  143. data/lib/kube-dsl/dsl/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rb +35 -27
  144. data/lib/kube-dsl/dsl/autoscaling/v2beta2/hpa_scaling_policy.rb +31 -0
  145. data/lib/kube-dsl/dsl/autoscaling/v2beta2/hpa_scaling_rules.rb +31 -0
  146. data/lib/kube-dsl/dsl/autoscaling/v2beta2/metric_identifier.rb +23 -15
  147. data/lib/kube-dsl/dsl/autoscaling/v2beta2/metric_spec.rb +35 -24
  148. data/lib/kube-dsl/dsl/autoscaling/v2beta2/metric_status.rb +35 -24
  149. data/lib/kube-dsl/dsl/autoscaling/v2beta2/metric_target.rb +29 -21
  150. data/lib/kube-dsl/dsl/autoscaling/v2beta2/metric_value_status.rb +26 -18
  151. data/lib/kube-dsl/dsl/autoscaling/v2beta2/object_metric_source.rb +26 -18
  152. data/lib/kube-dsl/dsl/autoscaling/v2beta2/object_metric_status.rb +26 -18
  153. data/lib/kube-dsl/dsl/autoscaling/v2beta2/pods_metric_source.rb +23 -15
  154. data/lib/kube-dsl/dsl/autoscaling/v2beta2/pods_metric_status.rb +23 -15
  155. data/lib/kube-dsl/dsl/autoscaling/v2beta2/resource_metric_source.rb +23 -15
  156. data/lib/kube-dsl/dsl/autoscaling/v2beta2/resource_metric_status.rb +23 -15
  157. data/lib/kube-dsl/dsl/autoscaling/v2beta2.rb +5 -0
  158. data/lib/kube-dsl/dsl/batch/v1/cron_job.rb +33 -0
  159. data/lib/kube-dsl/dsl/batch/v1/cron_job_list.rb +30 -0
  160. data/lib/kube-dsl/dsl/batch/v1/cron_job_spec.rb +43 -0
  161. data/lib/kube-dsl/dsl/batch/v1/cron_job_status.rb +31 -0
  162. data/lib/kube-dsl/dsl/batch/v1/job.rb +28 -20
  163. data/lib/kube-dsl/dsl/batch/v1/job_condition.rb +35 -27
  164. data/lib/kube-dsl/dsl/batch/v1/job_list.rb +25 -17
  165. data/lib/kube-dsl/dsl/batch/v1/job_spec.rb +47 -33
  166. data/lib/kube-dsl/dsl/batch/v1/job_status.rb +41 -27
  167. data/lib/kube-dsl/dsl/batch/v1/job_template_spec.rb +28 -0
  168. data/lib/kube-dsl/dsl/batch/v1/uncounted_terminated_pods.rb +28 -0
  169. data/lib/kube-dsl/dsl/batch/v1.rb +6 -0
  170. data/lib/kube-dsl/dsl/batch/v1beta1/cron_job.rb +28 -20
  171. data/lib/kube-dsl/dsl/batch/v1beta1/cron_job_list.rb +25 -17
  172. data/lib/kube-dsl/dsl/batch/v1beta1/cron_job_spec.rb +38 -30
  173. data/lib/kube-dsl/dsl/batch/v1beta1/cron_job_status.rb +26 -15
  174. data/lib/kube-dsl/dsl/batch/v1beta1/job_template_spec.rb +23 -15
  175. data/lib/kube-dsl/dsl/batch.rb +0 -1
  176. data/lib/kube-dsl/dsl/certificates/v1/certificate_signing_request.rb +33 -0
  177. data/lib/kube-dsl/dsl/certificates/v1/certificate_signing_request_condition.rb +40 -0
  178. data/lib/kube-dsl/dsl/certificates/v1/certificate_signing_request_list.rb +30 -0
  179. data/lib/kube-dsl/dsl/certificates/v1/certificate_signing_request_spec.rb +46 -0
  180. data/lib/kube-dsl/dsl/certificates/v1/certificate_signing_request_status.rb +28 -0
  181. data/lib/kube-dsl/dsl/certificates/{v1beta1.rb → v1.rb} +6 -6
  182. data/lib/kube-dsl/dsl/certificates.rb +1 -1
  183. data/lib/kube-dsl/dsl/coordination/v1/lease.rb +25 -17
  184. data/lib/kube-dsl/dsl/coordination/v1/lease_list.rb +25 -17
  185. data/lib/kube-dsl/dsl/coordination/v1/lease_spec.rb +32 -24
  186. data/lib/kube-dsl/dsl/coordination.rb +0 -1
  187. data/lib/kube-dsl/dsl/discovery/v1/endpoint.rb +46 -0
  188. data/lib/kube-dsl/dsl/discovery/v1/endpoint_conditions.rb +31 -0
  189. data/lib/kube-dsl/dsl/discovery/v1/endpoint_hints.rb +25 -0
  190. data/lib/kube-dsl/dsl/discovery/v1/endpoint_port.rb +34 -0
  191. data/lib/kube-dsl/dsl/discovery/v1/endpoint_slice.rb +36 -0
  192. data/lib/kube-dsl/dsl/discovery/v1/endpoint_slice_list.rb +30 -0
  193. data/lib/kube-dsl/dsl/discovery/v1/for_zone.rb +25 -0
  194. data/lib/kube-dsl/dsl/discovery/v1.rb +9 -0
  195. data/lib/kube-dsl/dsl/discovery/v1beta1/endpoint.rb +38 -24
  196. data/lib/kube-dsl/dsl/discovery/v1beta1/endpoint_conditions.rb +26 -12
  197. data/lib/kube-dsl/dsl/discovery/v1beta1/endpoint_hints.rb +25 -0
  198. data/lib/kube-dsl/dsl/discovery/v1beta1/endpoint_port.rb +29 -21
  199. data/lib/kube-dsl/dsl/discovery/v1beta1/endpoint_slice.rb +31 -23
  200. data/lib/kube-dsl/dsl/discovery/v1beta1/endpoint_slice_list.rb +25 -17
  201. data/lib/kube-dsl/dsl/discovery/v1beta1/for_zone.rb +25 -0
  202. data/lib/kube-dsl/dsl/discovery/v1beta1.rb +2 -0
  203. data/lib/kube-dsl/dsl/discovery.rb +1 -0
  204. data/lib/kube-dsl/dsl/events/v1/event.rb +69 -0
  205. data/lib/kube-dsl/dsl/events/v1/event_list.rb +30 -0
  206. data/lib/kube-dsl/dsl/events/v1/event_series.rb +28 -0
  207. data/lib/kube-dsl/dsl/events/v1.rb +5 -0
  208. data/lib/kube-dsl/dsl/events/v1beta1/event.rb +64 -56
  209. data/lib/kube-dsl/dsl/events/v1beta1/event_list.rb +25 -17
  210. data/lib/kube-dsl/dsl/events/v1beta1/event_series.rb +23 -18
  211. data/lib/kube-dsl/dsl/events.rb +1 -0
  212. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/flow_distinguisher_method.rb +25 -0
  213. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/flow_schema.rb +33 -0
  214. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/flow_schema_condition.rb +37 -0
  215. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/flow_schema_list.rb +30 -0
  216. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/flow_schema_spec.rb +34 -0
  217. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/flow_schema_status.rb +25 -0
  218. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/group_subject.rb +25 -0
  219. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/limit_response.rb +28 -0
  220. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/limited_priority_level_configuration.rb +28 -0
  221. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/non_resource_policy_rule.rb +28 -0
  222. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/policy_rules_with_subjects.rb +31 -0
  223. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/priority_level_configuration.rb +33 -0
  224. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/priority_level_configuration_condition.rb +37 -0
  225. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/priority_level_configuration_list.rb +30 -0
  226. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/priority_level_configuration_reference.rb +25 -0
  227. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/priority_level_configuration_spec.rb +28 -0
  228. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/priority_level_configuration_status.rb +25 -0
  229. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/queuing_configuration.rb +31 -0
  230. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/resource_policy_rule.rb +37 -0
  231. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/service_account_subject.rb +28 -0
  232. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/subject.rb +34 -0
  233. data/lib/kube-dsl/dsl/flowcontrol/v1beta1/user_subject.rb +25 -0
  234. data/lib/kube-dsl/dsl/flowcontrol/v1beta1.rb +24 -0
  235. data/lib/kube-dsl/dsl/flowcontrol.rb +1 -1
  236. data/lib/kube-dsl/dsl/meta/v1/api_group.rb +31 -23
  237. data/lib/kube-dsl/dsl/meta/v1/api_group_list.rb +22 -14
  238. data/lib/kube-dsl/dsl/meta/v1/api_resource.rb +47 -39
  239. data/lib/kube-dsl/dsl/meta/v1/api_resource_list.rb +25 -17
  240. data/lib/kube-dsl/dsl/meta/v1/api_versions.rb +25 -17
  241. data/lib/kube-dsl/dsl/meta/v1/condition.rb +40 -0
  242. data/lib/kube-dsl/dsl/meta/v1/delete_options.rb +36 -28
  243. data/lib/kube-dsl/dsl/meta/v1/group_version_for_discovery.rb +23 -15
  244. data/lib/kube-dsl/dsl/meta/v1/label_selector.rb +23 -15
  245. data/lib/kube-dsl/dsl/meta/v1/label_selector_requirement.rb +26 -18
  246. data/lib/kube-dsl/dsl/meta/v1/list_meta.rb +29 -21
  247. data/lib/kube-dsl/dsl/meta/v1/managed_fields_entry.rb +38 -27
  248. data/lib/kube-dsl/dsl/meta/v1/object_meta.rb +65 -57
  249. data/lib/kube-dsl/dsl/meta/v1/owner_reference.rb +35 -27
  250. data/lib/kube-dsl/dsl/meta/v1/preconditions.rb +23 -15
  251. data/lib/kube-dsl/dsl/meta/v1/server_address_by_client_cidr.rb +23 -15
  252. data/lib/kube-dsl/dsl/meta/v1/status.rb +37 -29
  253. data/lib/kube-dsl/dsl/meta/v1/status_cause.rb +26 -18
  254. data/lib/kube-dsl/dsl/meta/v1/status_details.rb +35 -27
  255. data/lib/kube-dsl/dsl/meta/v1/watch_event.rb +23 -15
  256. data/lib/kube-dsl/dsl/meta/v1.rb +1 -0
  257. data/lib/kube-dsl/dsl/networking/v1/http_ingress_path.rb +31 -0
  258. data/lib/kube-dsl/dsl/networking/v1/http_ingress_rule_value.rb +25 -0
  259. data/lib/kube-dsl/dsl/networking/v1/ingress.rb +33 -0
  260. data/lib/kube-dsl/dsl/networking/v1/ingress_backend.rb +28 -0
  261. data/lib/kube-dsl/dsl/networking/v1/ingress_class.rb +30 -0
  262. data/lib/kube-dsl/dsl/networking/v1/ingress_class_list.rb +30 -0
  263. data/lib/kube-dsl/dsl/networking/v1/ingress_class_parameters_reference.rb +37 -0
  264. data/lib/kube-dsl/dsl/networking/v1/ingress_class_spec.rb +28 -0
  265. data/lib/kube-dsl/dsl/networking/v1/ingress_list.rb +30 -0
  266. data/lib/kube-dsl/dsl/networking/v1/ingress_rule.rb +28 -0
  267. data/lib/kube-dsl/dsl/networking/v1/ingress_service_backend.rb +28 -0
  268. data/lib/kube-dsl/dsl/networking/v1/ingress_spec.rb +34 -0
  269. data/lib/kube-dsl/dsl/networking/v1/ingress_status.rb +25 -0
  270. data/lib/kube-dsl/dsl/networking/v1/ingress_tls.rb +28 -0
  271. data/lib/kube-dsl/dsl/networking/v1/ip_block.rb +23 -15
  272. data/lib/kube-dsl/dsl/networking/v1/network_policy.rb +25 -17
  273. data/lib/kube-dsl/dsl/networking/v1/network_policy_egress_rule.rb +23 -15
  274. data/lib/kube-dsl/dsl/networking/v1/network_policy_ingress_rule.rb +23 -15
  275. data/lib/kube-dsl/dsl/networking/v1/network_policy_list.rb +25 -17
  276. data/lib/kube-dsl/dsl/networking/v1/network_policy_peer.rb +26 -18
  277. data/lib/kube-dsl/dsl/networking/v1/network_policy_port.rb +26 -15
  278. data/lib/kube-dsl/dsl/networking/v1/network_policy_spec.rb +29 -21
  279. data/lib/kube-dsl/dsl/networking/v1/service_backend_port.rb +28 -0
  280. data/lib/kube-dsl/dsl/networking/v1.rb +15 -0
  281. data/lib/kube-dsl/dsl/networking.rb +0 -1
  282. data/lib/kube-dsl/dsl/node/v1/overhead.rb +33 -0
  283. data/lib/kube-dsl/dsl/node/v1/runtime_class.rb +33 -0
  284. data/lib/kube-dsl/dsl/node/v1/runtime_class_list.rb +33 -0
  285. data/lib/kube-dsl/dsl/node/v1/scheduling.rb +33 -0
  286. data/lib/kube-dsl/dsl/node/v1.rb +6 -0
  287. data/lib/kube-dsl/dsl/node/v1alpha1/overhead.rb +20 -12
  288. data/lib/kube-dsl/dsl/node/v1alpha1/runtime_class.rb +25 -17
  289. data/lib/kube-dsl/dsl/node/v1alpha1/runtime_class_list.rb +25 -17
  290. data/lib/kube-dsl/dsl/node/v1alpha1/runtime_class_spec.rb +26 -18
  291. data/lib/kube-dsl/dsl/node/v1alpha1/scheduling.rb +23 -15
  292. data/lib/kube-dsl/dsl/node/v1beta1/overhead.rb +20 -12
  293. data/lib/kube-dsl/dsl/node/v1beta1/runtime_class.rb +31 -23
  294. data/lib/kube-dsl/dsl/node/v1beta1/runtime_class_list.rb +25 -17
  295. data/lib/kube-dsl/dsl/node/v1beta1/scheduling.rb +23 -15
  296. data/lib/kube-dsl/dsl/node.rb +1 -0
  297. data/lib/kube-dsl/dsl/pkg/version/info.rb +44 -36
  298. data/lib/kube-dsl/dsl/policy/v1/eviction.rb +30 -0
  299. data/lib/kube-dsl/dsl/policy/v1/pod_disruption_budget.rb +33 -0
  300. data/lib/kube-dsl/dsl/policy/v1/pod_disruption_budget_list.rb +30 -0
  301. data/lib/kube-dsl/dsl/policy/v1/pod_disruption_budget_spec.rb +31 -0
  302. data/lib/kube-dsl/dsl/policy/v1/pod_disruption_budget_status.rb +43 -0
  303. data/lib/kube-dsl/dsl/policy/v1.rb +7 -0
  304. data/lib/kube-dsl/dsl/policy/v1beta1/allowed_csi_driver.rb +20 -12
  305. data/lib/kube-dsl/dsl/policy/v1beta1/allowed_flex_volume.rb +20 -12
  306. data/lib/kube-dsl/dsl/policy/v1beta1/allowed_host_path.rb +23 -15
  307. data/lib/kube-dsl/dsl/policy/v1beta1/fs_group_strategy_options.rb +23 -15
  308. data/lib/kube-dsl/dsl/policy/v1beta1/host_port_range.rb +23 -15
  309. data/lib/kube-dsl/dsl/policy/v1beta1/id_range.rb +23 -15
  310. data/lib/kube-dsl/dsl/policy/v1beta1/pod_disruption_budget.rb +28 -20
  311. data/lib/kube-dsl/dsl/policy/v1beta1/pod_disruption_budget_list.rb +25 -17
  312. data/lib/kube-dsl/dsl/policy/v1beta1/pod_disruption_budget_spec.rb +26 -18
  313. data/lib/kube-dsl/dsl/policy/v1beta1/pod_disruption_budget_status.rb +38 -27
  314. data/lib/kube-dsl/dsl/policy/v1beta1/pod_security_policy.rb +25 -17
  315. data/lib/kube-dsl/dsl/policy/v1beta1/pod_security_policy_list.rb +25 -17
  316. data/lib/kube-dsl/dsl/policy/v1beta1/pod_security_policy_spec.rb +89 -81
  317. data/lib/kube-dsl/dsl/policy/v1beta1/run_as_group_strategy_options.rb +23 -15
  318. data/lib/kube-dsl/dsl/policy/v1beta1/run_as_user_strategy_options.rb +23 -15
  319. data/lib/kube-dsl/dsl/policy/v1beta1/runtime_class_strategy_options.rb +23 -15
  320. data/lib/kube-dsl/dsl/policy/v1beta1/se_linux_strategy_options.rb +23 -15
  321. data/lib/kube-dsl/dsl/policy/v1beta1/supplemental_groups_strategy_options.rb +23 -15
  322. data/lib/kube-dsl/dsl/policy/v1beta1.rb +0 -1
  323. data/lib/kube-dsl/dsl/policy.rb +1 -0
  324. data/lib/kube-dsl/dsl/rbac/v1/aggregation_rule.rb +20 -12
  325. data/lib/kube-dsl/dsl/rbac/v1/cluster_role.rb +28 -20
  326. data/lib/kube-dsl/dsl/rbac/v1/cluster_role_binding.rb +28 -20
  327. data/lib/kube-dsl/dsl/rbac/v1/cluster_role_binding_list.rb +25 -17
  328. data/lib/kube-dsl/dsl/rbac/v1/cluster_role_list.rb +25 -17
  329. data/lib/kube-dsl/dsl/rbac/v1/policy_rule.rb +32 -24
  330. data/lib/kube-dsl/dsl/rbac/v1/role.rb +25 -17
  331. data/lib/kube-dsl/dsl/rbac/v1/role_binding.rb +28 -20
  332. data/lib/kube-dsl/dsl/rbac/v1/role_binding_list.rb +25 -17
  333. data/lib/kube-dsl/dsl/rbac/v1/role_list.rb +25 -17
  334. data/lib/kube-dsl/dsl/rbac/v1/role_ref.rb +26 -18
  335. data/lib/kube-dsl/dsl/rbac/v1/subject.rb +29 -21
  336. data/lib/kube-dsl/dsl/rbac/v1alpha1/aggregation_rule.rb +20 -12
  337. data/lib/kube-dsl/dsl/rbac/v1alpha1/cluster_role.rb +28 -20
  338. data/lib/kube-dsl/dsl/rbac/v1alpha1/cluster_role_binding.rb +28 -20
  339. data/lib/kube-dsl/dsl/rbac/v1alpha1/cluster_role_binding_list.rb +25 -17
  340. data/lib/kube-dsl/dsl/rbac/v1alpha1/cluster_role_list.rb +25 -17
  341. data/lib/kube-dsl/dsl/rbac/v1alpha1/policy_rule.rb +32 -24
  342. data/lib/kube-dsl/dsl/rbac/v1alpha1/role.rb +25 -17
  343. data/lib/kube-dsl/dsl/rbac/v1alpha1/role_binding.rb +28 -20
  344. data/lib/kube-dsl/dsl/rbac/v1alpha1/role_binding_list.rb +25 -17
  345. data/lib/kube-dsl/dsl/rbac/v1alpha1/role_list.rb +25 -17
  346. data/lib/kube-dsl/dsl/rbac/v1alpha1/role_ref.rb +26 -18
  347. data/lib/kube-dsl/dsl/rbac/v1alpha1/subject.rb +29 -21
  348. data/lib/kube-dsl/dsl/rbac.rb +0 -1
  349. data/lib/kube-dsl/dsl/scheduling/v1/priority_class.rb +34 -26
  350. data/lib/kube-dsl/dsl/scheduling/v1/priority_class_list.rb +25 -17
  351. data/lib/kube-dsl/dsl/scheduling/v1alpha1/priority_class.rb +34 -26
  352. data/lib/kube-dsl/dsl/scheduling/v1alpha1/priority_class_list.rb +25 -17
  353. data/lib/kube-dsl/dsl/scheduling.rb +0 -1
  354. data/lib/kube-dsl/dsl/storage/v1/csi_driver.rb +30 -0
  355. data/lib/kube-dsl/dsl/storage/v1/csi_driver_list.rb +30 -0
  356. data/lib/kube-dsl/dsl/storage/v1/csi_driver_spec.rb +43 -0
  357. data/lib/kube-dsl/dsl/storage/v1/csi_node.rb +25 -17
  358. data/lib/kube-dsl/dsl/storage/v1/csi_node_driver.rb +29 -21
  359. data/lib/kube-dsl/dsl/storage/v1/csi_node_list.rb +25 -17
  360. data/lib/kube-dsl/dsl/storage/v1/csi_node_spec.rb +20 -12
  361. data/lib/kube-dsl/dsl/storage/v1/storage_class.rb +43 -35
  362. data/lib/kube-dsl/dsl/storage/v1/storage_class_list.rb +25 -17
  363. data/lib/kube-dsl/dsl/storage/v1/token_request.rb +28 -0
  364. data/lib/kube-dsl/dsl/storage/v1/volume_attachment.rb +28 -20
  365. data/lib/kube-dsl/dsl/storage/v1/volume_attachment_list.rb +25 -17
  366. data/lib/kube-dsl/dsl/storage/v1/volume_attachment_source.rb +23 -15
  367. data/lib/kube-dsl/dsl/storage/v1/volume_attachment_spec.rb +26 -18
  368. data/lib/kube-dsl/dsl/storage/v1/volume_attachment_status.rb +29 -21
  369. data/lib/kube-dsl/dsl/storage/v1/volume_error.rb +23 -15
  370. data/lib/kube-dsl/dsl/storage/v1/volume_node_resources.rb +20 -12
  371. data/lib/kube-dsl/dsl/storage/v1.rb +4 -0
  372. data/lib/kube-dsl/dsl/storage/v1alpha1/csi_storage_capacity.rb +39 -0
  373. data/lib/kube-dsl/dsl/storage/v1alpha1/csi_storage_capacity_list.rb +30 -0
  374. data/lib/kube-dsl/dsl/storage/v1alpha1/volume_attachment.rb +28 -20
  375. data/lib/kube-dsl/dsl/storage/v1alpha1/volume_attachment_list.rb +25 -17
  376. data/lib/kube-dsl/dsl/storage/v1alpha1/volume_attachment_source.rb +23 -15
  377. data/lib/kube-dsl/dsl/storage/v1alpha1/volume_attachment_spec.rb +26 -18
  378. data/lib/kube-dsl/dsl/storage/v1alpha1/volume_attachment_status.rb +29 -21
  379. data/lib/kube-dsl/dsl/storage/v1alpha1/volume_error.rb +23 -15
  380. data/lib/kube-dsl/dsl/storage/v1alpha1.rb +2 -0
  381. data/lib/kube-dsl/dsl/storage/v1beta1/csi_storage_capacity.rb +39 -0
  382. data/lib/kube-dsl/dsl/storage/v1beta1/csi_storage_capacity_list.rb +30 -0
  383. data/lib/kube-dsl/dsl/storage/v1beta1.rb +2 -16
  384. data/lib/kube-dsl/dsl/v1/affinity.rb +24 -18
  385. data/lib/kube-dsl/dsl/v1/attached_volume.rb +21 -15
  386. data/lib/kube-dsl/dsl/v1/aws_elastic_block_store_volume_source.rb +27 -21
  387. data/lib/kube-dsl/dsl/v1/azure_disk_volume_source.rb +33 -27
  388. data/lib/kube-dsl/dsl/v1/azure_file_persistent_volume_source.rb +27 -21
  389. data/lib/kube-dsl/dsl/v1/azure_file_volume_source.rb +24 -18
  390. data/lib/kube-dsl/dsl/v1/binding.rb +23 -17
  391. data/lib/kube-dsl/dsl/v1/capabilities.rb +21 -15
  392. data/lib/kube-dsl/dsl/v1/ceph_fs_persistent_volume_source.rb +33 -27
  393. data/lib/kube-dsl/dsl/v1/ceph_fs_volume_source.rb +33 -27
  394. data/lib/kube-dsl/dsl/v1/cinder_persistent_volume_source.rb +27 -21
  395. data/lib/kube-dsl/dsl/v1/cinder_volume_source.rb +27 -21
  396. data/lib/kube-dsl/dsl/v1/client_ip_config.rb +18 -12
  397. data/lib/kube-dsl/dsl/v1/component_condition.rb +27 -21
  398. data/lib/kube-dsl/dsl/v1/component_status.rb +23 -17
  399. data/lib/kube-dsl/dsl/v1/component_status_list.rb +23 -17
  400. data/lib/kube-dsl/dsl/v1/config_map.rb +29 -20
  401. data/lib/kube-dsl/dsl/v1/config_map_env_source.rb +21 -15
  402. data/lib/kube-dsl/dsl/v1/config_map_key_selector.rb +24 -18
  403. data/lib/kube-dsl/dsl/v1/config_map_list.rb +23 -17
  404. data/lib/kube-dsl/dsl/v1/config_map_node_config_source.rb +30 -24
  405. data/lib/kube-dsl/dsl/v1/config_map_projection.rb +24 -18
  406. data/lib/kube-dsl/dsl/v1/config_map_volume_source.rb +27 -21
  407. data/lib/kube-dsl/dsl/v1/container.rb +81 -75
  408. data/lib/kube-dsl/dsl/v1/container_image.rb +21 -15
  409. data/lib/kube-dsl/dsl/v1/container_port.rb +30 -24
  410. data/lib/kube-dsl/dsl/v1/container_state.rb +24 -18
  411. data/lib/kube-dsl/dsl/v1/container_state_running.rb +18 -12
  412. data/lib/kube-dsl/dsl/v1/container_state_terminated.rb +36 -30
  413. data/lib/kube-dsl/dsl/v1/container_state_waiting.rb +21 -15
  414. data/lib/kube-dsl/dsl/v1/container_status.rb +42 -36
  415. data/lib/kube-dsl/dsl/v1/csi_persistent_volume_source.rb +42 -36
  416. data/lib/kube-dsl/dsl/v1/csi_volume_source.rb +30 -24
  417. data/lib/kube-dsl/dsl/v1/daemon_endpoint.rb +18 -12
  418. data/lib/kube-dsl/dsl/v1/downward_api_projection.rb +18 -12
  419. data/lib/kube-dsl/dsl/v1/downward_api_volume_file.rb +27 -21
  420. data/lib/kube-dsl/dsl/v1/downward_api_volume_source.rb +21 -15
  421. data/lib/kube-dsl/dsl/v1/empty_dir_volume_source.rb +21 -15
  422. data/lib/kube-dsl/dsl/v1/endpoint_address.rb +27 -21
  423. data/lib/kube-dsl/dsl/v1/endpoint_port.rb +27 -18
  424. data/lib/kube-dsl/dsl/v1/endpoint_subset.rb +24 -18
  425. data/lib/kube-dsl/dsl/v1/endpoints.rb +23 -17
  426. data/lib/kube-dsl/dsl/v1/endpoints_list.rb +23 -17
  427. data/lib/kube-dsl/dsl/v1/env_from_source.rb +24 -18
  428. data/lib/kube-dsl/dsl/v1/env_var.rb +24 -18
  429. data/lib/kube-dsl/dsl/v1/env_var_source.rb +27 -21
  430. data/lib/kube-dsl/dsl/v1/ephemeral_container.rb +84 -78
  431. data/lib/kube-dsl/dsl/v1/ephemeral_volume_source.rb +23 -0
  432. data/lib/kube-dsl/dsl/v1/event.rb +62 -56
  433. data/lib/kube-dsl/dsl/v1/event_list.rb +23 -17
  434. data/lib/kube-dsl/dsl/v1/event_series.rb +21 -18
  435. data/lib/kube-dsl/dsl/v1/event_source.rb +21 -15
  436. data/lib/kube-dsl/dsl/v1/exec_action.rb +18 -12
  437. data/lib/kube-dsl/dsl/v1/fc_volume_source.rb +30 -24
  438. data/lib/kube-dsl/dsl/v1/flex_persistent_volume_source.rb +30 -24
  439. data/lib/kube-dsl/dsl/v1/flex_volume_source.rb +30 -24
  440. data/lib/kube-dsl/dsl/v1/flocker_volume_source.rb +21 -15
  441. data/lib/kube-dsl/dsl/v1/gce_persistent_disk_volume_source.rb +27 -21
  442. data/lib/kube-dsl/dsl/v1/git_repo_volume_source.rb +24 -18
  443. data/lib/kube-dsl/dsl/v1/glusterfs_persistent_volume_source.rb +27 -21
  444. data/lib/kube-dsl/dsl/v1/glusterfs_volume_source.rb +24 -18
  445. data/lib/kube-dsl/dsl/v1/handler.rb +24 -18
  446. data/lib/kube-dsl/dsl/v1/host_alias.rb +21 -15
  447. data/lib/kube-dsl/dsl/v1/host_path_volume_source.rb +21 -15
  448. data/lib/kube-dsl/dsl/v1/http_get_action.rb +30 -24
  449. data/lib/kube-dsl/dsl/v1/http_header.rb +21 -15
  450. data/lib/kube-dsl/dsl/v1/iscsi_persistent_volume_source.rb +48 -42
  451. data/lib/kube-dsl/dsl/v1/iscsi_volume_source.rb +48 -42
  452. data/lib/kube-dsl/dsl/v1/key_to_path.rb +24 -18
  453. data/lib/kube-dsl/dsl/v1/lifecycle.rb +21 -15
  454. data/lib/kube-dsl/dsl/v1/limit_range.rb +23 -17
  455. data/lib/kube-dsl/dsl/v1/limit_range_item.rb +33 -27
  456. data/lib/kube-dsl/dsl/v1/limit_range_list.rb +23 -17
  457. data/lib/kube-dsl/dsl/v1/limit_range_spec.rb +18 -12
  458. data/lib/kube-dsl/dsl/v1/load_balancer_ingress.rb +24 -15
  459. data/lib/kube-dsl/dsl/v1/load_balancer_status.rb +18 -12
  460. data/lib/kube-dsl/dsl/v1/local_object_reference.rb +18 -12
  461. data/lib/kube-dsl/dsl/v1/local_volume_source.rb +21 -15
  462. data/lib/kube-dsl/dsl/v1/namespace.rb +26 -20
  463. data/lib/kube-dsl/dsl/v1/namespace_condition.rb +30 -24
  464. data/lib/kube-dsl/dsl/v1/namespace_list.rb +23 -17
  465. data/lib/kube-dsl/dsl/v1/namespace_spec.rb +18 -12
  466. data/lib/kube-dsl/dsl/v1/namespace_status.rb +21 -15
  467. data/lib/kube-dsl/dsl/v1/nfs_volume_source.rb +24 -18
  468. data/lib/kube-dsl/dsl/v1/node.rb +26 -20
  469. data/lib/kube-dsl/dsl/v1/node_address.rb +21 -15
  470. data/lib/kube-dsl/dsl/v1/node_affinity.rb +21 -15
  471. data/lib/kube-dsl/dsl/v1/node_condition.rb +33 -27
  472. data/lib/kube-dsl/dsl/v1/node_config_source.rb +18 -12
  473. data/lib/kube-dsl/dsl/v1/node_config_status.rb +27 -21
  474. data/lib/kube-dsl/dsl/v1/node_daemon_endpoints.rb +18 -12
  475. data/lib/kube-dsl/dsl/v1/node_list.rb +23 -17
  476. data/lib/kube-dsl/dsl/v1/node_selector.rb +18 -12
  477. data/lib/kube-dsl/dsl/v1/node_selector_requirement.rb +24 -18
  478. data/lib/kube-dsl/dsl/v1/node_selector_term.rb +21 -15
  479. data/lib/kube-dsl/dsl/v1/node_spec.rb +36 -30
  480. data/lib/kube-dsl/dsl/v1/node_status.rb +48 -42
  481. data/lib/kube-dsl/dsl/v1/node_system_info.rb +45 -39
  482. data/lib/kube-dsl/dsl/v1/object_field_selector.rb +21 -15
  483. data/lib/kube-dsl/dsl/v1/object_reference.rb +36 -30
  484. data/lib/kube-dsl/dsl/v1/persistent_volume.rb +26 -20
  485. data/lib/kube-dsl/dsl/v1/persistent_volume_claim.rb +26 -20
  486. data/lib/kube-dsl/dsl/v1/persistent_volume_claim_condition.rb +33 -27
  487. data/lib/kube-dsl/dsl/v1/persistent_volume_claim_list.rb +23 -17
  488. data/lib/kube-dsl/dsl/v1/persistent_volume_claim_spec.rb +39 -30
  489. data/lib/kube-dsl/dsl/v1/persistent_volume_claim_status.rb +27 -21
  490. data/lib/kube-dsl/dsl/v1/persistent_volume_claim_template.rb +26 -0
  491. data/lib/kube-dsl/dsl/v1/persistent_volume_claim_volume_source.rb +21 -15
  492. data/lib/kube-dsl/dsl/v1/persistent_volume_list.rb +23 -17
  493. data/lib/kube-dsl/dsl/v1/persistent_volume_spec.rb +105 -99
  494. data/lib/kube-dsl/dsl/v1/persistent_volume_status.rb +24 -18
  495. data/lib/kube-dsl/dsl/v1/photon_persistent_disk_volume_source.rb +21 -15
  496. data/lib/kube-dsl/dsl/v1/pod.rb +26 -20
  497. data/lib/kube-dsl/dsl/v1/pod_affinity.rb +21 -15
  498. data/lib/kube-dsl/dsl/v1/pod_affinity_term.rb +27 -18
  499. data/lib/kube-dsl/dsl/v1/pod_anti_affinity.rb +21 -15
  500. data/lib/kube-dsl/dsl/v1/pod_condition.rb +33 -27
  501. data/lib/kube-dsl/dsl/v1/pod_dns_config.rb +24 -18
  502. data/lib/kube-dsl/dsl/v1/pod_dns_config_option.rb +21 -15
  503. data/lib/kube-dsl/dsl/v1/pod_ip.rb +18 -12
  504. data/lib/kube-dsl/dsl/v1/pod_list.rb +23 -17
  505. data/lib/kube-dsl/dsl/v1/pod_readiness_gate.rb +18 -12
  506. data/lib/kube-dsl/dsl/v1/pod_security_context.rb +45 -33
  507. data/lib/kube-dsl/dsl/v1/pod_spec.rb +120 -111
  508. data/lib/kube-dsl/dsl/v1/pod_status.rb +54 -48
  509. data/lib/kube-dsl/dsl/v1/pod_template.rb +23 -17
  510. data/lib/kube-dsl/dsl/v1/pod_template_list.rb +23 -17
  511. data/lib/kube-dsl/dsl/v1/pod_template_spec.rb +21 -15
  512. data/lib/kube-dsl/dsl/v1/port_status.rb +29 -0
  513. data/lib/kube-dsl/dsl/v1/portworx_volume_source.rb +24 -18
  514. data/lib/kube-dsl/dsl/v1/preferred_scheduling_term.rb +21 -15
  515. data/lib/kube-dsl/dsl/v1/probe.rb +42 -33
  516. data/lib/kube-dsl/dsl/v1/projected_volume_source.rb +21 -15
  517. data/lib/kube-dsl/dsl/v1/quobyte_volume_source.rb +33 -27
  518. data/lib/kube-dsl/dsl/v1/rbd_persistent_volume_source.rb +39 -33
  519. data/lib/kube-dsl/dsl/v1/rbd_volume_source.rb +39 -33
  520. data/lib/kube-dsl/dsl/v1/replication_controller.rb +26 -20
  521. data/lib/kube-dsl/dsl/v1/replication_controller_condition.rb +30 -24
  522. data/lib/kube-dsl/dsl/v1/replication_controller_list.rb +23 -17
  523. data/lib/kube-dsl/dsl/v1/replication_controller_spec.rb +27 -21
  524. data/lib/kube-dsl/dsl/v1/replication_controller_status.rb +33 -27
  525. data/lib/kube-dsl/dsl/v1/resource_field_selector.rb +24 -18
  526. data/lib/kube-dsl/dsl/v1/resource_quota.rb +26 -20
  527. data/lib/kube-dsl/dsl/v1/resource_quota_list.rb +23 -17
  528. data/lib/kube-dsl/dsl/v1/resource_quota_spec.rb +24 -18
  529. data/lib/kube-dsl/dsl/v1/resource_quota_status.rb +21 -15
  530. data/lib/kube-dsl/dsl/v1/resource_requirements.rb +21 -15
  531. data/lib/kube-dsl/dsl/v1/scale_io_persistent_volume_source.rb +45 -39
  532. data/lib/kube-dsl/dsl/v1/scale_io_volume_source.rb +45 -39
  533. data/lib/kube-dsl/dsl/v1/scope_selector.rb +18 -12
  534. data/lib/kube-dsl/dsl/v1/scoped_resource_selector_requirement.rb +24 -18
  535. data/lib/kube-dsl/dsl/v1/se_linux_options.rb +27 -21
  536. data/lib/kube-dsl/dsl/v1/seccomp_profile.rb +26 -0
  537. data/lib/kube-dsl/dsl/v1/secret.rb +32 -23
  538. data/lib/kube-dsl/dsl/v1/secret_env_source.rb +21 -15
  539. data/lib/kube-dsl/dsl/v1/secret_key_selector.rb +24 -18
  540. data/lib/kube-dsl/dsl/v1/secret_list.rb +23 -17
  541. data/lib/kube-dsl/dsl/v1/secret_projection.rb +24 -18
  542. data/lib/kube-dsl/dsl/v1/secret_reference.rb +21 -15
  543. data/lib/kube-dsl/dsl/v1/secret_volume_source.rb +27 -21
  544. data/lib/kube-dsl/dsl/v1/security_context.rb +48 -39
  545. data/lib/kube-dsl/dsl/v1/service.rb +26 -20
  546. data/lib/kube-dsl/dsl/v1/service_account.rb +29 -23
  547. data/lib/kube-dsl/dsl/v1/service_account_list.rb +23 -17
  548. data/lib/kube-dsl/dsl/v1/service_account_token_projection.rb +24 -18
  549. data/lib/kube-dsl/dsl/v1/service_list.rb +23 -17
  550. data/lib/kube-dsl/dsl/v1/service_port.rb +33 -24
  551. data/lib/kube-dsl/dsl/v1/service_spec.rb +72 -54
  552. data/lib/kube-dsl/dsl/v1/service_status.rb +21 -12
  553. data/lib/kube-dsl/dsl/v1/session_affinity_config.rb +18 -12
  554. data/lib/kube-dsl/dsl/v1/storage_os_persistent_volume_source.rb +30 -24
  555. data/lib/kube-dsl/dsl/v1/storage_os_volume_source.rb +30 -24
  556. data/lib/kube-dsl/dsl/v1/sysctl.rb +21 -15
  557. data/lib/kube-dsl/dsl/v1/taint.rb +27 -21
  558. data/lib/kube-dsl/dsl/v1/tcp_socket_action.rb +21 -15
  559. data/lib/kube-dsl/dsl/v1/toleration.rb +30 -24
  560. data/lib/kube-dsl/dsl/v1/topology_selector_label_requirement.rb +21 -15
  561. data/lib/kube-dsl/dsl/v1/topology_selector_term.rb +18 -12
  562. data/lib/kube-dsl/dsl/v1/topology_spread_constraint.rb +27 -21
  563. data/lib/kube-dsl/dsl/v1/typed_local_object_reference.rb +24 -18
  564. data/lib/kube-dsl/dsl/v1/volume.rb +105 -96
  565. data/lib/kube-dsl/dsl/v1/volume_device.rb +21 -15
  566. data/lib/kube-dsl/dsl/v1/volume_mount.rb +33 -27
  567. data/lib/kube-dsl/dsl/v1/volume_node_affinity.rb +18 -12
  568. data/lib/kube-dsl/dsl/v1/volume_projection.rb +27 -21
  569. data/lib/kube-dsl/dsl/v1/vsphere_virtual_disk_volume_source.rb +27 -21
  570. data/lib/kube-dsl/dsl/v1/weighted_pod_affinity_term.rb +21 -15
  571. data/lib/kube-dsl/dsl/v1/windows_security_context_options.rb +27 -18
  572. data/lib/kube-dsl/dsl/v1.rb +4 -0
  573. data/lib/kube-dsl/dsl.rb +1 -3
  574. data/lib/kube-dsl/dsl_object.rb +11 -0
  575. data/lib/kube-dsl/entrypoint.rb +1228 -1008
  576. data/lib/kube-dsl/entrypoint_builder.rb +109 -0
  577. data/lib/kube-dsl/external_ref.rb +1 -0
  578. data/lib/kube-dsl/external_resource_meta.rb +1 -0
  579. data/lib/kube-dsl/field_res.rb +9 -0
  580. data/lib/kube-dsl/generator.rb +35 -9
  581. data/lib/kube-dsl/inflector.rb +1 -0
  582. data/lib/kube-dsl/inline_ref.rb +57 -0
  583. data/lib/kube-dsl/key_value_field_res.rb +8 -0
  584. data/lib/kube-dsl/key_value_fields.rb +18 -2
  585. data/lib/kube-dsl/object_field_res.rb +13 -1
  586. data/lib/kube-dsl/rbi_helpers.rb +17 -0
  587. data/lib/kube-dsl/ref.rb +9 -3
  588. data/lib/kube-dsl/resource.rb +25 -0
  589. data/lib/kube-dsl/resource_meta.rb +102 -37
  590. data/lib/kube-dsl/serialize_handler.rb +26 -0
  591. data/lib/kube-dsl/string_helpers.rb +1 -0
  592. data/lib/kube-dsl/validations.rb +2 -0
  593. data/lib/kube-dsl/value_fields.rb +9 -3
  594. data/lib/kube-dsl/version.rb +2 -1
  595. data/lib/kube-dsl.rb +7 -1
  596. data/rbi/kube-dsl.rbi +11791 -0
  597. metadata +125 -263
  598. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/mutating_webhook.rb +0 -47
  599. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/mutating_webhook_configuration.rb +0 -22
  600. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/mutating_webhook_configuration_list.rb +0 -22
  601. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/rule_with_operations.rb +0 -29
  602. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/service_reference.rb +0 -26
  603. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/validating_webhook.rb +0 -44
  604. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/validating_webhook_configuration.rb +0 -22
  605. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/validating_webhook_configuration_list.rb +0 -22
  606. data/lib/kube-dsl/dsl/admissionregistration/v1beta1/webhook_client_config.rb +0 -23
  607. data/lib/kube-dsl/dsl/admissionregistration/v1beta1.rb +0 -11
  608. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_column_definition.rb +0 -32
  609. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_conversion.rb +0 -23
  610. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition.rb +0 -25
  611. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition_condition.rb +0 -29
  612. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition_list.rb +0 -22
  613. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition_names.rb +0 -32
  614. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition_spec.rb +0 -44
  615. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition_status.rb +0 -23
  616. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_definition_version.rb +0 -32
  617. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_subresource_scale.rb +0 -23
  618. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_subresources.rb +0 -20
  619. data/lib/kube-dsl/dsl/apiextensions/v1beta1/custom_resource_validation.rb +0 -17
  620. data/lib/kube-dsl/dsl/apiextensions/v1beta1/external_documentation.rb +0 -20
  621. data/lib/kube-dsl/dsl/apiextensions/v1beta1/json_schema_props.rb +0 -137
  622. data/lib/kube-dsl/dsl/apiextensions/v1beta1/service_reference.rb +0 -26
  623. data/lib/kube-dsl/dsl/apiextensions/v1beta1/webhook_client_config.rb +0 -23
  624. data/lib/kube-dsl/dsl/apiextensions/v1beta1.rb +0 -18
  625. data/lib/kube-dsl/dsl/apiregistration/v1beta1/api_service.rb +0 -25
  626. data/lib/kube-dsl/dsl/apiregistration/v1beta1/api_service_condition.rb +0 -29
  627. data/lib/kube-dsl/dsl/apiregistration/v1beta1/api_service_list.rb +0 -22
  628. data/lib/kube-dsl/dsl/apiregistration/v1beta1/api_service_spec.rb +0 -35
  629. data/lib/kube-dsl/dsl/apiregistration/v1beta1/api_service_status.rb +0 -17
  630. data/lib/kube-dsl/dsl/apiregistration/v1beta1/service_reference.rb +0 -23
  631. data/lib/kube-dsl/dsl/apiregistration/v1beta1.rb +0 -8
  632. data/lib/kube-dsl/dsl/apps/v1beta1/controller_revision.rb +0 -25
  633. data/lib/kube-dsl/dsl/apps/v1beta1/controller_revision_list.rb +0 -22
  634. data/lib/kube-dsl/dsl/apps/v1beta1/deployment.rb +0 -25
  635. data/lib/kube-dsl/dsl/apps/v1beta1/deployment_condition.rb +0 -32
  636. data/lib/kube-dsl/dsl/apps/v1beta1/deployment_list.rb +0 -22
  637. data/lib/kube-dsl/dsl/apps/v1beta1/deployment_rollback.rb +0 -25
  638. data/lib/kube-dsl/dsl/apps/v1beta1/deployment_spec.rb +0 -41
  639. data/lib/kube-dsl/dsl/apps/v1beta1/deployment_status.rb +0 -38
  640. data/lib/kube-dsl/dsl/apps/v1beta1/deployment_strategy.rb +0 -20
  641. data/lib/kube-dsl/dsl/apps/v1beta1/rollback_config.rb +0 -17
  642. data/lib/kube-dsl/dsl/apps/v1beta1/rolling_update_deployment.rb +0 -20
  643. data/lib/kube-dsl/dsl/apps/v1beta1/rolling_update_stateful_set_strategy.rb +0 -17
  644. data/lib/kube-dsl/dsl/apps/v1beta1/scale.rb +0 -25
  645. data/lib/kube-dsl/dsl/apps/v1beta1/scale_spec.rb +0 -17
  646. data/lib/kube-dsl/dsl/apps/v1beta1/scale_status.rb +0 -23
  647. data/lib/kube-dsl/dsl/apps/v1beta1/stateful_set.rb +0 -25
  648. data/lib/kube-dsl/dsl/apps/v1beta1/stateful_set_condition.rb +0 -29
  649. data/lib/kube-dsl/dsl/apps/v1beta1/stateful_set_list.rb +0 -22
  650. data/lib/kube-dsl/dsl/apps/v1beta1/stateful_set_spec.rb +0 -38
  651. data/lib/kube-dsl/dsl/apps/v1beta1/stateful_set_status.rb +0 -41
  652. data/lib/kube-dsl/dsl/apps/v1beta1/stateful_set_update_strategy.rb +0 -20
  653. data/lib/kube-dsl/dsl/apps/v1beta1.rb +0 -23
  654. data/lib/kube-dsl/dsl/apps/v1beta2/controller_revision.rb +0 -25
  655. data/lib/kube-dsl/dsl/apps/v1beta2/controller_revision_list.rb +0 -22
  656. data/lib/kube-dsl/dsl/apps/v1beta2/daemon_set.rb +0 -25
  657. data/lib/kube-dsl/dsl/apps/v1beta2/daemon_set_condition.rb +0 -29
  658. data/lib/kube-dsl/dsl/apps/v1beta2/daemon_set_list.rb +0 -22
  659. data/lib/kube-dsl/dsl/apps/v1beta2/daemon_set_spec.rb +0 -29
  660. data/lib/kube-dsl/dsl/apps/v1beta2/daemon_set_status.rb +0 -44
  661. data/lib/kube-dsl/dsl/apps/v1beta2/daemon_set_update_strategy.rb +0 -20
  662. data/lib/kube-dsl/dsl/apps/v1beta2/deployment.rb +0 -25
  663. data/lib/kube-dsl/dsl/apps/v1beta2/deployment_condition.rb +0 -32
  664. data/lib/kube-dsl/dsl/apps/v1beta2/deployment_list.rb +0 -22
  665. data/lib/kube-dsl/dsl/apps/v1beta2/deployment_spec.rb +0 -38
  666. data/lib/kube-dsl/dsl/apps/v1beta2/deployment_status.rb +0 -38
  667. data/lib/kube-dsl/dsl/apps/v1beta2/deployment_strategy.rb +0 -20
  668. data/lib/kube-dsl/dsl/apps/v1beta2/replica_set.rb +0 -25
  669. data/lib/kube-dsl/dsl/apps/v1beta2/replica_set_condition.rb +0 -29
  670. data/lib/kube-dsl/dsl/apps/v1beta2/replica_set_list.rb +0 -22
  671. data/lib/kube-dsl/dsl/apps/v1beta2/replica_set_spec.rb +0 -26
  672. data/lib/kube-dsl/dsl/apps/v1beta2/replica_set_status.rb +0 -32
  673. data/lib/kube-dsl/dsl/apps/v1beta2/rolling_update_daemon_set.rb +0 -17
  674. data/lib/kube-dsl/dsl/apps/v1beta2/rolling_update_deployment.rb +0 -20
  675. data/lib/kube-dsl/dsl/apps/v1beta2/rolling_update_stateful_set_strategy.rb +0 -17
  676. data/lib/kube-dsl/dsl/apps/v1beta2/scale.rb +0 -25
  677. data/lib/kube-dsl/dsl/apps/v1beta2/scale_spec.rb +0 -17
  678. data/lib/kube-dsl/dsl/apps/v1beta2/scale_status.rb +0 -23
  679. data/lib/kube-dsl/dsl/apps/v1beta2/stateful_set.rb +0 -25
  680. data/lib/kube-dsl/dsl/apps/v1beta2/stateful_set_condition.rb +0 -29
  681. data/lib/kube-dsl/dsl/apps/v1beta2/stateful_set_list.rb +0 -22
  682. data/lib/kube-dsl/dsl/apps/v1beta2/stateful_set_spec.rb +0 -38
  683. data/lib/kube-dsl/dsl/apps/v1beta2/stateful_set_status.rb +0 -41
  684. data/lib/kube-dsl/dsl/apps/v1beta2/stateful_set_update_strategy.rb +0 -20
  685. data/lib/kube-dsl/dsl/apps/v1beta2.rb +0 -33
  686. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/audit_sink.rb +0 -22
  687. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/audit_sink_list.rb +0 -22
  688. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/audit_sink_spec.rb +0 -20
  689. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/policy.rb +0 -20
  690. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/service_reference.rb +0 -26
  691. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/webhook.rb +0 -20
  692. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/webhook_client_config.rb +0 -23
  693. data/lib/kube-dsl/dsl/auditregistration/v1alpha1/webhook_throttle_config.rb +0 -20
  694. data/lib/kube-dsl/dsl/auditregistration/v1alpha1.rb +0 -10
  695. data/lib/kube-dsl/dsl/auditregistration.rb +0 -3
  696. data/lib/kube-dsl/dsl/authentication/v1beta1/token_review.rb +0 -25
  697. data/lib/kube-dsl/dsl/authentication/v1beta1/token_review_spec.rb +0 -20
  698. data/lib/kube-dsl/dsl/authentication/v1beta1/token_review_status.rb +0 -26
  699. data/lib/kube-dsl/dsl/authentication/v1beta1/user_info.rb +0 -26
  700. data/lib/kube-dsl/dsl/authentication/v1beta1.rb +0 -6
  701. data/lib/kube-dsl/dsl/authorization/v1beta1/local_subject_access_review.rb +0 -25
  702. data/lib/kube-dsl/dsl/authorization/v1beta1/non_resource_attributes.rb +0 -20
  703. data/lib/kube-dsl/dsl/authorization/v1beta1/non_resource_rule.rb +0 -20
  704. data/lib/kube-dsl/dsl/authorization/v1beta1/resource_attributes.rb +0 -35
  705. data/lib/kube-dsl/dsl/authorization/v1beta1/resource_rule.rb +0 -26
  706. data/lib/kube-dsl/dsl/authorization/v1beta1/self_subject_access_review.rb +0 -25
  707. data/lib/kube-dsl/dsl/authorization/v1beta1/self_subject_access_review_spec.rb +0 -20
  708. data/lib/kube-dsl/dsl/authorization/v1beta1/self_subject_rules_review.rb +0 -25
  709. data/lib/kube-dsl/dsl/authorization/v1beta1/self_subject_rules_review_spec.rb +0 -17
  710. data/lib/kube-dsl/dsl/authorization/v1beta1/subject_access_review.rb +0 -25
  711. data/lib/kube-dsl/dsl/authorization/v1beta1/subject_access_review_spec.rb +0 -32
  712. data/lib/kube-dsl/dsl/authorization/v1beta1/subject_access_review_status.rb +0 -26
  713. data/lib/kube-dsl/dsl/authorization/v1beta1/subject_rules_review_status.rb +0 -26
  714. data/lib/kube-dsl/dsl/authorization/v1beta1.rb +0 -15
  715. data/lib/kube-dsl/dsl/batch/v2alpha1/cron_job.rb +0 -25
  716. data/lib/kube-dsl/dsl/batch/v2alpha1/cron_job_list.rb +0 -22
  717. data/lib/kube-dsl/dsl/batch/v2alpha1/cron_job_spec.rb +0 -35
  718. data/lib/kube-dsl/dsl/batch/v2alpha1/cron_job_status.rb +0 -20
  719. data/lib/kube-dsl/dsl/batch/v2alpha1/job_template_spec.rb +0 -20
  720. data/lib/kube-dsl/dsl/batch/v2alpha1.rb +0 -7
  721. data/lib/kube-dsl/dsl/certificates/v1beta1/certificate_signing_request.rb +0 -25
  722. data/lib/kube-dsl/dsl/certificates/v1beta1/certificate_signing_request_condition.rb +0 -26
  723. data/lib/kube-dsl/dsl/certificates/v1beta1/certificate_signing_request_list.rb +0 -22
  724. data/lib/kube-dsl/dsl/certificates/v1beta1/certificate_signing_request_spec.rb +0 -32
  725. data/lib/kube-dsl/dsl/certificates/v1beta1/certificate_signing_request_status.rb +0 -20
  726. data/lib/kube-dsl/dsl/coordination/v1beta1/lease.rb +0 -22
  727. data/lib/kube-dsl/dsl/coordination/v1beta1/lease_list.rb +0 -22
  728. data/lib/kube-dsl/dsl/coordination/v1beta1/lease_spec.rb +0 -29
  729. data/lib/kube-dsl/dsl/coordination/v1beta1.rb +0 -5
  730. data/lib/kube-dsl/dsl/extensions/v1beta1/allowed_csi_driver.rb +0 -17
  731. data/lib/kube-dsl/dsl/extensions/v1beta1/allowed_flex_volume.rb +0 -17
  732. data/lib/kube-dsl/dsl/extensions/v1beta1/allowed_host_path.rb +0 -20
  733. data/lib/kube-dsl/dsl/extensions/v1beta1/daemon_set.rb +0 -25
  734. data/lib/kube-dsl/dsl/extensions/v1beta1/daemon_set_condition.rb +0 -29
  735. data/lib/kube-dsl/dsl/extensions/v1beta1/daemon_set_list.rb +0 -22
  736. data/lib/kube-dsl/dsl/extensions/v1beta1/daemon_set_spec.rb +0 -32
  737. data/lib/kube-dsl/dsl/extensions/v1beta1/daemon_set_status.rb +0 -44
  738. data/lib/kube-dsl/dsl/extensions/v1beta1/daemon_set_update_strategy.rb +0 -20
  739. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment.rb +0 -25
  740. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment_condition.rb +0 -32
  741. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment_list.rb +0 -22
  742. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment_rollback.rb +0 -25
  743. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment_spec.rb +0 -41
  744. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment_status.rb +0 -38
  745. data/lib/kube-dsl/dsl/extensions/v1beta1/deployment_strategy.rb +0 -20
  746. data/lib/kube-dsl/dsl/extensions/v1beta1/fs_group_strategy_options.rb +0 -20
  747. data/lib/kube-dsl/dsl/extensions/v1beta1/host_port_range.rb +0 -20
  748. data/lib/kube-dsl/dsl/extensions/v1beta1/http_ingress_path.rb +0 -20
  749. data/lib/kube-dsl/dsl/extensions/v1beta1/http_ingress_rule_value.rb +0 -17
  750. data/lib/kube-dsl/dsl/extensions/v1beta1/id_range.rb +0 -20
  751. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress.rb +0 -25
  752. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress_backend.rb +0 -20
  753. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress_list.rb +0 -22
  754. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress_rule.rb +0 -20
  755. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress_spec.rb +0 -23
  756. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress_status.rb +0 -17
  757. data/lib/kube-dsl/dsl/extensions/v1beta1/ingress_tls.rb +0 -20
  758. data/lib/kube-dsl/dsl/extensions/v1beta1/ip_block.rb +0 -20
  759. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy.rb +0 -22
  760. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy_egress_rule.rb +0 -20
  761. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy_ingress_rule.rb +0 -20
  762. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy_list.rb +0 -22
  763. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy_peer.rb +0 -23
  764. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy_port.rb +0 -20
  765. data/lib/kube-dsl/dsl/extensions/v1beta1/network_policy_spec.rb +0 -26
  766. data/lib/kube-dsl/dsl/extensions/v1beta1/pod_security_policy.rb +0 -22
  767. data/lib/kube-dsl/dsl/extensions/v1beta1/pod_security_policy_list.rb +0 -22
  768. data/lib/kube-dsl/dsl/extensions/v1beta1/pod_security_policy_spec.rb +0 -86
  769. data/lib/kube-dsl/dsl/extensions/v1beta1/replica_set.rb +0 -25
  770. data/lib/kube-dsl/dsl/extensions/v1beta1/replica_set_condition.rb +0 -29
  771. data/lib/kube-dsl/dsl/extensions/v1beta1/replica_set_list.rb +0 -22
  772. data/lib/kube-dsl/dsl/extensions/v1beta1/replica_set_spec.rb +0 -26
  773. data/lib/kube-dsl/dsl/extensions/v1beta1/replica_set_status.rb +0 -32
  774. data/lib/kube-dsl/dsl/extensions/v1beta1/rollback_config.rb +0 -17
  775. data/lib/kube-dsl/dsl/extensions/v1beta1/rolling_update_daemon_set.rb +0 -17
  776. data/lib/kube-dsl/dsl/extensions/v1beta1/rolling_update_deployment.rb +0 -20
  777. data/lib/kube-dsl/dsl/extensions/v1beta1/run_as_group_strategy_options.rb +0 -20
  778. data/lib/kube-dsl/dsl/extensions/v1beta1/run_as_user_strategy_options.rb +0 -20
  779. data/lib/kube-dsl/dsl/extensions/v1beta1/runtime_class_strategy_options.rb +0 -20
  780. data/lib/kube-dsl/dsl/extensions/v1beta1/scale.rb +0 -25
  781. data/lib/kube-dsl/dsl/extensions/v1beta1/scale_spec.rb +0 -17
  782. data/lib/kube-dsl/dsl/extensions/v1beta1/scale_status.rb +0 -23
  783. data/lib/kube-dsl/dsl/extensions/v1beta1/se_linux_strategy_options.rb +0 -20
  784. data/lib/kube-dsl/dsl/extensions/v1beta1/supplemental_groups_strategy_options.rb +0 -20
  785. data/lib/kube-dsl/dsl/extensions/v1beta1.rb +0 -57
  786. data/lib/kube-dsl/dsl/extensions.rb +0 -3
  787. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/flow_distinguisher_method.rb +0 -17
  788. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/flow_schema.rb +0 -25
  789. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/flow_schema_condition.rb +0 -29
  790. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/flow_schema_list.rb +0 -22
  791. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/flow_schema_spec.rb +0 -26
  792. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/flow_schema_status.rb +0 -17
  793. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/group_subject.rb +0 -17
  794. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/limit_response.rb +0 -20
  795. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/limited_priority_level_configuration.rb +0 -20
  796. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/non_resource_policy_rule.rb +0 -20
  797. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/policy_rules_with_subjects.rb +0 -23
  798. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/priority_level_configuration.rb +0 -25
  799. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/priority_level_configuration_condition.rb +0 -29
  800. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/priority_level_configuration_list.rb +0 -22
  801. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/priority_level_configuration_reference.rb +0 -17
  802. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/priority_level_configuration_spec.rb +0 -20
  803. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/priority_level_configuration_status.rb +0 -17
  804. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/queuing_configuration.rb +0 -23
  805. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/resource_policy_rule.rb +0 -29
  806. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/service_account_subject.rb +0 -20
  807. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/subject.rb +0 -26
  808. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1/user_subject.rb +0 -17
  809. data/lib/kube-dsl/dsl/flowcontrol/v1alpha1.rb +0 -24
  810. data/lib/kube-dsl/dsl/networking/v1beta1/http_ingress_path.rb +0 -20
  811. data/lib/kube-dsl/dsl/networking/v1beta1/http_ingress_rule_value.rb +0 -17
  812. data/lib/kube-dsl/dsl/networking/v1beta1/ingress.rb +0 -25
  813. data/lib/kube-dsl/dsl/networking/v1beta1/ingress_backend.rb +0 -20
  814. data/lib/kube-dsl/dsl/networking/v1beta1/ingress_list.rb +0 -22
  815. data/lib/kube-dsl/dsl/networking/v1beta1/ingress_rule.rb +0 -20
  816. data/lib/kube-dsl/dsl/networking/v1beta1/ingress_spec.rb +0 -23
  817. data/lib/kube-dsl/dsl/networking/v1beta1/ingress_status.rb +0 -17
  818. data/lib/kube-dsl/dsl/networking/v1beta1/ingress_tls.rb +0 -20
  819. data/lib/kube-dsl/dsl/networking/v1beta1.rb +0 -11
  820. data/lib/kube-dsl/dsl/policy/v1beta1/eviction.rb +0 -22
  821. data/lib/kube-dsl/dsl/rbac/v1beta1/aggregation_rule.rb +0 -17
  822. data/lib/kube-dsl/dsl/rbac/v1beta1/cluster_role.rb +0 -25
  823. data/lib/kube-dsl/dsl/rbac/v1beta1/cluster_role_binding.rb +0 -25
  824. data/lib/kube-dsl/dsl/rbac/v1beta1/cluster_role_binding_list.rb +0 -22
  825. data/lib/kube-dsl/dsl/rbac/v1beta1/cluster_role_list.rb +0 -22
  826. data/lib/kube-dsl/dsl/rbac/v1beta1/policy_rule.rb +0 -29
  827. data/lib/kube-dsl/dsl/rbac/v1beta1/role.rb +0 -22
  828. data/lib/kube-dsl/dsl/rbac/v1beta1/role_binding.rb +0 -25
  829. data/lib/kube-dsl/dsl/rbac/v1beta1/role_binding_list.rb +0 -22
  830. data/lib/kube-dsl/dsl/rbac/v1beta1/role_list.rb +0 -22
  831. data/lib/kube-dsl/dsl/rbac/v1beta1/role_ref.rb +0 -23
  832. data/lib/kube-dsl/dsl/rbac/v1beta1/subject.rb +0 -26
  833. data/lib/kube-dsl/dsl/rbac/v1beta1.rb +0 -14
  834. data/lib/kube-dsl/dsl/scheduling/v1beta1/priority_class.rb +0 -31
  835. data/lib/kube-dsl/dsl/scheduling/v1beta1/priority_class_list.rb +0 -22
  836. data/lib/kube-dsl/dsl/scheduling/v1beta1.rb +0 -4
  837. data/lib/kube-dsl/dsl/settings/v1alpha1/pod_preset.rb +0 -22
  838. data/lib/kube-dsl/dsl/settings/v1alpha1/pod_preset_list.rb +0 -22
  839. data/lib/kube-dsl/dsl/settings/v1alpha1/pod_preset_spec.rb +0 -29
  840. data/lib/kube-dsl/dsl/settings/v1alpha1.rb +0 -5
  841. data/lib/kube-dsl/dsl/settings.rb +0 -3
  842. data/lib/kube-dsl/dsl/storage/v1beta1/csi_driver.rb +0 -22
  843. data/lib/kube-dsl/dsl/storage/v1beta1/csi_driver_list.rb +0 -22
  844. data/lib/kube-dsl/dsl/storage/v1beta1/csi_driver_spec.rb +0 -23
  845. data/lib/kube-dsl/dsl/storage/v1beta1/csi_node.rb +0 -22
  846. data/lib/kube-dsl/dsl/storage/v1beta1/csi_node_driver.rb +0 -26
  847. data/lib/kube-dsl/dsl/storage/v1beta1/csi_node_list.rb +0 -22
  848. data/lib/kube-dsl/dsl/storage/v1beta1/csi_node_spec.rb +0 -17
  849. data/lib/kube-dsl/dsl/storage/v1beta1/storage_class.rb +0 -40
  850. data/lib/kube-dsl/dsl/storage/v1beta1/storage_class_list.rb +0 -22
  851. data/lib/kube-dsl/dsl/storage/v1beta1/volume_attachment.rb +0 -25
  852. data/lib/kube-dsl/dsl/storage/v1beta1/volume_attachment_list.rb +0 -22
  853. data/lib/kube-dsl/dsl/storage/v1beta1/volume_attachment_source.rb +0 -20
  854. data/lib/kube-dsl/dsl/storage/v1beta1/volume_attachment_spec.rb +0 -23
  855. data/lib/kube-dsl/dsl/storage/v1beta1/volume_attachment_status.rb +0 -26
  856. data/lib/kube-dsl/dsl/storage/v1beta1/volume_error.rb +0 -20
  857. data/lib/kube-dsl/dsl/storage/v1beta1/volume_node_resources.rb +0 -17
@@ -0,0 +1,109 @@
1
+ # typed: false
2
+
3
+ module KubeDSL
4
+ class EntrypointBuilder
5
+ include StringHelpers
6
+
7
+ attr_reader :builder, :block
8
+
9
+ def initialize(builder, &block)
10
+ @builder = builder
11
+ @block = block
12
+ end
13
+
14
+ def entrypoint
15
+ ruby_code = "# typed: strict\n\n#{module_namespace}\n"
16
+
17
+ builder.each_resource do |resource|
18
+ ns = resource.ref.ruby_namespace.join('::')
19
+ next if block && !block.call(resource, ns)
20
+
21
+ method_name = method_name_for(resource)
22
+
23
+ ruby_code << "#{indent}def #{method_name}(&block)\n"
24
+ ruby_code << "#{indent} ::#{ns}::#{resource.ref.kind}.new(&block)\n"
25
+ ruby_code << "#{indent}end\n\n"
26
+ end
27
+
28
+ ruby_code.strip!
29
+
30
+ (indent_level - 1).downto(0) do |idx|
31
+ ruby_code << "\n#{' ' * idx}end"
32
+ end
33
+
34
+ "#{ruby_code}\n"
35
+ end
36
+
37
+ def entrypoint_rbi
38
+ rbi_code = "# typed: strict\n\n#{module_namespace}\n"
39
+
40
+ builder.each_resource do |resource|
41
+ ns = resource.ref.ruby_namespace.join('::')
42
+ next if block && !block.call(resource, ns)
43
+
44
+ method_name = method_name_for(resource)
45
+
46
+ rbi_code << "#{indent}T::Sig::WithoutRuntime.sig { params(block: T.proc.void).returns(::#{ns}::#{resource.ref.kind}) }\n"
47
+ rbi_code << "#{indent}def #{method_name}(&block); end\n\n"
48
+ end
49
+
50
+ rbi_code.strip!
51
+
52
+ (indent_level - 1).downto(0) do |idx|
53
+ rbi_code << "\n#{' ' * idx}end"
54
+ end
55
+
56
+ "#{rbi_code}\n"
57
+ end
58
+
59
+ def path
60
+ @path ||= File.join(builder.output_dir, File.dirname(builder.autoload_prefix), 'entrypoint.rb')
61
+ end
62
+
63
+ def rbi_path
64
+ @rbi_path ||= begin
65
+ rbi_path = File.join('sorbet', 'rbi', *path.split(File::SEPARATOR)[1..-1])
66
+ "#{rbi_path.chomp('.rb')}.rbi"
67
+ end
68
+ end
69
+
70
+ private
71
+
72
+ def kinds
73
+ @kinds ||= builder.each_resource.map do |resource|
74
+ ns = resource.ref.ruby_namespace.join('::')
75
+ next if block && !block.call(resource, ns)
76
+
77
+ resource.ref.kind
78
+ end
79
+ end
80
+
81
+ def ambiguous_kinds
82
+ @ambiguous_kinds ||= kinds.compact.tally.each_with_object([]) do |(kind, count), memo|
83
+ memo << kind if count > 1
84
+ end
85
+ end
86
+
87
+ def module_namespace
88
+ @module_namespace ||= [*builder.entrypoint_namespace, 'Entrypoint'].map.with_index do |ep_mod, idx|
89
+ "#{' ' * idx}module #{ep_mod}"
90
+ end.join("\n")
91
+ end
92
+
93
+ def indent_level
94
+ @indent_level ||= builder.entrypoint_namespace.size + 1
95
+ end
96
+
97
+ def indent
98
+ @indent ||= ' ' * indent_level
99
+ end
100
+
101
+ def method_name_for(resource)
102
+ if ambiguous_kinds.include?(resource.ref.kind)
103
+ underscore([resource.ref.namespace, resource.ref.version, resource.ref.kind].compact.join('_'))
104
+ else
105
+ underscore(resource.ref.kind)
106
+ end
107
+ end
108
+ end
109
+ end
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  module KubeDSL
2
3
  class ExternalRef < Ref
3
4
  def meta
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  module KubeDSL
2
3
  class ExternalResourceMeta
3
4
  attr_reader :ref
@@ -1,6 +1,8 @@
1
+ # typed: true
1
2
  module KubeDSL
2
3
  class FieldRes
3
4
  include StringHelpers
5
+ include RbiHelpers
4
6
 
5
7
  attr_reader :name, :type, :required
6
8
 
@@ -16,6 +18,13 @@ module KubeDSL
16
18
  ["value_field :#{ruby_safe_name}"]
17
19
  end
18
20
 
21
+ def fields_to_rbi(inflector)
22
+ [
23
+ "T::Sig::WithoutRuntime.sig { params(val: T.nilable(#{rbi_type_for(@type)})).returns(#{rbi_type_for(@type)}) }",
24
+ "def #{ruby_safe_name}(val = nil); end"
25
+ ]
26
+ end
27
+
19
28
  def validations(_inflector)
20
29
  [].tap do |result|
21
30
  result << "validates :#{ruby_safe_name}, field: { format: :#{type} }, presence: #{required? ? 'true' : 'false'}"
@@ -1,3 +1,5 @@
1
+ # typed: false
2
+
1
3
  module KubeDSL
2
4
  class Generator
3
5
  attr_reader :builder
@@ -6,13 +8,13 @@ module KubeDSL
6
8
  @builder = Builder.new(*args, **kwargs)
7
9
  end
8
10
 
9
- def generate
10
- generate_resource_files
11
+ def generate(include_rbi: true)
12
+ generate_resource_files(include_rbi: include_rbi)
11
13
  generate_autoload_files
12
- generate_entrypoint_file
14
+ generate_entrypoint_file(include_rbi: include_rbi)
13
15
  end
14
16
 
15
- def generate_resource_files
17
+ def generate_resource_files(include_rbi: true)
16
18
  builder.each_resource_file do |path, res|
17
19
  FileUtils.mkdir_p(File.dirname(path))
18
20
 
@@ -22,6 +24,19 @@ module KubeDSL
22
24
  puts "Writing #{path}"
23
25
  File.write(path, res.to_ruby)
24
26
  end
27
+
28
+ next unless include_rbi
29
+
30
+ rbi_path = File.join('sorbet', 'rbi', *path.split(File::SEPARATOR)[1..-1])
31
+ rbi_path = "#{rbi_path.chomp('.rb')}.rbi"
32
+ FileUtils.mkdir_p(File.dirname(rbi_path))
33
+
34
+ if File.exist?(rbi_path)
35
+ puts "Skipping #{rbi_path} because it already exists"
36
+ else
37
+ puts "Writing #{rbi_path}"
38
+ File.write(rbi_path, res.to_rbi)
39
+ end
25
40
  end
26
41
  end
27
42
 
@@ -36,12 +51,23 @@ module KubeDSL
36
51
  end
37
52
  end
38
53
 
39
- def generate_entrypoint_file(&block)
40
- if File.exist?(builder.entrypoint_path)
41
- puts "Skipping #{builder.entrypoint_path} because it already exists"
54
+ def generate_entrypoint_file(include_rbi: true, &block)
55
+ entrypoint_builder = builder.entrypoint(&block)
56
+
57
+ if File.exist?(entrypoint_builder.path)
58
+ puts "Skipping #{entrypoint_builder.path} because it already exists"
42
59
  else
43
- puts "Writing #{builder.entrypoint_path}"
44
- File.write(builder.entrypoint_path, builder.entrypoint(&block))
60
+ entrypoint_ruby = entrypoint_builder.entrypoint
61
+
62
+ puts "Writing #{entrypoint_builder.path}"
63
+ File.write(entrypoint_builder.path, entrypoint_ruby)
64
+
65
+ if include_rbi
66
+ entrypoint_rbi = entrypoint_builder.entrypoint_rbi
67
+
68
+ puts "Writing #{entrypoint_builder.rbi_path}"
69
+ File.write(entrypoint_builder.rbi_path, entrypoint_rbi)
70
+ end
45
71
  end
46
72
  end
47
73
  end
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  require 'dry/inflector'
2
3
  require 'singleton'
3
4
 
@@ -0,0 +1,57 @@
1
+ # typed: false
2
+ module KubeDSL
3
+ class InlineRef
4
+ attr_reader :name, :document, :parent_ref, :serialize_handlers
5
+
6
+ def initialize(name, document, parent_ref, serialize_handlers)
7
+ @name = name
8
+ @document = document
9
+ @parent_ref = parent_ref
10
+ @serialize_handlers = serialize_handlers
11
+ end
12
+
13
+ def method_missing(method_name, *args, **kwargs, &block)
14
+ parent_ref.send(method_name, *args, **kwargs, &block)
15
+ end
16
+
17
+ def respond_to_missing?(method_name)
18
+ parent_ref.respond_to?(method_name)
19
+ end
20
+
21
+ def inline?
22
+ true
23
+ end
24
+
25
+ def meta
26
+ @meta ||= ResourceMeta.new(self, inflector, serialize_handlers)
27
+ end
28
+
29
+ def kind
30
+ ''.tap do |result|
31
+ current_ref = self
32
+
33
+ while current_ref.inline?
34
+ # this is String#prepend
35
+ result.prepend(capitalize(current_ref.name))
36
+ current_ref = current_ref.parent_ref
37
+ end
38
+
39
+ result.prepend(current_ref.kind)
40
+ end
41
+ end
42
+
43
+ def str
44
+ @str ||= "#{parent_ref.str}.#{name}"
45
+ end
46
+
47
+ def ruby_autoload_path
48
+ @ruby_autoload_path ||= File.join(
49
+ [autoload_prefix].tap do |path|
50
+ path << underscore(namespace) if namespace
51
+ path << underscore(version) if version
52
+ path << "#{underscore(kind)}.rb"
53
+ end
54
+ )
55
+ end
56
+ end
57
+ end
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  module KubeDSL
2
3
  class KeyValueFieldRes
3
4
  include StringHelpers
@@ -19,6 +20,13 @@ module KubeDSL
19
20
  ]
20
21
  end
21
22
 
23
+ def fields_to_rbi(_inflector)
24
+ [
25
+ "T::Sig::WithoutRuntime.sig { params(block: T.nilable(T.proc.void)).returns(::KubeDSL::KeyValueFields) }",
26
+ "def #{underscore(name)}(&block); end"
27
+ ]
28
+ end
29
+
22
30
  def validations(_inflector)
23
31
  [].tap do |result|
24
32
  result << "validates :#{underscore(name)}, kv: { value_format: :#{type} }, presence: #{required? ? 'true' : 'false'}"
@@ -1,42 +1,58 @@
1
+ # typed: strict
2
+
1
3
  require 'base64'
2
4
 
3
5
  module KubeDSL
4
6
  class KeyValueFields
5
- attr_reader :format, :kv_pairs
7
+ extend T::Sig
8
+
9
+ T::Sig::WithoutRuntime.sig { returns(Symbol) }
10
+ attr_reader :format
11
+
12
+ T::Sig::WithoutRuntime.sig { returns(T::Hash[Symbol, String]) }
13
+ attr_reader :kv_pairs
6
14
 
15
+ T::Sig::WithoutRuntime.sig { params(format: Symbol).void }
7
16
  def initialize(format: :string)
8
17
  @format = format
9
- @kv_pairs = {}
18
+ @kv_pairs = T.let({}, T::Hash[Symbol, String])
10
19
  end
11
20
 
21
+ T::Sig::WithoutRuntime.sig { params(key: Symbol, value: String).void }
12
22
  def add(key, value)
13
23
  @kv_pairs[key] = value
14
24
  end
15
25
 
26
+ T::Sig::WithoutRuntime.sig { params(key: Symbol).void }
16
27
  def remove(key)
17
28
  @kv_pairs.delete(key)
18
29
  end
19
30
 
31
+ T::Sig::WithoutRuntime.sig { params(key: Symbol).returns(T.nilable(String)) }
20
32
  def get(key)
21
33
  @kv_pairs[key]
22
34
  end
23
35
 
36
+ T::Sig::WithoutRuntime.sig { params(key: Symbol, value: String).void }
24
37
  def set(key, value)
25
38
  @kv_pairs[key] = value
26
39
  end
27
40
 
41
+ T::Sig::WithoutRuntime.sig { returns(T::Hash[Symbol, String]) }
28
42
  def serialize
29
43
  @kv_pairs.each_with_object({}) do |(key, value), ret|
30
44
  ret[key] = serialize_value(value)
31
45
  end
32
46
  end
33
47
 
48
+ T::Sig::WithoutRuntime.sig { params(other: KeyValueFields).void }
34
49
  def merge!(other)
35
50
  @kv_pairs.merge!(other.instance_variable_get(:@kv_pairs))
36
51
  end
37
52
 
38
53
  private
39
54
 
55
+ T::Sig::WithoutRuntime.sig { params(data: String).returns(String) }
40
56
  def serialize_value(data)
41
57
  case format
42
58
  when :byte
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  module KubeDSL
2
3
  class ObjectFieldRes
3
4
  include StringHelpers
@@ -11,7 +12,14 @@ module KubeDSL
11
12
 
12
13
  def fields_to_ruby(_inflector)
13
14
  [
14
- "object_field(:#{ruby_safe_name}) { #{res.ref.ruby_namespace.join('::')}::#{res.ref.kind}.new }"
15
+ "object_field(:#{ruby_safe_name}) { #{ruby_type}.new }"
16
+ ]
17
+ end
18
+
19
+ def fields_to_rbi(_inflector)
20
+ [
21
+ "T::Sig::WithoutRuntime.sig { returns(#{ruby_type}) }",
22
+ "def #{ruby_safe_name}; end"
15
23
  ]
16
24
  end
17
25
 
@@ -28,6 +36,10 @@ module KubeDSL
28
36
 
29
37
  private
30
38
 
39
+ def ruby_type
40
+ @ruby_type ||= "#{res.ref.ruby_namespace.join('::')}::#{res.ref.kind}"
41
+ end
42
+
31
43
  def ruby_safe_name
32
44
  @ruby_safe_name ||= unkeywordify(underscore(name))
33
45
  end
@@ -0,0 +1,17 @@
1
+ # typed: true
2
+ module KubeDSL
3
+ module RbiHelpers
4
+ include StringHelpers
5
+
6
+ TYPE_MAP = {
7
+ 'boolean' => 'T::Boolean',
8
+ 'number' => 'Integer'
9
+ }
10
+
11
+ TYPE_MAP.freeze
12
+
13
+ def rbi_type_for(type_str)
14
+ TYPE_MAP.fetch(type_str) { capitalize(type_str) }
15
+ end
16
+ end
17
+ end
data/lib/kube-dsl/ref.rb CHANGED
@@ -1,16 +1,18 @@
1
+ # typed: false
1
2
  module KubeDSL
2
3
  class Ref
3
4
  include StringHelpers
4
5
 
5
6
  attr_reader :str, :kind, :namespace, :version, :inflector, :schema_dir
6
- attr_reader :ruby_namespace_prefix, :autoload_prefix
7
+ attr_reader :ruby_namespace_prefix, :autoload_prefix, :serialize_handlers
7
8
 
8
- def initialize(str, ruby_namespace_prefix, inflector, schema_dir, autoload_prefix)
9
+ def initialize(str, ruby_namespace_prefix, inflector, schema_dir, autoload_prefix, serialize_handlers)
9
10
  @str = str
10
11
  @ruby_namespace_prefix = ruby_namespace_prefix
11
12
  @inflector = inflector
12
13
  @schema_dir = schema_dir
13
14
  @autoload_prefix = autoload_prefix
15
+ @serialize_handlers = serialize_handlers
14
16
 
15
17
  ns, v, k = str.split('.').last(3)
16
18
 
@@ -26,8 +28,12 @@ module KubeDSL
26
28
  end
27
29
  end
28
30
 
31
+ def inline?
32
+ false
33
+ end
34
+
29
35
  def meta
30
- @meta ||= ResourceMeta.new(self, inflector)
36
+ @meta ||= ResourceMeta.new(self, inflector, serialize_handlers)
31
37
  end
32
38
 
33
39
  def document
@@ -1,25 +1,38 @@
1
+ # typed: strict
2
+
1
3
  module KubeDSL
2
4
  class Resource
5
+ extend T::Sig
6
+
7
+ T::Sig::WithoutRuntime.sig { returns(T.any(String, T::Array[T.untyped], T::Hash[T.untyped, T.untyped])) }
3
8
  attr_reader :contents
4
9
 
10
+ T::Sig::WithoutRuntime.sig { params(contents: T.any(String, T::Array[T.untyped], T::Hash[T.untyped, T.untyped])).void }
5
11
  def initialize(contents)
6
12
  @contents = contents
7
13
  end
8
14
 
15
+ T::Sig::WithoutRuntime.sig { returns(T.nilable(T.any(String, T::Array[T.untyped], T::Hash[T.untyped, T.untyped]))) }
9
16
  def serialize
10
17
  cleanup(contents)
11
18
  end
12
19
 
20
+ T::Sig::WithoutRuntime.sig { returns(String) }
13
21
  def to_yaml
14
22
  YAML.dump(serialize)
15
23
  end
16
24
 
25
+ T::Sig::WithoutRuntime.sig { returns(Resource) }
17
26
  def to_resource
18
27
  self
19
28
  end
20
29
 
21
30
  private
22
31
 
32
+ T::Sig::WithoutRuntime.sig {
33
+ params(obj: T.any(String, AllowBlank, T::Array[T.untyped], T::Hash[T.untyped, T.untyped]))
34
+ .returns(T.nilable(T.any(String, T::Array[T.untyped], T::Hash[T.untyped, T.untyped])))
35
+ }
23
36
  def cleanup(obj)
24
37
  case obj
25
38
  when Array
@@ -33,6 +46,18 @@ module KubeDSL
33
46
  end
34
47
 
35
48
  cleaned.empty? ? nil : cleaned
49
+ when AllowBlank
50
+ cln = cleanup(obj.value)
51
+ return cln if cln
52
+
53
+ case obj.value
54
+ when Array
55
+ []
56
+ when Hash
57
+ {}
58
+ else
59
+ nil
60
+ end
36
61
  else
37
62
  obj
38
63
  end
@@ -1,12 +1,15 @@
1
+ # typed: false
2
+
1
3
  module KubeDSL
2
4
  class ResourceMeta
3
5
  include StringHelpers
4
6
 
5
- attr_reader :ref ,:inflector, :fields
7
+ attr_reader :ref, :inflector, :serialize_handlers, :fields
6
8
 
7
- def initialize(ref, inflector)
9
+ def initialize(ref, inflector, serialize_handlers)
8
10
  @ref = ref
9
11
  @inflector = inflector
12
+ @serialize_handlers = serialize_handlers
10
13
  @fields = {}
11
14
  end
12
15
 
@@ -19,62 +22,124 @@ module KubeDSL
19
22
  end
20
23
 
21
24
  def to_ruby
22
- ''.tap do |str|
23
- str << "module #{ref.ruby_namespace.join('::')}\n"
24
- str << " class #{ref.kind} < ::KubeDSL::DSLObject\n"
25
- str << fields_to_ruby
26
- str << "\n"
27
- str << validations
28
- str << "\n"
29
- str << serialize_method
30
- str << "\n"
31
- str << " def kind_sym\n"
32
- str << " :#{underscore(ref.kind)}\n"
33
- str << " end\n"
34
- str << " end\n"
35
- str << "end\n"
36
- end
25
+ level = ref.ruby_namespace.size - 1
26
+
27
+ lines = [
28
+ "# typed: true",
29
+ '',
30
+ *ref.ruby_namespace.flat_map.with_index do |mod, idx|
31
+ indent("module #{mod}", idx)
32
+ end,
33
+ *indent("class #{ref.kind} < ::KubeDSL::DSLObject", level + 1),
34
+ *fields_to_ruby(level + 2),
35
+ *validations(level + 2),
36
+ *serialize_method(level + 2),
37
+ *indent(
38
+ 'def kind_sym',
39
+ " :#{underscore(ref.kind)}",
40
+ 'end', level + 2
41
+ ),
42
+ *indent('end', level + 1), # class
43
+ *level.downto(0).flat_map do |idx|
44
+ indent('end', idx)
45
+ end
46
+ ]
47
+
48
+ lines.join("\n")
49
+ end
50
+
51
+ def to_rbi
52
+ level = ref.ruby_namespace.size - 1
53
+
54
+ lines = [
55
+ "# typed: strict",
56
+ '',
57
+ *ref.ruby_namespace.flat_map.with_index do |mod, idx|
58
+ indent("module #{mod}", idx)
59
+ end,
60
+ *indent("class #{ref.kind} < ::KubeDSL::DSLObject", level + 1),
61
+ *indent(
62
+ 'T::Sig::WithoutRuntime.sig {',
63
+ ' returns(',
64
+ ' T::Hash[Symbol, T.any(String, Integer, Float, T::Boolean, T::Array[T.untyped], T::Hash[Symbol, T.untyped])]',
65
+ ' )',
66
+ '}',
67
+ 'def serialize; end', level + 2
68
+ ),
69
+ '',
70
+ *indent(
71
+ 'T::Sig::WithoutRuntime.sig { returns(Symbol) }',
72
+ 'def kind_sym; end', level + 2
73
+ ),
74
+ '',
75
+ *fields_to_rbi(level + 2),
76
+ *indent('end', level + 1), # class
77
+ *level.downto(0).flat_map do |idx|
78
+ indent('end', idx)
79
+ end
80
+ ]
81
+
82
+ lines.join("\n")
37
83
  end
38
84
 
39
85
  private
40
86
 
41
- def indent(lines, level)
87
+ def indent(*lines, level)
42
88
  lines.map do |line|
43
89
  "#{' ' * level}#{line}"
44
90
  end
45
91
  end
46
92
 
47
- def fields_to_ruby
93
+ def fields_to_ruby(level)
48
94
  lines = fields.flat_map do |name, field|
49
- indent(field.fields_to_ruby(inflector), 2)
95
+ indent(*field.fields_to_ruby(inflector), level)
50
96
  end
51
97
 
52
- result = lines.join("\n")
53
- result << "\n" unless result.empty?
54
- result
98
+ lines << '' unless lines.empty?
99
+ lines
55
100
  end
56
101
 
57
- def validations
102
+ def fields_to_rbi(level)
58
103
  lines = fields.flat_map do |name, field|
59
- indent(field.validations(inflector), 2)
104
+ [
105
+ *indent(*field.fields_to_rbi(inflector), level),
106
+ ''
107
+ ]
60
108
  end
61
109
 
62
- result = lines.join("\n")
63
- result << "\n" unless result.empty?
64
- result
110
+ lines.pop if lines.last == ''
111
+ lines
65
112
  end
66
113
 
67
- def serialize_method
68
- ''.tap do |str|
69
- str << " def serialize\n"
70
- str << " {}.tap do |result|\n"
114
+ def validations(level)
115
+ lines = fields.flat_map do |name, field|
116
+ indent(*field.validations(inflector), level)
117
+ end
71
118
 
72
- fields.each do |name, field|
73
- str << " result[:#{quote_sym(name)}] = #{field.serialize_call(inflector)}\n"
74
- end
119
+ lines << '' unless lines.empty?
120
+ lines
121
+ end
122
+
123
+ def serialize_method(level)
124
+ lines = indent(
125
+ "def serialize",
126
+ " {}.tap do |result|",
127
+ *fields.map do |name, field|
128
+ " result[:#{quote_sym(name)}] = #{serialize_call_for(field)}"
129
+ end,
130
+ " end",
131
+ "end", level
132
+ )
133
+
134
+ lines << '' unless lines.empty?
135
+ lines
136
+ end
75
137
 
76
- str << " end\n"
77
- str << " end\n"
138
+ def serialize_call_for(field)
139
+ if handler = serialize_handlers.find { |h| h.matches?(ref, field.name) }
140
+ handler.handle(field, inflector)
141
+ else
142
+ field.serialize_call(inflector)
78
143
  end
79
144
  end
80
145