@sap/cds-dk 7.4.1 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/bin/activate.js +1 -1
  2. package/bin/add.js +6 -4
  3. package/bin/build.js +4 -6
  4. package/bin/cds.js +4 -1
  5. package/bin/deploy/index.js +5 -2
  6. package/bin/eval.js +1 -1
  7. package/bin/extend.js +3 -3
  8. package/bin/login.js +2 -2
  9. package/bin/logout.js +1 -1
  10. package/bin/pull.js +1 -1
  11. package/bin/push.js +2 -2
  12. package/bin/subscribe.js +2 -2
  13. package/bin/unsubscribe.js +2 -2
  14. package/bin/upgrade.js +2 -2
  15. package/bin/version.js +2 -2
  16. package/bin/watch.js +1 -1
  17. package/lib/bind/bindingUtil.js +2 -1
  18. package/lib/bind/cfKeyProvider.js +2 -2
  19. package/lib/bind/userCdsrcJsonStorageProvider.js +1 -1
  20. package/lib/build/buildPlugin.js +6 -12
  21. package/lib/build/buildTaskEngine.js +24 -19
  22. package/lib/build/buildTaskFactory.js +27 -33
  23. package/lib/build/buildTaskProvider.js +1 -1
  24. package/lib/build/buildTaskProviderFactory.js +26 -41
  25. package/lib/build/constants.js +0 -1
  26. package/lib/build/index.js +3 -3
  27. package/lib/build/plugins.js +15 -15
  28. package/lib/build/provider/edmxBuildPlugin.js +6 -7
  29. package/lib/build/provider/fiori/index.js +8 -8
  30. package/lib/build/provider/hana/2migration.js +12 -16
  31. package/lib/build/provider/hana/index.js +5 -7
  32. package/lib/build/provider/hana/template/package.json +1 -1
  33. package/lib/build/provider/internalBuildPlugin.js +0 -8
  34. package/lib/build/provider/internalBuildTaskProvider.js +17 -21
  35. package/lib/build/provider/java/index.js +2 -1
  36. package/lib/build/provider/mtx-extension/index.js +5 -4
  37. package/lib/build/provider/mtx-sidecar/index.js +2 -1
  38. package/lib/build/provider/nodejs/index.js +6 -5
  39. package/lib/compile/openapi/csdl2openapi.js +28 -14
  40. package/lib/compile/openapi/index.js +6 -6
  41. package/lib/deploy/to-hana/hana.js +2 -2
  42. package/lib/env/schema.js +2 -3
  43. package/lib/index.js +68 -28
  44. package/lib/init/add.js +17 -0
  45. package/lib/init/constants.js +5 -3
  46. package/lib/init/index.js +39 -25
  47. package/lib/init/{util/merge.js → merge.js} +32 -20
  48. package/lib/init/{util/mvn.js → mvn.js} +5 -5
  49. package/lib/init/plugin.js +85 -0
  50. package/lib/init/projectReader.js +145 -0
  51. package/lib/init/registries/mta.js +151 -0
  52. package/lib/init/template/{kibana → application-logging}/files/mta.yaml.hbs +3 -3
  53. package/lib/init/template/application-logging/index.js +49 -0
  54. package/lib/init/template/approuter/files/mta.yaml.hbs +11 -11
  55. package/lib/init/template/approuter/files/xs-app.json.hbs +2 -2
  56. package/lib/init/template/approuter/index.js +36 -81
  57. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -3
  58. package/lib/init/template/cf-manifest/files/services-manifest.yml.hbs +4 -4
  59. package/lib/init/template/cf-manifest/index.js +4 -4
  60. package/lib/init/template/connectivity/index.js +22 -35
  61. package/lib/init/template/data/index.js +3 -2
  62. package/lib/init/template/destination/files/values.yaml +9 -0
  63. package/lib/init/template/destination/index.js +15 -47
  64. package/lib/init/template/enterprise-messaging/index.js +26 -58
  65. package/lib/init/template/enterprise-messaging-shared/index.js +23 -39
  66. package/lib/init/template/extensibility/index.js +16 -30
  67. package/lib/init/template/file-based-messaging/index.js +7 -8
  68. package/lib/init/template/h2/index.js +4 -4
  69. package/lib/init/template/hana/files/mta.yaml.hbs +8 -8
  70. package/lib/init/template/hana/index.js +29 -115
  71. package/lib/init/template/helm/files/chart/templates/NOTES.txt +12 -0
  72. package/lib/init/template/helm/files/chart/templates/_deployment_helpers.tpl +82 -0
  73. package/lib/init/template/helm/files/chart/templates/_helpers.tpl +28 -0
  74. package/lib/init/template/helm/files/chart/values.root.schema.json +61 -0
  75. package/lib/init/template/helm/files/chart/values.schema.json +366 -0
  76. package/lib/init/template/helm/{subcharts → files}/web-application/Chart.yaml +1 -1
  77. package/lib/init/template/helm/{subcharts → files}/web-application/templates/_api.tpl +1 -1
  78. package/lib/init/template/helm/{subcharts → files}/web-application/values.yaml +1 -1
  79. package/lib/init/template/helm/index.js +84 -85
  80. package/lib/init/template/helm-unified-runtime/files/Chart.yaml.hbs +10 -0
  81. package/lib/init/template/helm-unified-runtime/files/values.yaml.hbs +26 -0
  82. package/lib/init/template/helm-unified-runtime/index.js +91 -0
  83. package/lib/init/template/helm-unified-runtime/lib/build.js +0 -0
  84. package/lib/init/template/helm-unified-runtime/package.json +4 -0
  85. package/lib/init/template/html5-repo/files/values.yaml.hbs +28 -0
  86. package/lib/init/template/html5-repo/index.js +23 -97
  87. package/lib/init/template/java/index.js +3 -3
  88. package/lib/init/template/lint/index.js +2 -2
  89. package/lib/init/template/liquibase/index.js +16 -0
  90. package/lib/init/template/local-messaging/index.js +7 -8
  91. package/lib/init/template/mta/index.js +7 -19
  92. package/lib/init/template/mtx/index.js +2 -2
  93. package/lib/init/template/multitenancy/index.js +38 -89
  94. package/lib/init/template/nodejs/index.js +5 -4
  95. package/lib/init/template/notebook/index.js +1 -1
  96. package/lib/init/template/notifications/index.js +16 -19
  97. package/lib/init/template/pipeline/index.js +1 -1
  98. package/lib/init/template/postgres/index.js +25 -31
  99. package/lib/init/template/redis-messaging/index.js +23 -27
  100. package/lib/init/template/sample/index.js +4 -4
  101. package/lib/init/template/samples/index.js +2 -2
  102. package/lib/init/template/sqlite/files/{package.json.hbs → package.json} +0 -2
  103. package/lib/init/template/sqlite/index.js +6 -10
  104. package/lib/init/template/tiny-sample/index.js +6 -6
  105. package/lib/init/template/toggles/index.js +7 -8
  106. package/lib/init/template/typer/index.js +6 -6
  107. package/lib/init/template/xsuaa/files/mta.yaml.hbs +3 -3
  108. package/lib/init/template/xsuaa/files/values.yaml.hbs +3 -3
  109. package/lib/init/template/xsuaa/index.js +27 -52
  110. package/lib/init/{util/template.js → template.js} +1 -1
  111. package/lib/{client → mtx}/activate.js +15 -11
  112. package/lib/{client → mtx}/auth_manager.js +5 -4
  113. package/lib/{client → mtx}/download_legacy.js +6 -4
  114. package/lib/{client → mtx}/extend.js +14 -9
  115. package/lib/{client → mtx}/index.js +1 -1
  116. package/lib/{client → mtx}/params.js +3 -1
  117. package/lib/{client → mtx}/pull.js +6 -4
  118. package/lib/{client → mtx}/push.js +10 -9
  119. package/lib/{client → mtx}/settings_manager.js +8 -6
  120. package/lib/{client → mtx}/tenant_action.js +9 -8
  121. package/lib/{client/helper/cf_helper.js → mtx/util/cf.js} +4 -3
  122. package/lib/{client/helper/dependency_helper.js → mtx/util/dependencies.js} +1 -0
  123. package/lib/mtx/util/errors.js +27 -0
  124. package/lib/mtx/util/legacy_ext.js +16 -0
  125. package/lib/{client/helper/url_helper.js → mtx/util/urls.js} +12 -1
  126. package/lib/util/axios.js +84 -0
  127. package/lib/util/fs.js +5 -1
  128. package/lib/util/write.js +1 -1
  129. package/npm-shrinkwrap.json +363 -157
  130. package/package.json +1 -1
  131. package/lib/client/base_command.js +0 -54
  132. package/lib/init/template/_merging/registry-mta.js +0 -304
  133. package/lib/init/template/helm/Model.d.ts +0 -53
  134. package/lib/init/template/kibana/files/package.json.hbs +0 -17
  135. package/lib/init/template/kibana/index.js +0 -54
  136. package/lib/init/template/templateBase.js +0 -100
  137. package/lib/init/util/md5.js +0 -86
  138. package/lib/init/util/projectReader.js +0 -94
  139. package/lib/util/pruneAxiosErrors.js +0 -39
  140. /package/lib/init/{util/indent.js → indent.js} +0 -0
  141. /package/lib/init/template/helm/{subcharts → files}/content-deployment/Chart.yaml +0 -0
  142. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/_helpers.tpl +0 -0
  143. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/job.yaml +0 -0
  144. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/secret.yaml +0 -0
  145. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-account.yaml +0 -0
  146. /package/lib/init/template/helm/{subcharts → files}/content-deployment/templates/service-binding.yaml +0 -0
  147. /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.schema.json +0 -0
  148. /package/lib/init/template/helm/{subcharts → files}/content-deployment/values.yaml +0 -0
  149. /package/lib/init/template/helm/{subcharts → files}/service-instance/Chart.yaml +0 -0
  150. /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/_helpers.tpl +0 -0
  151. /package/lib/init/template/helm/{subcharts → files}/service-instance/templates/serviceinstance.yaml +0 -0
  152. /package/lib/init/template/helm/{subcharts → files}/service-instance/values.schema.json +0 -0
  153. /package/lib/init/template/helm/{subcharts → files}/service-instance/values.yaml +0 -0
  154. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/NOTES.txt +0 -0
  155. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/_helpers.tpl +0 -0
  156. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/api-rule.yaml +0 -0
  157. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/deployment.yaml +0 -0
  158. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/network-policy.yaml +0 -0
  159. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/pod-disruption-budget.yaml +0 -0
  160. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/rbac.yaml +0 -0
  161. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/secret.yaml +0 -0
  162. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-account.yaml +0 -0
  163. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service-binding.yaml +0 -0
  164. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/service.yaml +0 -0
  165. /package/lib/init/template/helm/{subcharts → files}/web-application/templates/virtual-service.yaml +0 -0
  166. /package/lib/init/template/helm/{subcharts → files}/web-application/values.schema.json +0 -0
  167. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/NOTES.txt +0 -0
  168. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_deployment_helpers.tpl +0 -0
  169. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/templates/_helpers.tpl +0 -0
  170. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.root.schema.json +0 -0
  171. /package/lib/init/template/{helm/chart → helm-unified-runtime/files}/values.schema.json +0 -0
  172. /package/lib/init/template/postgres/files/{mta.yaml.hbs → mta.yml.hbs} +0 -0
  173. /package/lib/init/{util/xml.js → xml.js} +0 -0
  174. /package/lib/{client/helper/env_helper.js → mtx/util/env.js} +0 -0
  175. /package/lib/{client/helper/fs_helper.js → mtx/util/fs.js} +0 -0
  176. /package/lib/{client/helper → mtx/util}/logging.js +0 -0
  177. /package/lib/{client/helper → mtx/util}/question.js +0 -0
  178. /package/lib/{client/helper/string_helper.js → mtx/util/strings.js} +0 -0
  179. /package/lib/util/{cfUtil.js → cf.js} +0 -0
  180. /package/lib/util/{gitUtil.js → git.js} +0 -0
