@sap/cds-dk 6.0.3 → 6.1.2

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 (105) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/bin/add.js +29 -16
  3. package/bin/compile/index.js +7 -2
  4. package/bin/fix-redirects.js +4 -2
  5. package/bin/init.js +5 -0
  6. package/bin/login.js +20 -4
  7. package/bin/pull.js +58 -0
  8. package/bin/push.js +52 -0
  9. package/bin/subscribe.js +45 -0
  10. package/lib/bind/bindingUtil.js +1 -2
  11. package/lib/bind/cfKeyProvider.js +3 -3
  12. package/lib/cds.js +2 -3
  13. package/lib/client/activate.js +17 -16
  14. package/lib/client/auth_manager.js +10 -5
  15. package/lib/client/base_command.js +4 -6
  16. package/lib/client/extend.js +3 -2
  17. package/lib/client/helper/cf_helper.js +1 -0
  18. package/lib/client/helper/errors.js +11 -0
  19. package/lib/client/helper/logging.js +3 -10
  20. package/lib/client/helper/url_helper.js +7 -3
  21. package/lib/client/index.js +1 -1
  22. package/lib/client/params.js +9 -6
  23. package/lib/client/pull.js +48 -0
  24. package/lib/client/push.js +45 -0
  25. package/lib/client/settings_manager.js +81 -27
  26. package/lib/compile/openapi/csdl2openapi.js +135 -163
  27. package/lib/compile/openapi/index.js +0 -1
  28. package/lib/import/common.js +9 -1
  29. package/lib/import/odata/metadataconverter/MetadataConverter.js +17 -4
  30. package/lib/import/odata/v2parser.js +50 -26
  31. package/lib/import/odata/v4parser.js +110 -29
  32. package/lib/import/openapi/importOpenAPI.js +3 -3
  33. package/lib/init/constants.js +9 -3
  34. package/lib/init/template/_merging/registry-mta.js +284 -0
  35. package/lib/init/template/approuter/files/xs-app.json.hbs +7 -7
  36. package/lib/init/template/approuter/index.js +22 -32
  37. package/lib/init/template/auditlog/index.js +7 -9
  38. package/lib/init/template/data/index.js +2 -4
  39. package/lib/init/template/extensibility/files/cds.package.json +7 -0
  40. package/lib/init/template/extensibility/files/cds.package.json.hbs +9 -0
  41. package/lib/init/template/extensibility/files/xs-security.json.hbs +26 -0
  42. package/lib/init/template/extensibility/index.js +48 -0
  43. package/lib/init/template/hana/files/java/cdsrc.json.hbs +1 -1
  44. package/lib/init/template/hana/files/java/profile.cdsrc.json.hbs +2 -2
  45. package/lib/init/template/hana/files/mta.yaml.hbs +10 -0
  46. package/lib/init/template/hana/files/nodejs/cds.package.json.hbs +1 -1
  47. package/lib/init/template/hana/files/nodejs/cds.profile.package.json.hbs +2 -2
  48. package/lib/init/template/hana/index.js +76 -63
  49. package/lib/init/template/kibana-logging/index.js +31 -37
  50. package/lib/init/template/lint/files/.eslint/rules/no-entity-moo.js +14 -14
  51. package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
  52. package/lib/init/template/mta/index.js +13 -7
  53. package/lib/init/template/mtx/index.js +2 -142
  54. package/lib/init/template/multitenancy/files/cds.package.json +7 -0
  55. package/lib/init/template/multitenancy/files/cds.package.json.hbs +9 -0
  56. package/lib/init/template/{mtx → multitenancy}/files/dependencies.package.json +1 -1
  57. package/lib/init/template/multitenancy/files/java/.cdsrc.json +19 -0
  58. package/lib/init/template/multitenancy/files/java/package.json +31 -0
  59. package/lib/init/template/{mtx → multitenancy}/files/mta.yaml.hbs +13 -6
  60. package/lib/init/template/multitenancy/files/xs-security.json.hbs +18 -0
  61. package/lib/init/template/multitenancy/index.js +109 -0
  62. package/lib/init/template/nodejs/files/package.json.hbs +3 -0
  63. package/lib/init/template/templateBase.js +2 -1
  64. package/lib/init/template/toggles/files/cds.package.json +7 -0
  65. package/lib/init/template/toggles/files/cds.package.json.hbs +9 -0
  66. package/lib/init/template/toggles/index.js +24 -0
  67. package/lib/init/template/xsuaa/files/mta.yaml.hbs +10 -0
  68. package/lib/init/template/xsuaa/index.js +44 -33
  69. package/lib/init/util/projectReader.js +12 -7
  70. package/lib/init/util/templateUtil.js +113 -111
  71. package/lib/k8s/ChartAdder.js +13 -3
  72. package/lib/k8s/ChartBuilder.js +6 -0
  73. package/lib/k8s/buildModel.js +1 -3
  74. package/lib/k8s/connectivity/index.js +5 -5
  75. package/lib/k8s/deployment/index.js +2 -4
  76. package/lib/k8s/deployment/subchart/Chart.yaml +1 -1
  77. package/lib/k8s/deployment/subchart/templates/_helpers.tpl +22 -11
  78. package/lib/k8s/deployment/subchart/templates/deployment.yaml +12 -5
  79. package/lib/k8s/deployment/subchart/templates/network-policy.yaml +3 -1
  80. package/lib/k8s/deployment/subchart/templates/pod-disruption-budget.yaml +1 -1
  81. package/lib/k8s/deployment/subchart/values.md +812 -0
  82. package/lib/k8s/deployment/subchart/values.schema.json +125 -30
  83. package/lib/k8s/deployment/subchart/values.yaml +7 -3
  84. package/lib/k8s/hana-deployer/index.js +10 -0
  85. package/lib/k8s/hana-deployer/templates/hana-deployer-job.yaml +8 -0
  86. package/lib/k8s/html5-apps-deployer/index.js +10 -0
  87. package/lib/k8s/html5-apps-deployer/templates/html5-apps-deployer-job.yaml +8 -0
  88. package/lib/k8s/index.js +2 -2
  89. package/lib/k8s/resources/helm/chart/schemas/values.root.schema.json +11 -0
  90. package/lib/k8s/resources/helm/chart/schemas/values.schema.json +479 -0
  91. package/lib/k8s/resources/helm/chart/templates/_deployment_helpers.tpl +1 -159
  92. package/lib/k8s/resources/helm/chart/templates/_helpers.tpl +0 -33
  93. package/lib/k8s/resources/helm/chart/templates/_sapcp_helpers.tpl +1 -1
  94. package/lib/lint/Linter.js +155 -158
  95. package/lib/lint/io.js +12 -5
  96. package/npm-shrinkwrap.json +1052 -135
  97. package/package.json +5 -4
  98. package/lib/init/template/_merging/existences.js +0 -297
  99. package/lib/init/template/mtx/files/cds.package.json +0 -12
  100. package/lib/init/template/mtx/files/cds.package.json.hbs +0 -14
  101. package/lib/init/template/mtx/files/java/.cdsrc.json +0 -17
  102. package/lib/init/template/mtx/files/java/package.json +0 -43
  103. package/lib/init/template/mtx/files/java/server.js +0 -30
  104. package/lib/init/template/mtx/files/xs-security.json.hbs +0 -48
  105. package/lib/lint/.eslintrc.js +0 -3
