@sap/cds-dk 4.9.6 → 6.0.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 (143) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/bin/activate.js +4 -4
  3. package/bin/add.js +11 -5
  4. package/bin/bind.js +16 -28
  5. package/bin/build/all.js +2 -2
  6. package/bin/build/index.js +12 -19
  7. package/bin/cds.js +16 -17
  8. package/bin/compile/index.js +12 -3
  9. package/bin/deploy/index.js +14 -14
  10. package/bin/deploy/to-hana.js +4 -4
  11. package/bin/deploy/to-sqlite.js +1 -1
  12. package/bin/env.js +13 -4
  13. package/bin/eval.js +1 -1
  14. package/bin/fix-redirects.js +1 -1
  15. package/bin/import.js +44 -179
  16. package/bin/repl.js +1 -1
  17. package/bin/watch.js +10 -15
  18. package/lib/bind/BindingManager.js +87 -0
  19. package/lib/bind/bindingResolver.js +14 -85
  20. package/lib/bind/bindingUtil.js +18 -11
  21. package/lib/bind/cfKeyProvider.js +58 -29
  22. package/lib/bind/kubernetesCredentialsProvider.js +44 -21
  23. package/lib/bind/userCdsrcJsonStorageProvider.js +12 -18
  24. package/lib/cds.js +13 -0
  25. package/lib/client/base_command.js +3 -2
  26. package/lib/client/extend.js +6 -7
  27. package/lib/client/helper/fs_helper.js +7 -8
  28. package/lib/client/settings_manager.js +14 -10
  29. package/lib/compile/index.js +9 -10
  30. package/lib/compile/openapi/csdl2openapi.js +151 -43
  31. package/lib/compile/openapi/index.js +2 -2
  32. package/lib/compile/to-xsuaa.js +3 -2
  33. package/lib/import/common.js +342 -27
  34. package/lib/import/importapi.js +81 -13
  35. package/lib/import/message.js +4 -4
  36. package/lib/import/odata/index.js +141 -0
  37. package/lib/import/{utils → odata/metadataconverter}/MetadataConverter.js +2 -2
  38. package/lib/import/{utils → odata/metadataconverter}/MetadataConverterFactory.js +1 -1
  39. package/lib/import/{utils → odata/util}/MultiMap.js +0 -0
  40. package/lib/import/{v2parser.js → odata/v2parser.js} +405 -468
  41. package/lib/import/{v4parser.js → odata/v4parser.js} +311 -322
  42. package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Aggregation.V1.json +0 -0
  43. package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Authorization.V1.json +0 -0
  44. package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Capabilities.V1.json +0 -0
  45. package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Core.V1.json +0 -0
  46. package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Measures.V1.json +0 -0
  47. package/lib/import/{vocabularies → odata/vocabularies}/Org.OData.Validation.V1.json +0 -0
  48. package/lib/import/openapi/importOpenAPI.js +521 -0
  49. package/lib/import/openapi/index.js +19 -0
  50. package/lib/import/openapi/utilities.js +38 -0
  51. package/lib/index.js +1 -1
  52. package/lib/init/constants.js +7 -2
  53. package/lib/init/index.js +10 -3
  54. package/lib/init/template/_merging/existences.js +79 -19
  55. package/lib/init/template/approuter/files/mta.yaml.hbs +25 -11
  56. package/lib/init/template/approuter/files/package.json +1 -1
  57. package/lib/init/template/approuter/files/xs-app.json.hbs +7 -0
  58. package/lib/init/template/approuter/index.js +61 -54
  59. package/lib/init/template/auditlog/index.js +2 -2
  60. package/lib/init/template/data/index.js +2 -2
  61. package/lib/init/template/hana/files/mta.yaml.hbs +17 -17
  62. package/lib/init/template/hana/index.js +8 -4
  63. package/lib/init/template/helm/index.js +39 -0
  64. package/lib/init/template/helm/update/index.js +28 -0
  65. package/lib/init/template/java/index.js +7 -9
  66. package/lib/init/template/kibana-logging/index.js +5 -6
  67. package/lib/init/template/mta/index.js +4 -4
  68. package/lib/init/template/mtx/files/java/package.json +9 -9
  69. package/lib/init/template/mtx/files/mta.yaml.hbs +0 -7
  70. package/lib/init/template/mtx/files/xs-security.json.hbs +11 -20
  71. package/lib/init/template/mtx/index.js +50 -57
  72. package/lib/init/template/nodejs/files/package.json.hbs +2 -2
  73. package/lib/init/template/notebook/index.js +2 -0
  74. package/lib/init/template/templateBase.js +6 -4
  75. package/lib/init/template/xsuaa/index.js +9 -5
  76. package/lib/init/util/fsUtil.js +25 -10
  77. package/lib/init/util/logger.js +1 -1
  78. package/lib/init/util/mvnArchetypeUtil.js +4 -10
  79. package/lib/init/util/projectReader.js +16 -8
  80. package/lib/init/util/templateUtil.js +30 -34
  81. package/lib/k8s/ChartAdder.js +65 -0
  82. package/lib/k8s/ChartBuilder.js +186 -0
  83. package/lib/k8s/Context.js +71 -0
  84. package/lib/k8s/ImageUtil.js +21 -0
  85. package/lib/k8s/Model.d.ts +53 -0
  86. package/lib/k8s/auditlog/index.js +29 -0
  87. package/lib/k8s/auditlog/templates/auditlog.yaml +1 -0
  88. package/lib/k8s/buildModel.js +70 -0
  89. package/lib/k8s/connectivity/index.js +74 -0
  90. package/lib/k8s/connectivity/templates/connectivity-binding.yaml +9 -0
  91. package/lib/k8s/connectivity/templates/connectivity-proxy-info.yaml +16 -0
  92. package/lib/k8s/connectivity/templates/connectivity.yaml +1 -0
  93. package/lib/k8s/deployment/index.js +81 -0
  94. package/lib/k8s/deployment/subchart/Chart.yaml +6 -0
  95. package/lib/k8s/deployment/subchart/templates/_helpers.tpl +156 -0
  96. package/lib/k8s/deployment/subchart/templates/api-rule.yaml +24 -0
  97. package/lib/k8s/deployment/subchart/templates/deployment.yaml +110 -0
  98. package/lib/k8s/deployment/subchart/templates/network-policy.yaml +16 -0
  99. package/lib/k8s/deployment/subchart/templates/pod-disruption-budget.yaml +11 -0
  100. package/lib/k8s/deployment/subchart/templates/secret.yaml +10 -0
  101. package/lib/k8s/deployment/subchart/templates/service-binding.yaml +27 -0
  102. package/lib/k8s/deployment/subchart/templates/service.yaml +11 -0
  103. package/lib/k8s/deployment/subchart/values-lint.yaml +8 -0
  104. package/lib/k8s/deployment/subchart/values.schema.json +449 -0
  105. package/lib/k8s/deployment/subchart/values.yaml +76 -0
  106. package/lib/k8s/deployment/subchart-override/templates/_web_application_helpers.tpl +81 -0
  107. package/lib/k8s/destinations/index.js +40 -0
  108. package/lib/k8s/destinations/lib.js +16 -0
  109. package/lib/k8s/destinations/templates/destinations.yaml +1 -0
  110. package/lib/k8s/docker/push.js +8 -0
  111. package/lib/k8s/event-mesh/index.js +53 -0
  112. package/lib/k8s/event-mesh/lib.js +9 -0
  113. package/lib/k8s/event-mesh/templates/event-mesh.yaml +1 -0
  114. package/lib/k8s/hana-deployer/index.js +38 -0
  115. package/lib/k8s/hana-deployer/templates/hana-deployer-job.yaml +41 -0
  116. package/lib/k8s/helm/Release.js +80 -0
  117. package/lib/k8s/html5-apps-deployer/index.js +43 -0
  118. package/lib/k8s/html5-apps-deployer/templates/_html5_deployment_helpers.tpl +16 -0
  119. package/lib/k8s/html5-apps-deployer/templates/html5-apps-deployer-job.yaml +53 -0
  120. package/lib/k8s/html5-apps-repo-host/index.js +26 -0
  121. package/lib/k8s/html5-apps-repo-host/lib.js +16 -0
  122. package/lib/k8s/html5-apps-repo-host/templates/html5-apps-repo-host.yaml +1 -0
  123. package/lib/k8s/index.js +153 -0
  124. package/lib/k8s/modules.js +36 -0
  125. package/lib/k8s/multitenancy/index.js +24 -0
  126. package/lib/k8s/multitenancy/lib.js +25 -0
  127. package/lib/k8s/multitenancy/templates/saas-registry.yaml +19 -0
  128. package/lib/k8s/readProject.js +14 -0
  129. package/lib/k8s/resources/helm/chart/templates/NOTES.txt +11 -0
  130. package/lib/k8s/resources/helm/chart/templates/_deployment_helpers.tpl +221 -0
  131. package/lib/k8s/resources/helm/chart/templates/_helpers.tpl +167 -0
  132. package/lib/k8s/resources/helm/chart/templates/_sapcp_helpers.tpl +103 -0
  133. package/lib/k8s/util.js +186 -0
  134. package/lib/k8s/wrapFeature.js +55 -0
  135. package/lib/k8s/xsuaa/index.js +64 -0
  136. package/lib/k8s/xsuaa/lib.js +14 -0
  137. package/lib/k8s/xsuaa/templates/xsuaa.yaml +1 -0
  138. package/lib/util/exec.js +1 -1
  139. package/lib/util/write.js +1 -1
  140. package/lib/watch/node-watch.js +43 -14
  141. package/npm-shrinkwrap.json +914 -2745
  142. package/package.json +5 -5
  143. package/lib/import/index.js +0 -235