@@ -0,0 +1,366 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "type": "object",
4
+ "required": [
5
+ "global",
6
+ "srv"
7
+ ],
8
+ "properties": {
9
+ "global": {
10
+ "$id": "#/properties/global",
11
+ "title": "Helm global values",
12
+ "description": "For more information, see https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values",
13
+ "type": "object",
14
+ "required": [
15
+ "domain"
16
+ ],
17
+ "properties": {
18
+ "imagePullSecret": {
19
+ "$id": "#/properties/global/imagePullSecret",
20
+ "title": "Image Pull Secret configuration",
21
+ "description": "For more information, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/",
22
+ "additionalProperties": false,
23
+ "type": "object",
24
+ "properties": {
25
+ "name": {
26
+ "title": "Secret name",
27
+ "description": "Name of the Kubernetes Secret, used as an image pull secret (must be of type kubernetes.io/dockerconfigjson). Can't be used with the `dockerconfigjson` option.",
28
+ "$ref": "#/definitions/KubernetesName"
29
+ }
30
+ }
31
+ },
32
+ "domain": {
33
+ "$id": "#/properties/global/doamin",
34
+ "title": "Domain Name",
35
+ "description": "Full-qualified domain name used to access applications in your Kyma cluster",
36
+ "type": "string",
37
+ "pattern": "[0-9a-z][0-9a-z-.]*"
38
+ }
39
+ }
40
+ },
41
+ "srv": {
42
+ "$id": "#/properties/srv",
43
+ "description": "Deployment"
44
+ },
45
+ "hana-deployer": {
46
+ "$id": "#/properties/hana-deployer",
47
+ "description": "Content Deployment"
48
+ },
49
+ "html5-apps-deployer": {
50
+ "$id": "#/properties/html5-apps-deployer",
51
+ "description": "Content Deployment"
52
+ },
53
+ "approuter": {
54
+ "$id": "#/properties/approuter",
55
+ "description": "Deployment"
56
+ },
57
+ "event-mesh": {
58
+ "$id": "#/properties/event-mesh",
59
+ "description": "Service Instance"
60
+ },
61
+ "html5-apps-repo-host": {
62
+ "$id": "#/properties/html5-apps-repo-host",
63
+ "description": "Service Instance"
64
+ },
65
+ "xsuaa": {
66
+ "$id": "#/properties/xsuaa",
67
+ "description": "Service Instance"
68
+ },
69
+ "destination": {
70
+ "$id": "#/properties/destination",
71
+ "description": "Service Instance"
72
+ },
73
+ "hana": {
74
+ "$id": "#/properties/hana",
75
+ "description": "Service Instance"
76
+ },
77
+ "saas-registry": {
78
+ "$id": "#/properties/saas-registry",
79
+ "description": "Service Instance"
80
+ },
81
+ "service-manager": {
82
+ "$id": "#/properties/service-manager",
83
+ "description": "Service Instance"
84
+ },
85
+ "backendDestinations": {
86
+ "$id": "#/properties/backendDestinations",
87
+ "title": "Backend Destinations for Approuter or HTML5 Apps Deployer",
88
+ "type": "object",
89
+ "patternProperties": {
90
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
91
+ "description": "Name of the backend Destination",
92
+ "required": [
93
+ "service"
94
+ ],
95
+ "properties": {
96
+ "service": {
97
+ "type": "string",
98
+ "description": "Target Kubernetes service"
99
+ },
100
+ "path": {
101
+ "type": "string",
102
+ "description": "This path will be appended to the URL"
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "definitions": {
110
+ "KubernetesName": {
111
+ "type": "string",
112
+ "$comment": "running `kubectl create secret generic invalid_name` will print this regex",
113
+ "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
114
+ },
115
+ "ServiceInstance": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "serviceOfferingName",
120
+ "servicePlanName"
121
+ ],
122
+ "properties": {
123
+ "fullnameOverride": {
124
+ "type": "string",
125
+ "pattern": "[0-9a-z][0-9a-z-.]*",
126
+ "maxLength": 63,
127
+ "description": "If present then this will be used instead of the generated name"
128
+ },
129
+ "enabled": {
130
+ "type": "boolean",
131
+ "default": true,
132
+ "description": "Service instance will be created (default: true)"
133
+ },
134
+ "serviceOfferingName": {
135
+ "type": "string",
136
+ "description": "Technical service offering name from service catalog"
137
+ },
138
+ "servicePlanName": {
139
+ "type": "string",
140
+ "description": "Technical service plan name from service catalog"
141
+ },
142
+ "parameters": {
143
+ "type": "object",
144
+ "description": "Some services support the provisioning of additional configuration parameters during the instance creation. For the list of supported parameters, check the documentation of the particular service offering."
145
+ },
146
+ "config": {
147
+ "type": "string",
148
+ "description": "File name of JSON configuration file in chart folder. Values from the file will be copied and placed in the parameters for the service instance. If both parameters and config are specified, the values in parameters override those read from config."
149
+ }
150
+ }
151
+ },
152
+ "Image": {
153
+ "title": "Image configuration",
154
+ "type": "object",
155
+ "required": [
156
+ "repository"
157
+ ],
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "repository": {
161
+ "title": "Repository of the image",
162
+ "description": "Should also include the image name (i.e. everything before the `:` sign).",
163
+ "type": "string",
164
+ "pattern": "^[\\w-./:]*[@sha256]*$"
165
+ },
166
+ "tag": {
167
+ "title": "Image tag",
168
+ "description": "Image tag without the name (everything after the `:` sign, potentially including the `@sha256` section at the end).",
169
+ "type": "string",
170
+ "pattern": "^((?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?/)?[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?)(?::([\\w][\\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$"
171
+ }
172
+ }
173
+ },
174
+ "Bindings": {
175
+ "$id": "#/properties/bindings",
176
+ "title": "Service Binding configuration",
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "patternProperties": {
180
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
181
+ "anyOf": [
182
+ {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": [
186
+ "fromSecret"
187
+ ],
188
+ "properties": {
189
+ "fromSecret": {
190
+ "description": "Name of a Kubernetes Secret, with the binding content, compliant to the SAP Kubernetes Service Binding spec https://github.tools.sap/Kubernetes-Service-Bindings/doc/",
191
+ "$ref": "#/definitions/KubernetesName"
192
+ }
193
+ }
194
+ },
195
+ {
196
+ "type": "object",
197
+ "additionalProperties": false,
198
+ "properties": {
199
+ "serviceInstanceName": {
200
+ "description": "Name of a BTP Operator Service Instance, created by the `service-instance` Helm chart. Can't be used with the `serviceInstanceFullname` option.",
201
+ "$ref": "#/definitions/KubernetesName"
202
+ },
203
+ "serviceInstanceFullname": {
204
+ "description": "Full name of a BTP Operator Service Instance. Can't be used with the `serviceInstanceName` option.",
205
+ "$ref": "#/definitions/KubernetesName"
206
+ },
207
+ "externalName": {
208
+ "description": "The name for the service binding in SAP BTP",
209
+ "type": "string"
210
+ },
211
+ "secretName": {
212
+ "description": "The name of the secret where the credentials are stored.",
213
+ "$ref": "#/definitions/KubernetesName"
214
+ },
215
+ "parameters": {
216
+ "description": "Some services support the provisioning of additional configuration parameters during the bind request. For the list of supported parameters, check the documentation of the particular service offering.",
217
+ "type": "object"
218
+ },
219
+ "parametersFrom": {
220
+ "description": "List of sources to populate parameters.",
221
+ "type": "array",
222
+ "items": {
223
+ "anyOf": [
224
+ {
225
+ "type": "object",
226
+ "description": "Kubernetes Secret as a parameters source.",
227
+ "additionalProperties": false,
228
+ "properties": {
229
+ "secretKeyRef": {
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": [
233
+ "name",
234
+ "key"
235
+ ],
236
+ "properties": {
237
+ "name": {
238
+ "description": "Name of a Secret.",
239
+ "$ref": "#/definitions/KubernetesName"
240
+ },
241
+ "key": {
242
+ "description": "Key in that Secret, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
243
+ "type": "string"
244
+ }
245
+ }
246
+ }
247
+ }
248
+ },
249
+ {
250
+ "type": "object",
251
+ "description": "Kubernetes Config Map as a parameters source.",
252
+ "additionalProperties": false,
253
+ "properties": {
254
+ "configMapKeyRef": {
255
+ "type": "object",
256
+ "additionalProperties": false,
257
+ "required": [
258
+ "name",
259
+ "key"
260
+ ],
261
+ "properties": {
262
+ "name": {
263
+ "description": "Name of a Config Map",
264
+ "$ref": "#/definitions/KubernetesName"
265
+ },
266
+ "key": {
267
+ "description": "Key in that Config Map, which contains a string that represents the json to include in the set of parameters to be sent to the broker.",
268
+ "type": "string"
269
+ }
270
+ }
271
+ }
272
+ }
273
+ }
274
+ ]
275
+ }
276
+ },
277
+ "credentialsRotationPolicy": {
278
+ "description": "Holds automatic credentials rotation configuration. For more details, see https://github.com/SAP/sap-btp-service-operator#spec-1",
279
+ "type": "object"
280
+ }
281
+ },
282
+ "dependencies": {
283
+ "serviceInstanceName": {
284
+ "not": {
285
+ "required": [
286
+ "serviceInstanceFullname"
287
+ ]
288
+ }
289
+ },
290
+ "serviceInstanceFullname": {
291
+ "not": {
292
+ "required": [
293
+ "serviceInstanceName"
294
+ ]
295
+ }
296
+ }
297
+ }
298
+ }
299
+ ]
300
+ }
301
+ }
302
+ },
303
+ "Resources": {
304
+ "title": "Pod resources configuration",
305
+ "type": "object",
306
+ "additionalProperties": false,
307
+ "required": [
308
+ "requests",
309
+ "limits"
310
+ ],
311
+ "properties": {
312
+ "requests": {
313
+ "type": "object",
314
+ "description": "Minimal required resources for the application to operate, that will be reserved.",
315
+ "additionalProperties": false,
316
+ "required": [
317
+ "cpu",
318
+ "memory"
319
+ ],
320
+ "properties": {
321
+ "cpu": {
322
+ "description": "CPU resource units, as described here https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu",
323
+ "type": [
324
+ "string",
325
+ "number"
326
+ ]
327
+ },
328
+ "ephemeral-storage": {
329
+ "description": "Size of the local ephemeral storage, measured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage",
330
+ "type": "string"
331
+ },
332
+ "memory": {
333
+ "description": "Amount of memory, mesaured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory",
334
+ "type": "string"
335
+ }
336
+ }
337
+ },
338
+ "limits": {
339
+ "type": "object",
340
+ "description": "If a process tries to use more resources than specified in the limits, the system kernel terminates the process that attempted the allocation, with an out of memory (OOM) error.",
341
+ "additionalProperties": false,
342
+ "required": [
343
+ "memory"
344
+ ],
345
+ "properties": {
346
+ "cpu": {
347
+ "description": "CPU resource units, as described here https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu",
348
+ "type": [
349
+ "string",
350
+ "number"
351
+ ]
352
+ },
353
+ "ephemeral-storage": {
354
+ "description": "Size of the local ephemeral storage, measured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage",
355
+ "type": "string"
356
+ },
357
+ "memory": {
358
+ "description": "Amount of memory, mesaured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory",
359
+ "type": "string"
360
+ }
361
+ }
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
@@ -5,4 +5,4 @@ name: web-application
5
5
  sources:
6
6
  - https://github.tools.sap/unified-runtime/web-application
7
7
  type: application
8
- version: 1.8.0
8
+ version: 1.9.0
@@ -52,7 +52,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
52
52
  app.kubernetes.io/component:{{ .Values.global.component }}
53
53
  {{- end }}
54
54
  {{- if .Values.global.partOf }}
55
- app.kubernetes.io/partOf: {{ .Values.global.partOf }}
55
+ app.kubernetes.io/part-of: {{ .Values.global.partOf }}
56
56
  {{- end }}
57
57
  {{- end }}
58
58
  {{- end }}
@@ -15,7 +15,7 @@ global:
15
15
  _internal:
16
16
  web-application:
17
17
  versions:
18
- 1.8.0: true
18
+ 1.9.0: true
19
19
  ## Will be used instead of the `.Chart.Name`, e.g. when generating the Deployment name.
20
20
  # nameOverride: name
21
21
 
@@ -1,28 +1,10 @@
1
1
  const { join } = require('path');
2
2
  const cds = require('../../../cds')
3
- const { exists, rimraf } = cds.utils
4
- const { readProject } = require('../../util/projectReader');
5
- const { mergeYAML } = require('../../util/merge')
6
- const { parseMd5File, writeMd5File, copyAndTrack } = require('../../util/md5')
3
+ const { exists, rimraf, copy } = cds.utils
4
+ const { readProject } = require('../../projectReader');
5
+ const { merge } = require('../../merge')
7
6
 
8
- module.exports = class HelmTemplate extends require('../templateBase') {
9
-
10
- constructor(oldTrackingData = undefined, newTrackingData = {}) {
11
- super()
12
- this.oldTrackingData = oldTrackingData;
13
- this.newTrackingData = newTrackingData;
14
- }
15
-
16
- getRelatedFacets() {
17
- return ['hana', 'xsuaa', 'enterprise-messaging', 'enterprise-messaging-shared', 'destination' , 'multitenancy', 'extensibility', 'approuter', 'connectivity']
18
- }
19
-
20
- static hasFacet() {
21
- // REVISIT: this works, but could be semantically nicer with a 'shouldRunDependentMerging' or the like
22
- const { add } = cds.cli.options
23
- if (add.has('mta') && !add.has('helm')) return false
24
- return exists(join('chart', 'values.yaml'))
25
- }
7
+ module.exports = class HelmTemplate extends require('../../plugin') {
26
8
 
27
9
  async canRun() {
28
10
  if (cds.cli.options.force) {
@@ -32,76 +14,93 @@ module.exports = class HelmTemplate extends require('../templateBase') {
32
14
  return true
33
15
  }
34
16
 
35
- async addSubChart(subchart, force = false) {
36
- const subchartPath = join('chart', 'charts', subchart);
37
- const isInternal = !force && await this.isInternal();
38
- if(!exists(subchartPath) && !isInternal) {
39
- await copyAndTrack(
40
- join(__dirname, 'subcharts', subchart),
41
- subchartPath,
42
- this
43
- )
44
-
45
- return true;
46
- }
47
-
48
- return false;
17
+ static hasInProduction() {
18
+ const { add } = cds.cli.options
19
+ return exists(join('chart', 'charts', 'web-application')) && exists(join('chart', 'values.yaml') || add.has('helm'))
49
20
  }
50
21
 
51
- async isInternal() {
52
- return !exists(join('chart', 'charts', 'web-application')) || cds.cli.options['internal-unified-runtime-charts'];
53
- }
22
+ async run() {
23
+ const project = readProject()
24
+ await copy(join(__dirname, 'files', 'chart')).to('chart')
25
+ await merge(__dirname, 'files/Chart.yaml.hbs').into('chart/Chart.yaml', { with: project })
26
+ await merge(__dirname, 'files/values.yaml.hbs').into('chart/values.yaml', { with: project })
27
+ await this._mergeDependency('web-application', 'srv')
54
28
 
55
- async addDependency(name, alias){
56
- const project = await readProject();
57
- const isInternal = await this.isInternal();
58
- await mergeYAML(
59
- join('chart', 'Chart.yaml'),
60
- {
61
- dependencies: [
62
- {
63
- name,
64
- alias,
65
- version: '>0.0.0',
66
- ...(isInternal) && { repository: 'https://int.repositories.cloud.sap/artifactory/virtual-unified-runtime-helm-dmz' }
67
- }
68
- ]
69
- },
70
- project,
71
- { additions: [{
72
- in: `dependencies`,
73
- where: [{
74
- property: 'alias',
75
- isEqualTo: alias
76
- }]
77
- }]}
78
- )
29
+ await copy(join(__dirname, 'files', 'web-application')).to('chart/charts/web-application')
79
30
  }
80
31
 
81
- async run() {
82
- const project = await readProject()
83
- const isInternal = cds.cli.options['internal-unified-runtime-charts'] !== undefined && cds.cli.options['internal-unified-runtime-charts'];
84
- this.oldTrackingData = await parseMd5File(join('chart', '.cds-add-helm-files.md5'));
85
- await this.addSubChart('web-application', !isInternal);
86
- await copyAndTrack(
87
- join(__dirname, 'chart'),
88
- join('chart'),
89
- this
90
- )
32
+ async combine() {
33
+ const { hasDestination, hasEnterpriseMessaging, hasHana, hasMultitenancy, hasXsuaa, hasHtml5Repo, hasApprouter } = readProject()
34
+ let hasContentDeployment = false
91
35
 
92
- await mergeYAML(
93
- join('chart', 'Chart.yaml'),
94
- join(__dirname, 'files', 'Chart.yaml.hbs'),
95
- project
96
- )
36
+ if (!exists('chart/charts/service-instance') && (hasHtml5Repo || hasMultitenancy || hasDestination || hasEnterpriseMessaging || hasXsuaa || hasHana)) {
37
+ await copy(join(__dirname, 'files', 'service-instance')).to('chart/charts/service-instance')
38
+ }
39
+ if (hasApprouter) {
40
+ await this._mergeDependency('web-application', 'approuter')
41
+ }
97
42
 
98
- await this.addDependency('web-application', 'srv');
43
+ if (hasHtml5Repo) {
44
+ hasContentDeployment = true
45
+ await this._mergeDependency('service-instance', 'html5-apps-repo-host')
46
+ await this._mergeDependency('content-deployment', 'html5-apps-deployer')
99
47
 
100
- await mergeYAML(
101
- join('chart', 'values.yaml'),
102
- join(__dirname, 'files', 'values.yaml.hbs'),
103
- project
104
- )
105
- await writeMd5File(join('chart', '.cds-add-helm-files.md5'), this.newTrackingData);
48
+ if (hasApprouter) {
49
+ await this._mergeDependency('service-instance', 'html5-apps-repo-runtime')
50
+ await merge({
51
+ 'html5-apps-repo-runtime': {
52
+ serviceOfferingName: 'html5-apps-repo',
53
+ servicePlanName: 'app-runtime'
54
+ },
55
+ approuter: {
56
+ bindings: {
57
+ 'html5-apps-repo-runtime': { serviceInstanceName: 'html5-apps-repo-runtime' }
58
+ }
59
+ },
60
+ }).into('chart/values.yaml')
61
+ }
62
+ }
63
+ if (hasMultitenancy) {
64
+ await this._mergeDependency('web-application', 'sidecar')
65
+ await this._mergeDependency('service-instance', 'saas-registry')
66
+ }
67
+ if (hasDestination) {
68
+ await this._mergeDependency('service-instance', 'destination')
69
+ }
70
+ if (hasEnterpriseMessaging) {
71
+ await this._mergeDependency('service-instance', 'event-mesh')
72
+ }
73
+ if (hasXsuaa) {
74
+ await this._mergeDependency('service-instance', 'xsuaa')
75
+ }
76
+ if (hasHana) {
77
+ if (hasMultitenancy) {
78
+ await this._mergeDependency('service-instance', 'service-manager')
79
+ } else {
80
+ hasContentDeployment = true
81
+ await this._mergeDependency('service-instance', 'hana')
82
+ await this._mergeDependency('content-deployment', 'hana-deployer')
83
+ }
84
+ }
85
+ if(!exists('chart/charts/content-deployment') && hasContentDeployment) {
86
+ await copy(join(__dirname, 'files', 'content-deployment')).to('chart/charts/content-deployment')
87
+ }
88
+ }
89
+
90
+ async _mergeDependency(name, alias) {
91
+ const project = readProject()
92
+ await merge({
93
+ dependencies: [{
94
+ name,
95
+ alias,
96
+ version: '>0.0.0'
97
+ }]
98
+ }).into('chart/Chart.yaml', {
99
+ project,
100
+ additions: [{
101
+ in: 'dependencies',
102
+ where: { alias }
103
+ }]
104
+ })
106
105
  }
107
106
  }
@@ -0,0 +1,10 @@
1
+ ---
2
+ #
3
+ # This file is generated by "cds add helm"
4
+ apiVersion: v2
5
+ name: {{appName}}
6
+ description: {{appDescription}}
7
+ type: application
8
+ version: {{appVersion}}
9
+ appVersion: {{appVersion}}
10
+
@@ -0,0 +1,26 @@
1
+ ---
2
+ global:
3
+ domain: null
4
+ imagePullSecret: {}
5
+ srv:
6
+ bindings: {}
7
+ image:
8
+ repository: <your-container-registry>/{{appName}}-srv
9
+ tag: latest
10
+ {{#isJava}}
11
+ env:
12
+ SPRING_PROFILES_ACTIVE: cloud
13
+ {{/isJava}}
14
+ resources:
15
+ limits:
16
+ ephemeral-storage: 1G
17
+ memory: {{#isJava}}1G{{/isJava}}{{^isJava}}500M{{/isJava}}
18
+ requests:
19
+ ephemeral-storage: 1G
20
+ cpu: {{#isJava}}1000m{{/isJava}}{{^isJava}}500m{{/isJava}}
21
+ memory: {{#isJava}}1G{{/isJava}}{{^isJava}}500M{{/isJava}}
22
+ health:
23
+ liveness:
24
+ path: /
25
+ readiness:
26
+ path: /