@@ -0,0 +1,479 @@
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
+ "auditlog": {
46
+ "$id": "#/properties/auditlog",
47
+ "$ref": "#/definitions/ServiceInstance"
48
+ },
49
+ "destinations": {
50
+ "$id": "#/properties/destinations",
51
+ "$ref": "#/definitions/ServiceInstance"
52
+ },
53
+ "connectivity": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": [
57
+ "serviceOfferingName",
58
+ "servicePlanName",
59
+ "configMapName",
60
+ "secretName"
61
+ ],
62
+ "properties": {
63
+ "fullnameOverride": {
64
+ "type": "string",
65
+ "pattern": "[0-9a-z][0-9a-z-.]*",
66
+ "maxLength": 63,
67
+ "description": "If present then this will be used instead of the generated name"
68
+ },
69
+ "enabled": {
70
+ "type": "boolean",
71
+ "default": true,
72
+ "description": "Service instance will be created (default: true)"
73
+ },
74
+ "serviceOfferingName": {
75
+ "type": "string",
76
+ "default": "connectivity",
77
+ "description": "Technical service offering name from service catalog"
78
+ },
79
+ "servicePlanName": {
80
+ "type": "string",
81
+ "default": "connectivity_proxy",
82
+ "description": "Technical service plan name from service catalog"
83
+ },
84
+ "parameters": {
85
+ "type": "object",
86
+ "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."
87
+ },
88
+ "config": {
89
+ "type": "string",
90
+ "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."
91
+ },
92
+ "configMapName": {
93
+ "type": "string",
94
+ "description": "Required to add additional connection information, compared to what is available from the service binding."
95
+ },
96
+ "secretName": {
97
+ "type": "string",
98
+ "description": "Required to add additional connection information."
99
+ }
100
+ }
101
+ },
102
+ "event_mesh": {
103
+ "$id": "#/properties/event_mesh",
104
+ "$ref": "#/definitions/ServiceInstance"
105
+ },
106
+ "hana_deployer": {
107
+ "$id": "#/properties/hana_deployer",
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": [
111
+ "image",
112
+ "bindings",
113
+ "resources"
114
+ ],
115
+ "properties": {
116
+ "image": {
117
+ "$id": "#/properties/hana_deployer/image",
118
+ "$ref": "#/definitions/Image"
119
+ },
120
+ "bindings": {
121
+ "$id": "#/properties/hana_deployer/bindings",
122
+ "$ref": "#/definitions/Bindings"
123
+ },
124
+ "resources": {
125
+ "$id": "#/properties/hana_deployer/resources",
126
+ "$ref": "#/definitions/Resources"
127
+ },
128
+ "env": {
129
+ "$id": "#/properties/hana_deployer/env",
130
+ "description": "Key-value map of environment variables, which should be added to the Pod spec.",
131
+ "type": "object",
132
+ "patternProperties": {
133
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
134
+ "$comment": "regex above copied from https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L402",
135
+ "not": {
136
+ "type": ["null", "object", "array"]
137
+ }
138
+ }
139
+ },
140
+ "additionalProperties": false,
141
+ "default": {}
142
+ }
143
+ }
144
+ },
145
+ "html5_apps_deployer": {
146
+ "$id": "#/properties/html5_apps_deployer",
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": [
150
+ "image",
151
+ "bindings",
152
+ "resources",
153
+ "cloudService"
154
+ ],
155
+ "properties": {
156
+ "image": {
157
+ "$id": "#/properties/html5_apps_deployer/image",
158
+ "$ref": "#/definitions/Image"
159
+ },
160
+ "bindings": {
161
+ "$id": "#/properties/html5_apps_deployer/bindings",
162
+ "$ref": "#/definitions/Bindings"
163
+ },
164
+ "resources": {
165
+ "$id": "#/properties/html5_apps_deployer/resources",
166
+ "$ref": "#/definitions/Resources"
167
+ },
168
+ "env": {
169
+ "$id": "#/properties/html5_apps_deployer/env",
170
+ "description": "Key-value map of environment variables, which should be added to the Pod spec.",
171
+ "type": "object",
172
+ "patternProperties": {
173
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
174
+ "$comment": "regex above copied from https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L402",
175
+ "not": {
176
+ "type": ["null", "object", "array"]
177
+ }
178
+ }
179
+ },
180
+ "additionalProperties": false,
181
+ "default": {}
182
+ },
183
+ "backendDestinations": {
184
+ "$id": "#/properties/html5_apps_deployer/backendDestinations",
185
+ "title": "Backend Destinations for HTML5 Application",
186
+ "type": "object",
187
+ "patternProperties": {
188
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
189
+ "description": "Name of the backend Destination",
190
+ "required": [
191
+ "service"
192
+ ],
193
+ "properties": {
194
+ "service": {
195
+ "type": "string",
196
+ "description": "Target Kubernetes service"
197
+ },
198
+ "path": {
199
+ "type": "string",
200
+ "description": "This path will be appended to the URL"
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "cloudService": {
207
+ "$id": "#/properties/html5_apps_deployer/cloudService",
208
+ "type": "string",
209
+ "description": "Name for your business service (unique per subaccount)"
210
+ }
211
+ }
212
+ },
213
+ "html5_apps_repo_host": {
214
+ "$id": "#/properties/html5_apps_repo_host",
215
+ "$ref": "#/definitions/ServiceInstance"
216
+ },
217
+ "xsuaa": {
218
+ "$id": "#/properties/xsuaa",
219
+ "$ref": "#/definitions/ServiceInstance"
220
+ }
221
+ },
222
+ "definitions": {
223
+ "KubernetesName": {
224
+ "type": "string",
225
+ "$comment": "running `kubectl create secret generic invalid_name` will print this regex",
226
+ "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
227
+ },
228
+ "ServiceInstance": {
229
+ "type": "object",
230
+ "additionalProperties": false,
231
+ "required": [
232
+ "serviceOfferingName",
233
+ "servicePlanName"
234
+ ],
235
+ "properties": {
236
+ "fullnameOverride": {
237
+ "type": "string",
238
+ "pattern": "[0-9a-z][0-9a-z-.]*",
239
+ "maxLength": 63,
240
+ "description": "If present then this will be used instead of the generated name"
241
+ },
242
+ "enabled": {
243
+ "type": "boolean",
244
+ "default": true,
245
+ "description": "Service instance will be created (default: true)"
246
+ },
247
+ "serviceOfferingName": {
248
+ "type": "string",
249
+ "description": "Technical service offering name from service catalog"
250
+ },
251
+ "servicePlanName": {
252
+ "type": "string",
253
+ "description": "Technical service plan name from service catalog"
254
+ },
255
+ "parameters": {
256
+ "type": "object",
257
+ "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."
258
+ },
259
+ "config": {
260
+ "type": "string",
261
+ "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."
262
+ }
263
+ }
264
+ },
265
+ "Image": {
266
+ "title": "Image configuration",
267
+ "type": "object",
268
+ "required": [
269
+ "repository"
270
+ ],
271
+ "additionalProperties": false,
272
+ "properties": {
273
+ "repository": {
274
+ "title": "Repository of the image",
275
+ "description": "Should also include the image name (i.e. everything before the `:` sign).",
276
+ "type": "string",
277
+ "pattern": "^[\\w-./:]*[@sha256]*$"
278
+ },
279
+ "tag": {
280
+ "title": "Image tag",
281
+ "description": "Image tag without the name (everything after the `:` sign, potentially including the `@sha256` section at the end).",
282
+ "type": "string",
283
+ "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,}))?$"
284
+ }
285
+ }
286
+ },
287
+ "Bindings": {
288
+ "$id": "#/properties/bindings",
289
+ "title": "Service Binding configuration",
290
+ "type": "object",
291
+ "additionalProperties": false,
292
+ "patternProperties": {
293
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
294
+ "anyOf": [
295
+ {
296
+ "type": "object",
297
+ "additionalProperties": false,
298
+ "required": [
299
+ "fromSecret"
300
+ ],
301
+ "properties": {
302
+ "fromSecret": {
303
+ "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/",
304
+ "$ref": "#/definitions/KubernetesName"
305
+ }
306
+ }
307
+ },
308
+ {
309
+ "type": "object",
310
+ "additionalProperties": false,
311
+ "properties": {
312
+ "serviceInstanceName": {
313
+ "description": "Name of a BTP Operator Service Instance, created by the `service-instance` Helm chart. Can't be used with the `serviceInstanceFullname` option.",
314
+ "$ref": "#/definitions/KubernetesName"
315
+ },
316
+ "serviceInstanceFullname": {
317
+ "description": "Full name of a BTP Operator Service Instance. Can't be used with the `serviceInstanceName` option.",
318
+ "$ref": "#/definitions/KubernetesName"
319
+ },
320
+ "externalName": {
321
+ "description": "The name for the service binding in SAP BTP",
322
+ "type": "string"
323
+ },
324
+ "secretName": {
325
+ "description": "The name of the secret where the credentials are stored.",
326
+ "$ref": "#/definitions/KubernetesName"
327
+ },
328
+ "parameters": {
329
+ "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.",
330
+ "type": "object"
331
+ },
332
+ "parametersFrom": {
333
+ "description": "List of sources to populate parameters.",
334
+ "type": "array",
335
+ "items": {
336
+ "anyOf": [
337
+ {
338
+ "type": "object",
339
+ "description": "Kubernetes Secret as a parameters source.",
340
+ "additionalProperties": false,
341
+ "properties": {
342
+ "secretKeyRef": {
343
+ "type": "object",
344
+ "additionalProperties": false,
345
+ "required": [
346
+ "name",
347
+ "key"
348
+ ],
349
+ "properties": {
350
+ "name": {
351
+ "description": "Name of a Secret.",
352
+ "$ref": "#/definitions/KubernetesName"
353
+ },
354
+ "key": {
355
+ "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.",
356
+ "type": "string"
357
+ }
358
+ }
359
+ }
360
+ }
361
+ },
362
+ {
363
+ "type": "object",
364
+ "description": "Kubernetes Config Map as a parameters source.",
365
+ "additionalProperties": false,
366
+ "properties": {
367
+ "configMapKeyRef": {
368
+ "type": "object",
369
+ "additionalProperties": false,
370
+ "required": [
371
+ "name",
372
+ "key"
373
+ ],
374
+ "properties": {
375
+ "name": {
376
+ "description": "Name of a Config Map",
377
+ "$ref": "#/definitions/KubernetesName"
378
+ },
379
+ "key": {
380
+ "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.",
381
+ "type": "string"
382
+ }
383
+ }
384
+ }
385
+ }
386
+ }
387
+ ]
388
+ }
389
+ },
390
+ "credentialsRotationPolicy": {
391
+ "description": "Holds automatic credentials rotation configuration. For more details, see https://github.com/SAP/sap-btp-service-operator#spec-1",
392
+ "type": "object"
393
+ }
394
+ },
395
+ "dependencies": {
396
+ "serviceInstanceName": {
397
+ "not": {
398
+ "required": [
399
+ "serviceInstanceFullname"
400
+ ]
401
+ }
402
+ },
403
+ "serviceInstanceFullname": {
404
+ "not": {
405
+ "required": [
406
+ "serviceInstanceName"
407
+ ]
408
+ }
409
+ }
410
+ }
411
+ }
412
+ ]
413
+ }
414
+ }
415
+ },
416
+ "Resources": {
417
+ "title": "Pod resources configuration",
418
+ "type": "object",
419
+ "additionalProperties": false,
420
+ "required": [
421
+ "requests",
422
+ "limits"
423
+ ],
424
+ "properties": {
425
+ "requests": {
426
+ "type": "object",
427
+ "description": "Minimal required resources for the application to operate, that will be reserved.",
428
+ "additionalProperties": false,
429
+ "required": [
430
+ "cpu",
431
+ "memory"
432
+ ],
433
+ "properties": {
434
+ "cpu": {
435
+ "description": "CPU resource units, as described here https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu",
436
+ "type": [
437
+ "string",
438
+ "number"
439
+ ]
440
+ },
441
+ "ephemeral-storage": {
442
+ "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",
443
+ "type": "string"
444
+ },
445
+ "memory": {
446
+ "description": "Amount of memory, mesaured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory",
447
+ "type": "string"
448
+ }
449
+ }
450
+ },
451
+ "limits": {
452
+ "type": "object",
453
+ "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.",
454
+ "additionalProperties": false,
455
+ "required": [
456
+ "memory"
457
+ ],
458
+ "properties": {
459
+ "cpu": {
460
+ "description": "CPU resource units, as described here https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu",
461
+ "type": [
462
+ "string",
463
+ "number"
464
+ ]
465
+ },
466
+ "ephemeral-storage": {
467
+ "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",
468
+ "type": "string"
469
+ },
470
+ "memory": {
471
+ "description": "Amount of memory, mesaured in bytes. For more info, see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory",
472
+ "type": "string"
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
@@ -1,14 +1,5 @@
1
1
  {{/*
2
- Generate VCAP_APPLICATION
3
- */}}
4
- {{- define "cap.vcapApplication" -}}
5
- {{- $deploymentHost := include "cap.deploymentHost" . -}}
6
- {{- $VCAP_APPLICATION := dict "application_uris" (list (print $deploymentHost "." .Values.global.domain)) }}
7
- {{- $VCAP_APPLICATION | toJson }}
8
- {{- end -}}
9
-
10
- {{/*
11
- Add custom env variables
2
+ Add custom env variables
12
3
  */}}
13
4
  {{- define "cap.env" -}}
14
5
  {{- if . -}}
@@ -19,155 +10,6 @@ Add custom env variables
19
10
  {{- end -}}
20
11
  {{- end -}}
21
12
 
22
- {{- define "cap.bindingsVolumes" -}}
23
- {{- if $.Values.newBindings -}}
24
- {{- include "cap.newBindingsVolumes" $ }}
25
- {{- else -}}
26
- {{- include "cap.oldBindingsVolumes" $ }}
27
- {{- end -}}
28
- {{- end -}}
29
-
30
- {{/*
31
- Old Service Bindings: volumes
32
- */}}
33
- {{- define "cap.oldBindingsVolumes" -}}
34
- {{- $ := . -}}
35
- {{ range $bindingName, $binding := .deployment.bindings -}}
36
- {{- $secret := include "cap.bindingSecretName" (dict "Release" $.Release "name" $.name "bindingName" $bindingName "binding" $binding) }}
37
- - name: {{ $bindingName }}-secret
38
- secret:
39
- secretName: {{ $secret | quote }}
40
- {{- if and (eq $bindingName "db") $.deployment.multitenancy }}
41
- # the "plan" property must not be in the secret for the service manager
42
- # it would be used as plan for HANA
43
- items:
44
- - key: clientid
45
- path: clientid
46
- - key: clientsecret
47
- path: clientsecret
48
- - key: sm_url
49
- path: sm_url
50
- - key: url
51
- path: url
52
- - key: xsappname
53
- path: xsappname
54
- {{- end -}}
55
- {{- if eq $.deployment.language "Node" }}
56
- - name: {{ $bindingName }}-metadata
57
- secret:
58
- secretName: {{ $secret | quote }}
59
- optional: true
60
- items:
61
- - key: label
62
- path: label
63
- - key: plan
64
- path: plan
65
- - key: tags
66
- path: tags
67
- {{- end -}}
68
- {{- end -}}
69
- {{- end -}}
70
-
71
- {{/*
72
- New Service Bindings: volumes
73
- */}}
74
- {{- define "cap.newBindingsVolumes" -}}
75
- {{- $ := . -}}
76
- {{ range $bindingName, $binding := .deployment.bindings -}}
77
- {{- $secret := include "cap.bindingSecretName" (dict "Release" $.Release "name" $.name "bindingName" $bindingName "binding" $binding) }}
78
- - name: {{ $bindingName }}-secret
79
- secret:
80
- secretName: {{ $secret | quote }}
81
- {{- end -}}
82
- {{- end -}}
83
-
84
-
85
- {{- define "cap.bindingsEnv" -}}
86
- {{- if $.Values.newBindings -}}
87
- {{- include "cap.newBindingsEnv" $ }}
88
- {{- else -}}
89
- {{- include "cap.oldBindingsEnv" $ }}
90
- {{- end -}}
91
- {{- end -}}
92
-
93
- {{/*
94
- Old Service Bindings: env vars
95
- */}}
96
- {{- define "cap.oldBindingsEnv" }}
97
- {{- $ := . }}
98
- {{- if eq .deployment.language "Java" }}
99
- {{- range $key, $binding := .deployment.bindings }}
100
- {{- $cleanKey := $key | upper | replace "-" "" | replace "_" "" | replace "." "" }}
101
- {{- $prefix := print "CDS_ENVIRONMENT_K8S_SERVICEBINDINGS_" $cleanKey }}
102
- {{- $secret := default (print $.Release.Name "-" $.name "-" $key) $binding.secret }}
103
- - name: {{ $prefix }}_SERVICE
104
- valueFrom:
105
- secretKeyRef:
106
- name: {{ $secret | quote }}
107
- key: label
108
- - name: {{ $prefix }}_PLAN
109
- valueFrom:
110
- secretKeyRef:
111
- name: {{ $secret | quote }}
112
- key: plan
113
- optional: true
114
- - name: {{ $prefix }}_SECRETSPATH
115
- value: /etc/secrets/cds/requires/{{ $key }}/credentials
116
- {{- end }}
117
- {{- else }}
118
- {{- /* Read credentials from file system */ -}}
119
- - name: CDS_CONFIG
120
- value: /etc/secrets/cds
121
- {{ end }}
122
- {{- end }}
123
-
124
- {{/*
125
- New Service Bindings: env vars
126
- */}}
127
- {{- define "cap.newBindingsEnv" }}
128
- - name: SERVICE_BINDING_ROOT
129
- value: /bindings
130
- {{- end }}
131
-
132
-
133
- {{- define "cap.bindingsVolumeMounts" -}}
134
- {{- if $.Values.newBindings -}}
135
- {{- include "cap.newBindingsVolumeMounts" $ }}
136
- {{- else -}}
137
- {{- include "cap.oldBindingsVolumeMounts" $ }}
138
- {{- end -}}
139
- {{- end -}}
140
-
141
- {{/*
142
- Old Service Bindings: volume mounts
143
- */}}
144
- {{- define "cap.oldBindingsVolumeMounts" }}
145
- {{- $ := . -}}
146
- {{- range $key, $binding := .deployment.bindings }}
147
- - name: {{ $key }}-secret
148
- mountPath: /etc/secrets/cds/requires/{{ $key }}/credentials
149
- readOnly: true
150
- {{- if eq $.deployment.language "Node" }}
151
- - name: {{ $key }}-metadata
152
- mountPath: /etc/secrets/cds/requires/{{ $key }}/vcap
153
- readOnly: true
154
- {{- end }}
155
- {{- end }}
156
- {{- end }}
157
-
158
- {{/*
159
- New Service Bindings: volume mounts
160
- */}}
161
- {{- define "cap.newBindingsVolumeMounts" }}
162
- {{- $ := . -}}
163
- {{- range $key, $binding := .deployment.bindings }}
164
- - name: {{ $key }}-secret
165
- mountPath: /bindings/{{ $key }}
166
- readOnly: true
167
- {{- end }}
168
- {{- end }}
169
-
170
-
171
13
  {{/*
172
14
  Get list of deployment names
173
15
  */}}