@@ -0,0 +1,449 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://github.tools.sap/cki/web-application/blob/main/values.schema.json",
4
+ "type": "object",
5
+ "required": [
6
+ "image",
7
+ "resources"
8
+ ],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "global": {
12
+ "$id": "#/properties/global",
13
+ "type": "object",
14
+ "x-ignore-untested": true,
15
+ "additionalProperties": true,
16
+ "properties": {
17
+ "imagePullSecret": {
18
+ "$id": "#/properties/global/imagePullSecret",
19
+ "additionalProperties": true,
20
+ "type": "object",
21
+ "properties": {
22
+ "name": {
23
+ "$ref": "#/definitions/KubernetesName"
24
+ },
25
+ "dockerconfigjson": {
26
+ "type": "string"
27
+ }
28
+ },
29
+ "dependencies": {
30
+ "name": {
31
+ "not": {
32
+ "required": [
33
+ "dockerconfigjson"
34
+ ]
35
+ }
36
+ },
37
+ "dockerconfigjson": {
38
+ "not": {
39
+ "required": [
40
+ "name"
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "nameOverride": {
49
+ "$id": "#/properties/nameOverride",
50
+ "type": "string",
51
+ "pattern": "[0-9a-z][0-9a-z-.]*"
52
+ },
53
+ "fullnameOverride": {
54
+ "$id": "#/properties/fullnameOverride",
55
+ "type": "string",
56
+ "pattern": "[0-9a-z][0-9a-z-.]*"
57
+ },
58
+ "replicaCount": {
59
+ "$id": "#/properties/replicaCount",
60
+ "type": "integer",
61
+ "minimum": 1,
62
+ "default": 1
63
+ },
64
+ "port": {
65
+ "$id": "#/properties/port",
66
+ "type": "integer",
67
+ "minimum": 1,
68
+ "maximum": 65535,
69
+ "default": 8080
70
+ },
71
+ "serviceAccountName": {
72
+ "$id": "#/properties/serviceAccountName",
73
+ "default": "default",
74
+ "allOf": [
75
+ {
76
+ "$ref": "#/definitions/KubernetesName"
77
+ }
78
+ ]
79
+ },
80
+ "image": {
81
+ "$id": "#/properties/image",
82
+ "type": "object",
83
+ "required": [
84
+ "repository"
85
+ ],
86
+ "additionalProperties": false,
87
+ "properties": {
88
+ "repository": {
89
+ "$id": "#/properties/image/properties/repository",
90
+ "type": "string",
91
+ "pattern": "^[\\w-./:]*[@sha256]*$"
92
+ },
93
+ "tag": {
94
+ "$id": "#/properties/image/properties/tag",
95
+ "type": "string",
96
+ "$comment": "Copied from https://github.com/containers/image/blob/18d58d29fdc4fc32fb8a8a6d186b829b217f1bf5/docker/reference/regexp.go#L68-L70",
97
+ "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,}))?$",
98
+ "default": "latest"
99
+ }
100
+ }
101
+ },
102
+ "imagePullSecret": {
103
+ "$id": "#/properties/imagePullSecret",
104
+ "additionalProperties": false,
105
+ "type": "object",
106
+ "properties": {
107
+ "name": {
108
+ "$ref": "#/definitions/KubernetesName"
109
+ },
110
+ "dockerconfigjson": {
111
+ "type": "string"
112
+ }
113
+ },
114
+ "dependencies": {
115
+ "name": {
116
+ "not": {
117
+ "required": [
118
+ "dockerconfigjson"
119
+ ]
120
+ }
121
+ },
122
+ "dockerconfigjson": {
123
+ "not": {
124
+ "required": [
125
+ "name"
126
+ ]
127
+ }
128
+ }
129
+ }
130
+ },
131
+ "additionalVolumes": {
132
+ "$id": "#/properties/additionalVolumes",
133
+ "type": "array",
134
+ "additionalItems": false,
135
+ "default": [],
136
+ "items": {
137
+ "type": "object",
138
+ "additionalProperties": true,
139
+ "required": [
140
+ "name",
141
+ "volumeMount"
142
+ ],
143
+ "properties": {
144
+ "name": {
145
+ "type": "string",
146
+ "$ref": "#/definitions/KubernetesName"
147
+ },
148
+ "volumeMount": {
149
+ "type": "object",
150
+ "required": [
151
+ "mountPath"
152
+ ],
153
+ "additionalProperties": false,
154
+ "properties": {
155
+ "mountPath": {
156
+ "type": "string",
157
+ "pattern": "^[^:]*$"
158
+ },
159
+ "mountPropagation": {
160
+ "type": "string"
161
+ },
162
+ "readOnly": {
163
+ "type": "boolean"
164
+ },
165
+ "subPath": {
166
+ "type": "string"
167
+ },
168
+ "subPathExpr": {
169
+ "type": "string"
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ },
176
+ "ha": {
177
+ "$id": "#/properties/ha",
178
+ "type": "object",
179
+ "additionalProperties": false,
180
+ "properties": {
181
+ "enabled": {
182
+ "$id": "#/properties/ha/properties/enabled",
183
+ "type": "boolean",
184
+ "default": true
185
+ }
186
+ }
187
+ },
188
+ "resources": {
189
+ "$id": "#/properties/resources",
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": [
193
+ "requests",
194
+ "limits"
195
+ ],
196
+ "properties": {
197
+ "requests": {
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": [
201
+ "cpu",
202
+ "memory"
203
+ ],
204
+ "properties": {
205
+ "cpu": {
206
+ "$id": "#/properties/resources/properties/requests/properties/cpu",
207
+ "oneOf": [
208
+ {
209
+ "type": "number"
210
+ },
211
+ {
212
+ "type": "string"
213
+ }
214
+ ]
215
+ },
216
+ "ephemeral-storage": {
217
+ "$id": "#/properties/resources/properties/requests/properties/ephemeral-storage",
218
+ "type": "string"
219
+ },
220
+ "memory": {
221
+ "$id": "#/properties/resources/properties/requests/properties/memory",
222
+ "type": "string"
223
+ }
224
+ }
225
+ },
226
+ "limits": {
227
+ "type": "object",
228
+ "additionalProperties": false,
229
+ "required": [
230
+ "memory"
231
+ ],
232
+ "properties": {
233
+ "cpu": {
234
+ "$id": "#/properties/resources/properties/limits/properties/cpu",
235
+ "oneOf": [
236
+ {
237
+ "type": "number"
238
+ },
239
+ {
240
+ "type": "string"
241
+ }
242
+ ]
243
+ },
244
+ "ephemeral-storage": {
245
+ "$id": "#/properties/resources/properties/limits/properties/ephemeral-storage",
246
+ "type": "string"
247
+ },
248
+ "memory": {
249
+ "$id": "#/properties/resources/properties/limits/properties/memory",
250
+ "type": "string"
251
+ }
252
+ }
253
+ }
254
+ }
255
+ },
256
+ "health_check": {
257
+ "$id": "#/properties/health_check",
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "properties": {
261
+ "liveness": {
262
+ "$id": "#/properties/health_check/properties/liveness",
263
+ "type": "object",
264
+ "additionalProperties": false,
265
+ "properties": {
266
+ "path": {
267
+ "type": "string",
268
+ "default": "/healthz"
269
+ }
270
+ }
271
+ },
272
+ "readiness": {
273
+ "$id": "#/properties/health_check/properties/readiness",
274
+ "type": "object",
275
+ "additionalProperties": false,
276
+ "properties": {
277
+ "path": {
278
+ "type": "string",
279
+ "default": "/healthz"
280
+ }
281
+ }
282
+ }
283
+ }
284
+ },
285
+ "startupTimeout": {
286
+ "$id": "#/properties/startupTimeout",
287
+ "type": "integer",
288
+ "minimum": 1,
289
+ "default": 30
290
+ },
291
+ "env": {
292
+ "$id": "#/properties/env",
293
+ "type": "object",
294
+ "patternProperties": {
295
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
296
+ "$comment": "regex above copied from https://github.com/kubernetes/kubernetes/blob/ea0764452222146c47ec826977f49d7001b0ea8c/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L402",
297
+ "anyOf": [
298
+ {
299
+ "type": "string"
300
+ },
301
+ {
302
+ "type": "integer"
303
+ }
304
+ ]
305
+ }
306
+ },
307
+ "additionalProperties": false,
308
+ "default": {}
309
+ },
310
+ "envSecretNames": {
311
+ "$id": "#/properties/envSecretNames",
312
+ "type": "array",
313
+ "uniqueItems": true,
314
+ "items": {
315
+ "$ref": "#/definitions/KubernetesName"
316
+ },
317
+ "default": []
318
+ },
319
+ "expose": {
320
+ "$id": "#/properties/expose",
321
+ "type": "object",
322
+ "additionalProperties": false,
323
+ "properties": {
324
+ "host": {
325
+ "$id": "#/properties/expose/properties/host",
326
+ "type": "string"
327
+ },
328
+ "enabled": {
329
+ "$id": "#/properties/expose/properties/enabled",
330
+ "type": "boolean",
331
+ "default": true
332
+ }
333
+ }
334
+ },
335
+ "bindings": {
336
+ "$id": "#/properties/bindings",
337
+ "type": "object",
338
+ "additionalProperties": false,
339
+ "patternProperties": {
340
+ "^[-._a-zA-Z][-._a-zA-Z0-9]*$": {
341
+ "anyOf": [
342
+ {
343
+ "type": "object",
344
+ "additionalProperties": false,
345
+ "required": [
346
+ "fromSecret"
347
+ ],
348
+ "properties": {
349
+ "fromSecret": {
350
+ "$ref": "#/definitions/KubernetesName"
351
+ }
352
+ }
353
+ },
354
+ {
355
+ "type": "object",
356
+ "additionalProperties": false,
357
+ "properties": {
358
+ "serviceInstanceName": {
359
+ "$ref": "#/definitions/KubernetesName"
360
+ },
361
+ "serviceInstanceFullname": {
362
+ "$ref": "#/definitions/KubernetesName"
363
+ },
364
+ "externalName": {
365
+ "type": "string"
366
+ },
367
+ "secretName": {
368
+ "$ref": "#/definitions/KubernetesName"
369
+ },
370
+ "parameters": {
371
+ "type": "object"
372
+ },
373
+ "parametersFrom": {
374
+ "type": "array",
375
+ "items": {
376
+ "anyOf": [
377
+ {
378
+ "type": "object",
379
+ "additionalProperties": false,
380
+ "properties": {
381
+ "secretKeyRef": {
382
+ "type": "object",
383
+ "additionalProperties": false,
384
+ "properties": {
385
+ "name": {
386
+ "$ref": "#/definitions/KubernetesName"
387
+ },
388
+ "key": {
389
+ "type": "string"
390
+ }
391
+ }
392
+ }
393
+ }
394
+ },
395
+ {
396
+ "type": "object",
397
+ "additionalProperties": false,
398
+ "properties": {
399
+ "configMapKeyRef": {
400
+ "type": "object",
401
+ "additionalProperties": false,
402
+ "properties": {
403
+ "name": {
404
+ "$ref": "#/definitions/KubernetesName"
405
+ },
406
+ "key": {
407
+ "type": "string"
408
+ }
409
+ }
410
+ }
411
+ }
412
+ }
413
+ ]
414
+ }
415
+ },
416
+ "credentialsRotationPolicy": {
417
+ "type": "object"
418
+ }
419
+ },
420
+ "dependencies": {
421
+ "serviceInstanceName": {
422
+ "not": {
423
+ "required": [
424
+ "serviceInstanceFullname"
425
+ ]
426
+ }
427
+ },
428
+ "serviceInstanceFullname": {
429
+ "not": {
430
+ "required": [
431
+ "serviceInstanceName"
432
+ ]
433
+ }
434
+ }
435
+ }
436
+ }
437
+ ]
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "definitions": {
443
+ "KubernetesName": {
444
+ "type": "string",
445
+ "$comment": "running `kubectl create secret generic invalid_name` will print this regex",
446
+ "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
447
+ }
448
+ }
449
+ }
@@ -0,0 +1,76 @@
1
+ global:
2
+ imagePullSecret: {}
3
+ # name: ""
4
+ # dockerconfigjson: ""
5
+
6
+ replicaCount: 1
7
+ port: 8080
8
+ serviceAccountName: default
9
+
10
+ # To use a digest, change those values like that
11
+ # repository: nginx@sha256
12
+ # tag: 2834dc507516af02784808c5f48b7cbe38b8ed5d0f4837f16e78d00deb7e7767
13
+ image:
14
+ # repository: gcr.io/repo/image
15
+ tag: latest
16
+
17
+ imagePullSecret: {}
18
+ # name: ""
19
+ # dockerconfigjson: ""
20
+
21
+ additionalVolumes: []
22
+ # - name: my-volume
23
+ # secret:
24
+ # secretName: my-secret
25
+ # volumeMount:
26
+ # mountPath: /etc/mysecret
27
+ # readOnly: true
28
+
29
+ ha:
30
+ enabled: true
31
+
32
+ # resources:
33
+ # limits:
34
+ # cpu: 100m
35
+ # ephemeral-storage: 1G
36
+ # memory: 1G
37
+ # requests:
38
+ # cpu: 100m
39
+ # ephemeral-storage: 1G
40
+ # memory: 1G
41
+
42
+ health_check:
43
+ liveness:
44
+ path: /healthz
45
+ readiness:
46
+ path: /healthz
47
+
48
+ startupTimeout: 30
49
+
50
+ envSecretNames: []
51
+
52
+ env: {}
53
+ # env:
54
+ # key: value
55
+
56
+ expose:
57
+ enabled: true
58
+ # host: ""
59
+
60
+ # bindings:
61
+ # ui5-repo-servicerepo:
62
+ # serviceInstanceName: ui5-repo-instance
63
+ # externalName: ui5-kyma-binding
64
+ # secretName: ui5-repo-binding-secret
65
+ # parameters:
66
+ # foo: bar
67
+ # parametersFrom:
68
+ # - secretKeyRef:
69
+ # key: test
70
+ # name: test
71
+ # credentialsRotationPolicy:
72
+ # enabled: true
73
+ # hana:
74
+ # serviceInstanceName: hana-manual
75
+ # portal:
76
+ # fromSecret: manual-secret # user-provided-service
@@ -0,0 +1,81 @@
1
+ {{/*
2
+ Old Service Bindings: volumes
3
+ */}}
4
+ {{- define "cap.web-application.serviceVolumes" -}}
5
+ {{- $ := . -}}
6
+ {{ range $bindingName, $binding := $.Values.bindings -}}
7
+ {{- $secret := default (print $.Release.Name "-" $.Chart.Name "-" $bindingName) $binding.fromSecret }}
8
+ - name: {{ $bindingName }}-secret
9
+ secret:
10
+ secretName: {{ $secret | quote }}
11
+ {{- if $.Values.global.oldServiceBindings }}
12
+ - name: {{ $bindingName }}-metadata
13
+ secret:
14
+ secretName: {{ $secret | quote }}
15
+ optional: true
16
+ items:
17
+ - key: label
18
+ path: label
19
+ - key: plan
20
+ path: plan
21
+ - key: tags
22
+ path: tags
23
+ {{- end }}
24
+ {{- end -}}
25
+ {{- end -}}
26
+
27
+ {{/*
28
+ Service Bindings: env vars
29
+ */}}
30
+ {{- define "cap.web-application.env" }}
31
+ {{- $ := . }}
32
+ {{- range $key, $binding := $.Values.bindings }}
33
+ {{- $cleanKey := $key | upper | replace "-" "" | replace "_" "" | replace "." "" }}
34
+ {{- $prefix := print "CDS_ENVIRONMENT_K8S_SERVICEBINDINGS_" $cleanKey }}
35
+ {{- $secret := default (print $.Release.Name "-" $.Chart.Name "-" $key) $binding.fromSecret }}
36
+ - name: {{ $prefix }}_SERVICE
37
+ valueFrom:
38
+ secretKeyRef:
39
+ name: {{ $secret | quote }}
40
+ key: label
41
+ - name: {{ $prefix }}_PLAN
42
+ valueFrom:
43
+ secretKeyRef:
44
+ name: {{ $secret | quote }}
45
+ key: plan
46
+ optional: true
47
+ {{- if $.Values.global.oldServiceBindings }}
48
+ - name: CDS_CONFIG
49
+ value: /etc/secrets/cds
50
+ - name: {{ $prefix }}_SECRETSPATH
51
+ value: /etc/secrets/cds/requires/{{ $key }}/credentials
52
+ {{- else }}
53
+ - name: {{ $prefix }}_SECRETSPATH
54
+ value: /bindings/{{ $key }}
55
+ {{- end }}
56
+ {{- end }}
57
+ {{- end }}
58
+
59
+
60
+ {{/*
61
+ Old Service Bindings: volume mounts
62
+ */}}
63
+ {{- define "cap.web-application.serviceMounts" }}
64
+ {{- $ := . -}}
65
+ {{- range $key, $binding := $.Values.bindings }}
66
+ {{- if not $.Values.global.oldServiceBindings }}
67
+ - name: {{ $key }}-secret
68
+ mountPath: /bindings/{{ $key }}
69
+ readOnly: true
70
+ {{- else }}
71
+ - name: {{ $key }}-secret
72
+ mountPath: /etc/secrets/cds/requires/{{ $key }}/credentials
73
+ readOnly: true
74
+ - name: {{ $key }}-metadata
75
+ mountPath: /etc/secrets/cds/requires/{{ $key }}/vcap
76
+ readOnly: true
77
+ {{- end }}
78
+ {{- end }}
79
+ {{- end }}
80
+
81
+
@@ -0,0 +1,40 @@
1
+ const wrapFeature = require('../wrapFeature');
2
+ const { checkNeedDestinations } = require('./lib');
3
+
4
+ module.exports = wrapFeature('destinations', {
5
+
6
+ async checkNeedDestinations(context) {
7
+ const env = await context.get('env');
8
+ return checkNeedDestinations(env);
9
+ },
10
+
11
+ async isRequired(context) {
12
+ return await this.checkNeedDestinations(context) || await context.collect('getDestinationsParameters');
13
+ },
14
+
15
+ async getServiceBindings(context) {
16
+ return await this.checkNeedDestinations(context) && {destinations: { serviceInstanceName: 'destinations' } };
17
+ },
18
+
19
+ async getChartCapabilities(context) {
20
+ return {
21
+ destinations: {
22
+ serviceOfferingName: 'destination',
23
+ servicePlanName: 'lite',
24
+ parameters: {
25
+ version: "1.0.0",
26
+ ...await context.collect('getDestinationsParameters')
27
+ }
28
+ }
29
+ }
30
+ },
31
+
32
+ async addToChart(builder, { destinations }) {
33
+ await builder.addAllTemplates(__dirname);
34
+
35
+ const { config } = destinations;
36
+ if (config) {
37
+ await builder.addChartFile(config);
38
+ }
39
+ }
40
+ });
@@ -0,0 +1,16 @@
1
+ function checkNeedDestinations(env) {
2
+ const kinds = [ 'odata', 'odata-v2', 'odata-v4', 'rest' ].reduce( (map, key) => {
3
+ map[key] = true;
4
+ return map;
5
+ }, {});
6
+ for (const service in env.requires) {
7
+ const require = env.requires[service];
8
+ if (!kinds[service] && kinds[require.kind]) return true;
9
+ }
10
+
11
+ return false;
12
+ }
13
+
14
+ module.exports = {
15
+ checkNeedDestinations
16
+ };
@@ -0,0 +1 @@
1
+ {{- include "cap.service-instance" . }}
@@ -0,0 +1,8 @@
1
+ const { exec } = require('../../util/exec');
2
+
3
+ async function push(imageName, fullImageName) {
4
+ await exec `docker tag ${imageName} ${fullImageName}`;
5
+ await exec `docker push ${fullImageName}`;
6
+ }
7
+
8
+ module.exports = push;