@sap/cds-dk 6.3.2 → 6.4.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.
- package/CHANGELOG.md +38 -7
- package/bin/cds.js +2 -0
- package/bin/compile/index.js +2 -1
- package/bin/deploy/index.js +5 -3
- package/bin/deploy/to-sqlite.js +17 -15
- package/bin/help.js +7 -4
- package/bin/init.js +1 -1
- package/bin/login.js +3 -4
- package/bin/migrate.js +33 -0
- package/bin/pull.js +4 -4
- package/bin/push.js +1 -1
- package/bin/subscribe.js +58 -66
- package/bin/unsubscribe.js +67 -0
- package/bin/watch.js +4 -3
- package/lib/bind/bindingUtil.js +2 -0
- package/lib/bind/cfKeyProvider.js +5 -1
- package/lib/client/activate.js +3 -3
- package/lib/client/auth_manager.js +2 -2
- package/lib/client/base_command.js +7 -6
- package/lib/client/extend.js +2 -2
- package/lib/client/helper/errors.js +8 -2
- package/lib/client/helper/logging.js +13 -11
- package/lib/client/params.js +3 -0
- package/lib/client/pull.js +1 -1
- package/lib/client/push.js +4 -4
- package/lib/client/settings_manager.js +13 -6
- package/lib/client/subscription.js +81 -0
- package/lib/compile/to-xsuaa.js +25 -19
- package/lib/import/odata/metadataconverter/MetadataConverter.js +3 -3
- package/lib/import/odata/v2parser.js +37 -24
- package/lib/import/odata/v4parser.js +111 -37
- package/lib/init/constants.js +1 -1
- package/lib/init/index.js +2 -2
- package/lib/init/template/_merging/registry-mta.js +0 -3
- package/lib/init/template/approuter/files/approuter-configmap.yaml +10 -0
- package/lib/init/template/approuter/files/approuter-mtxs-configmap.yaml +15 -0
- package/lib/init/template/approuter/files/chart.yaml +4 -0
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/approuter/files/values.yaml.hbs +31 -0
- package/lib/init/template/approuter/index.js +60 -12
- package/lib/init/template/auditlog/index.js +16 -8
- package/lib/init/template/cf-manifest/index.js +3 -3
- package/lib/init/template/connectivity/index.js +19 -10
- package/lib/init/template/destinations/index.js +23 -7
- package/lib/init/template/enterprise-messaging/files/cds.package.json +1 -2
- package/lib/init/template/enterprise-messaging/files/cds.profile.package.json.hbs +1 -2
- package/lib/init/template/enterprise-messaging/files/cdsrc.json +1 -2
- package/lib/init/template/enterprise-messaging/files/cdsrc.json.hbs +1 -2
- package/lib/init/template/enterprise-messaging/files/event-mesh.json.hbs +31 -0
- package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +1 -0
- package/lib/init/template/enterprise-messaging/index.js +26 -13
- package/lib/init/template/extensibility/index.js +19 -10
- package/lib/init/template/hana/files/mta.yaml.hbs +0 -4
- package/lib/init/template/hana/index.js +58 -22
- package/lib/init/template/helm/chart/templates/NOTES.txt +4 -3
- package/lib/init/template/helm/chart/templates/_deployment_helpers.tpl +25 -2
- package/lib/init/template/helm/chart/values.root.schema.json +5 -0
- package/lib/init/template/helm/chart/values.schema.json +27 -0
- package/lib/init/template/helm/files/values.yaml.hbs +1 -1
- package/lib/init/template/helm/index.js +25 -23
- package/lib/init/template/helm/subchart/templates/_helpers.tpl +29 -0
- package/lib/init/template/helm/subchart/templates/api-rule.yaml +5 -5
- package/lib/init/template/helm/subchart/templates/deployment.yaml +12 -9
- package/lib/init/template/helm/subchart/values.md +258 -88
- package/lib/init/template/helm/subchart/values.schema.json +96 -13
- package/lib/init/template/helm/subchart/values.yaml +6 -2
- package/lib/init/template/html5-repo/index.js +28 -11
- package/lib/init/template/java/index.js +5 -5
- package/lib/init/template/kibana-logging/index.js +5 -4
- package/lib/init/template/mta/index.js +2 -2
- package/lib/init/template/mtx/index.js +1 -1
- package/lib/init/template/multitenancy/files/chart.yaml +4 -0
- package/lib/init/template/multitenancy/files/java/mtxs-configmap.yaml +20 -0
- package/lib/init/template/multitenancy/files/java/package.json +6 -9
- package/lib/init/template/multitenancy/files/mtxs-configmap.yaml +15 -0
- package/lib/init/template/multitenancy/files/saas-registry.yaml +17 -19
- package/lib/init/template/multitenancy/files/values.yaml.hbs +47 -0
- package/lib/init/template/multitenancy/files/xs-security.json.hbs +0 -7
- package/lib/init/template/multitenancy/index.js +83 -37
- package/lib/init/template/nodejs/files/.eslintrc +26 -0
- package/lib/init/template/nodejs/files/package.json.hbs +0 -28
- package/lib/init/template/nodejs/index.js +7 -10
- package/lib/init/template/pipeline/index.js +4 -4
- package/lib/init/template/samples/index.js +5 -5
- package/lib/init/template/templateBase.js +1 -4
- package/lib/init/template/toggles/index.js +5 -5
- package/lib/init/template/xsuaa/files/values.yaml.hbs +21 -0
- package/lib/init/template/xsuaa/index.js +34 -24
- package/lib/init/util/md5Tracking.js +113 -0
- package/lib/init/util/merge.js +19 -2
- package/lib/init/util/projectReader.js +15 -12
- package/npm-shrinkwrap.json +211 -686
- package/package.json +3 -3
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { exists, read,
|
|
1
|
+
const { join } = require('path');
|
|
2
|
+
const { exists, read, rimraf } = require('../../../cds').utils;
|
|
3
3
|
const ProjectReader = require('../../util/projectReader');
|
|
4
4
|
const { mergeYAML } = require('../../util/merge')
|
|
5
|
+
const { parseMd5File, writeMd5File, copyAndTrack } = require('../../util/md5Tracking')
|
|
5
6
|
//const { yaml } = require('@sap/cds-foss')
|
|
6
7
|
|
|
7
8
|
module.exports = class HelmTemplate extends require('../templateBase') {
|
|
8
9
|
constructor(projectPath, generator) {
|
|
9
10
|
super(projectPath, generator, __dirname);
|
|
10
11
|
this.projectReader = new ProjectReader(projectPath);
|
|
12
|
+
this.oldTrackingData = undefined;
|
|
13
|
+
this.newTrackingData = {};
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
static hasFacet(_, projectPath, options) {
|
|
14
17
|
// REVISIT: this works, but could be semantically nicer with a 'shouldRunDependentMerging' or the like
|
|
15
18
|
if (options?.add.has('mta') && !options?.add.has('helm')) return false
|
|
16
|
-
return exists(
|
|
19
|
+
return exists(join(projectPath, 'chart', 'values.yaml'))
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
async canRun() {
|
|
20
23
|
if (this.options.force) {
|
|
21
|
-
await rimraf(
|
|
24
|
+
await rimraf(join(this.projectPath, 'chart'))
|
|
22
25
|
return true;
|
|
23
26
|
}
|
|
24
27
|
return true;
|
|
@@ -26,42 +29,41 @@ module.exports = class HelmTemplate extends require('../templateBase') {
|
|
|
26
29
|
|
|
27
30
|
async run() {
|
|
28
31
|
const projectDescriptor = await this.projectReader.read(this.options)
|
|
32
|
+
this.oldTrackingData = await parseMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'));
|
|
29
33
|
|
|
30
|
-
await
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
await copyAndTrack(
|
|
35
|
+
join(__dirname, 'subchart'),
|
|
36
|
+
join(this.projectPath, 'chart', 'charts', 'web-application'),
|
|
37
|
+
this
|
|
33
38
|
)
|
|
34
|
-
await
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
await copyAndTrack(
|
|
40
|
+
join(__dirname, 'chart'),
|
|
41
|
+
join(this.projectPath, 'chart'),
|
|
42
|
+
this
|
|
37
43
|
)
|
|
38
44
|
|
|
39
|
-
const webApplicationChartPath = process.env.WEB_APPLICATION_CHART ?? path.join(__dirname, 'subchart')
|
|
40
|
-
const chartFilePath = path.join(webApplicationChartPath, 'Chart.yaml')
|
|
41
|
-
const chartFile = await read(chartFilePath)
|
|
42
|
-
//const { version } = yaml.parse(chartFile)
|
|
43
|
-
|
|
44
45
|
await mergeYAML(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
projectDescriptor
|
|
46
|
+
join(this.projectPath, 'chart', 'Chart.yaml'),
|
|
47
|
+
join(__dirname, 'files', 'Chart.yaml.hbs'),
|
|
48
|
+
projectDescriptor
|
|
48
49
|
)
|
|
49
50
|
|
|
50
51
|
await mergeYAML(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
projectDescriptor
|
|
52
|
+
join(this.projectPath, 'chart', 'values.yaml'),
|
|
53
|
+
join(__dirname, 'files', 'values.yaml.hbs'),
|
|
54
|
+
projectDescriptor
|
|
54
55
|
)
|
|
55
56
|
await this.runDependentMerging();
|
|
57
|
+
await writeMd5File(join(this.projectPath, 'chart', '.cds-add-helm-files.md5'), this.newTrackingData);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
async runDependentMerging() {
|
|
59
61
|
// Re-applying the dependent merging part of other facets if necessary.
|
|
60
|
-
const dependentFacets = ['hana', 'xsuaa', 'auditlog', 'enterprise-messaging', 'destinations' , 'multitenancy', 'extensibility']
|
|
62
|
+
const dependentFacets = ['hana', 'xsuaa', 'auditlog', 'enterprise-messaging', 'destinations' , 'multitenancy', 'extensibility', 'approuter']
|
|
61
63
|
for (const facet of dependentFacets) {
|
|
62
64
|
const Template = require('../'+facet)
|
|
63
65
|
const template = new Template(this.projectPath, this.generator)
|
|
64
|
-
if (Template.hasFacet(await this.getEnv(), this.projectPath, this.options)) await template.runDependentMerging()
|
|
66
|
+
if (Template.hasFacet(await this.getEnv(), this.projectPath, this.options)) await template.runDependentMerging(this)
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
};
|
|
@@ -202,4 +202,33 @@ If release name contains chart name it will be used as service insatnce name.
|
|
|
202
202
|
{{- end }}
|
|
203
203
|
{{- $_ := set $result "vars" $variables }}
|
|
204
204
|
{{- $result | mustToJson }}
|
|
205
|
+
{{- end }}
|
|
206
|
+
|
|
207
|
+
{{- define "web-application.processEnvFrom" -}}
|
|
208
|
+
{{- $ := . -}}
|
|
209
|
+
{{- $result := dict }}
|
|
210
|
+
{{- $variables := list }}
|
|
211
|
+
{{- range $secretName := .Values.envSecretNames }}
|
|
212
|
+
{{- $variable := dict }}
|
|
213
|
+
{{- $_ := set $variable "name" $secretName -}}
|
|
214
|
+
{{- $variables = append $variables (dict "secretRef" $variable)}}
|
|
215
|
+
{{- end }}
|
|
216
|
+
{{- range $envFrom := .Values.envFrom }}
|
|
217
|
+
{{- if hasKey $envFrom "configMapRef" }}
|
|
218
|
+
{{- if and (hasKey $envFrom.configMapRef "tpl") ($envFrom.configMapRef.tpl) }}
|
|
219
|
+
{{- $name := (tpl $envFrom.configMapRef.name $) }}
|
|
220
|
+
{{- $_ := set $envFrom.configMapRef "name" $name }}
|
|
221
|
+
{{- end }}
|
|
222
|
+
{{- $_ := unset $envFrom.configMapRef "tpl" }}
|
|
223
|
+
{{- else }}
|
|
224
|
+
{{- if and (hasKey $envFrom.secretRef "tpl") ($envFrom.secretRef.tpl) }}
|
|
225
|
+
{{- $name := (tpl $envFrom.secretRef.name $) }}
|
|
226
|
+
{{- $_ := set $envFrom.secretRef "name" $name }}
|
|
227
|
+
{{- end }}
|
|
228
|
+
{{- $_ := unset $envFrom.secretRef "tpl" }}
|
|
229
|
+
{{- end }}
|
|
230
|
+
{{- $variables = append $variables $envFrom }}
|
|
231
|
+
{{- end }}
|
|
232
|
+
{{- $_ := set $result "vars" $variables }}
|
|
233
|
+
{{- $result | mustToJson }}
|
|
205
234
|
{{- end }}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{{ if .Values.expose.enabled}}
|
|
2
|
-
apiVersion: gateway.kyma-project.io/
|
|
2
|
+
apiVersion: gateway.kyma-project.io/v1beta1
|
|
3
3
|
kind: APIRule
|
|
4
4
|
metadata:
|
|
5
5
|
name: {{ include "web-application.fullname" . }}
|
|
6
6
|
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
7
7
|
spec:
|
|
8
8
|
gateway: kyma-gateway.kyma-system.svc.cluster.local
|
|
9
|
+
host: {{ include "web-application.exposeHost" . }}
|
|
10
|
+
service:
|
|
11
|
+
name: {{ include "web-application.fullname" . }}
|
|
12
|
+
port: {{ .Values.port }}
|
|
9
13
|
rules:
|
|
10
14
|
- accessStrategies:
|
|
11
15
|
- handler: allow
|
|
@@ -17,8 +21,4 @@ spec:
|
|
|
17
21
|
- DELETE
|
|
18
22
|
- HEAD
|
|
19
23
|
path: /.*
|
|
20
|
-
service:
|
|
21
|
-
host: {{ include "web-application.exposeHost" . }}
|
|
22
|
-
name: {{ include "web-application.fullname" . }}
|
|
23
|
-
port: {{ .Values.port }}
|
|
24
24
|
{{ end }}
|
|
@@ -25,9 +25,9 @@ spec:
|
|
|
25
25
|
containerPort: {{ .Values.port }}
|
|
26
26
|
protocol: TCP
|
|
27
27
|
envFrom:
|
|
28
|
-
{{-
|
|
29
|
-
-
|
|
30
|
-
|
|
28
|
+
{{- $envFromVars := (include "web-application.processEnvFrom" . | fromJson) }}
|
|
29
|
+
{{- if not (eq (len $envFromVars.vars) 0) }}
|
|
30
|
+
{{- $envFromVars.vars | toYaml | nindent 8}}
|
|
31
31
|
{{- end }}
|
|
32
32
|
env:
|
|
33
33
|
{{- if .Values.bindings }}
|
|
@@ -50,28 +50,29 @@ spec:
|
|
|
50
50
|
- name: APPLICATION_URI
|
|
51
51
|
value: {{ include "web-application.applicationUri" . }}
|
|
52
52
|
{{- end }}
|
|
53
|
+
{{- $health := .Values.health_check | default .Values.health }}
|
|
53
54
|
livenessProbe:
|
|
54
|
-
{{- if .
|
|
55
|
+
{{- if $health.liveness.path }}
|
|
55
56
|
httpGet:
|
|
56
|
-
path: {{ .
|
|
57
|
+
path: {{ $health.liveness.path }}
|
|
57
58
|
port: http
|
|
58
59
|
{{- else }}
|
|
59
60
|
tcpSocket:
|
|
60
61
|
port: {{ .Values.port }}
|
|
61
62
|
{{- end }}
|
|
62
63
|
readinessProbe:
|
|
63
|
-
{{- if .
|
|
64
|
+
{{- if $health.readiness.path }}
|
|
64
65
|
httpGet:
|
|
65
|
-
path: {{ .
|
|
66
|
+
path: {{ $health.readiness.path }}
|
|
66
67
|
port: http
|
|
67
68
|
{{- else }}
|
|
68
69
|
tcpSocket:
|
|
69
70
|
port: {{ .Values.port }}
|
|
70
71
|
{{- end }}
|
|
71
72
|
startupProbe:
|
|
72
|
-
{{- if .
|
|
73
|
+
{{- if $health.liveness.path }}
|
|
73
74
|
httpGet:
|
|
74
|
-
path: {{ .
|
|
75
|
+
path: {{ $health.liveness.path }}
|
|
75
76
|
port: http
|
|
76
77
|
{{- else }}
|
|
77
78
|
tcpSocket:
|
|
@@ -96,6 +97,8 @@ spec:
|
|
|
96
97
|
- ALL
|
|
97
98
|
privileged: false
|
|
98
99
|
readOnlyRootFilesystem: false
|
|
100
|
+
seccompProfile:
|
|
101
|
+
type: RuntimeDefault
|
|
99
102
|
restartPolicy: Always
|
|
100
103
|
securityContext:
|
|
101
104
|
runAsNonRoot: true
|