@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.
- package/CHANGELOG.md +62 -0
- package/bin/add.js +29 -16
- package/bin/compile/index.js +7 -2
- package/bin/fix-redirects.js +4 -2
- package/bin/init.js +5 -0
- package/bin/login.js +20 -4
- package/bin/pull.js +58 -0
- package/bin/push.js +52 -0
- package/bin/subscribe.js +45 -0
- package/lib/bind/bindingUtil.js +1 -2
- package/lib/bind/cfKeyProvider.js +3 -3
- package/lib/cds.js +2 -3
- package/lib/client/activate.js +17 -16
- package/lib/client/auth_manager.js +10 -5
- package/lib/client/base_command.js +4 -6
- package/lib/client/extend.js +3 -2
- package/lib/client/helper/cf_helper.js +1 -0
- package/lib/client/helper/errors.js +11 -0
- package/lib/client/helper/logging.js +3 -10
- package/lib/client/helper/url_helper.js +7 -3
- package/lib/client/index.js +1 -1
- package/lib/client/params.js +9 -6
- package/lib/client/pull.js +48 -0
- package/lib/client/push.js +45 -0
- package/lib/client/settings_manager.js +81 -27
- package/lib/compile/openapi/csdl2openapi.js +135 -163
- package/lib/compile/openapi/index.js +0 -1
- package/lib/import/common.js +9 -1
- package/lib/import/odata/metadataconverter/MetadataConverter.js +17 -4
- package/lib/import/odata/v2parser.js +50 -26
- package/lib/import/odata/v4parser.js +110 -29
- package/lib/import/openapi/importOpenAPI.js +3 -3
- package/lib/init/constants.js +9 -3
- package/lib/init/template/_merging/registry-mta.js +284 -0
- package/lib/init/template/approuter/files/xs-app.json.hbs +7 -7
- package/lib/init/template/approuter/index.js +22 -32
- package/lib/init/template/auditlog/index.js +7 -9
- package/lib/init/template/data/index.js +2 -4
- package/lib/init/template/extensibility/files/cds.package.json +7 -0
- package/lib/init/template/extensibility/files/cds.package.json.hbs +9 -0
- package/lib/init/template/extensibility/files/xs-security.json.hbs +26 -0
- package/lib/init/template/extensibility/index.js +48 -0
- package/lib/init/template/hana/files/java/cdsrc.json.hbs +1 -1
- package/lib/init/template/hana/files/java/profile.cdsrc.json.hbs +2 -2
- package/lib/init/template/hana/files/mta.yaml.hbs +10 -0
- package/lib/init/template/hana/files/nodejs/cds.package.json.hbs +1 -1
- package/lib/init/template/hana/files/nodejs/cds.profile.package.json.hbs +2 -2
- package/lib/init/template/hana/index.js +76 -63
- package/lib/init/template/kibana-logging/index.js +31 -37
- package/lib/init/template/lint/files/.eslint/rules/no-entity-moo.js +14 -14
- package/lib/init/template/mta/files/mta.yaml.hbs +1 -1
- package/lib/init/template/mta/index.js +13 -7
- package/lib/init/template/mtx/index.js +2 -142
- package/lib/init/template/multitenancy/files/cds.package.json +7 -0
- package/lib/init/template/multitenancy/files/cds.package.json.hbs +9 -0
- package/lib/init/template/{mtx → multitenancy}/files/dependencies.package.json +1 -1
- package/lib/init/template/multitenancy/files/java/.cdsrc.json +19 -0
- package/lib/init/template/multitenancy/files/java/package.json +31 -0
- package/lib/init/template/{mtx → multitenancy}/files/mta.yaml.hbs +13 -6
- package/lib/init/template/multitenancy/files/xs-security.json.hbs +18 -0
- package/lib/init/template/multitenancy/index.js +109 -0
- package/lib/init/template/nodejs/files/package.json.hbs +3 -0
- package/lib/init/template/templateBase.js +2 -1
- package/lib/init/template/toggles/files/cds.package.json +7 -0
- package/lib/init/template/toggles/files/cds.package.json.hbs +9 -0
- package/lib/init/template/toggles/index.js +24 -0
- package/lib/init/template/xsuaa/files/mta.yaml.hbs +10 -0
- package/lib/init/template/xsuaa/index.js +44 -33
- package/lib/init/util/projectReader.js +12 -7
- package/lib/init/util/templateUtil.js +113 -111
- package/lib/k8s/ChartAdder.js +13 -3
- package/lib/k8s/ChartBuilder.js +6 -0
- package/lib/k8s/buildModel.js +1 -3
- package/lib/k8s/connectivity/index.js +5 -5
- package/lib/k8s/deployment/index.js +2 -4
- package/lib/k8s/deployment/subchart/Chart.yaml +1 -1
- package/lib/k8s/deployment/subchart/templates/_helpers.tpl +22 -11
- package/lib/k8s/deployment/subchart/templates/deployment.yaml +12 -5
- package/lib/k8s/deployment/subchart/templates/network-policy.yaml +3 -1
- package/lib/k8s/deployment/subchart/templates/pod-disruption-budget.yaml +1 -1
- package/lib/k8s/deployment/subchart/values.md +812 -0
- package/lib/k8s/deployment/subchart/values.schema.json +125 -30
- package/lib/k8s/deployment/subchart/values.yaml +7 -3
- package/lib/k8s/hana-deployer/index.js +10 -0
- package/lib/k8s/hana-deployer/templates/hana-deployer-job.yaml +8 -0
- package/lib/k8s/html5-apps-deployer/index.js +10 -0
- package/lib/k8s/html5-apps-deployer/templates/html5-apps-deployer-job.yaml +8 -0
- package/lib/k8s/index.js +2 -2
- package/lib/k8s/resources/helm/chart/schemas/values.root.schema.json +11 -0
- package/lib/k8s/resources/helm/chart/schemas/values.schema.json +479 -0
- package/lib/k8s/resources/helm/chart/templates/_deployment_helpers.tpl +1 -159
- package/lib/k8s/resources/helm/chart/templates/_helpers.tpl +0 -33
- package/lib/k8s/resources/helm/chart/templates/_sapcp_helpers.tpl +1 -1
- package/lib/lint/Linter.js +155 -158
- package/lib/lint/io.js +12 -5
- package/npm-shrinkwrap.json +1052 -135
- package/package.json +5 -4
- package/lib/init/template/_merging/existences.js +0 -297
- package/lib/init/template/mtx/files/cds.package.json +0 -12
- package/lib/init/template/mtx/files/cds.package.json.hbs +0 -14
- package/lib/init/template/mtx/files/java/.cdsrc.json +0 -17
- package/lib/init/template/mtx/files/java/package.json +0 -43
- package/lib/init/template/mtx/files/java/server.js +0 -30
- package/lib/init/template/mtx/files/xs-security.json.hbs +0 -48
- package/lib/lint/.eslintrc.js +0 -3
|
@@ -50,12 +50,12 @@ module.exports = wrapFeature('connectivity', {
|
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
|
|
53
|
-
mergeSemantics.
|
|
53
|
+
mergeSemantics.additions.push({
|
|
54
54
|
ref: `{name}-additional-volumes`,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
in: `${name}.additionalVolumes`,
|
|
56
|
+
where: [{
|
|
57
|
+
property: 'name',
|
|
58
|
+
isEqualTo: 'connectivity-secret'
|
|
59
59
|
}]
|
|
60
60
|
});
|
|
61
61
|
},
|
|
@@ -19,7 +19,7 @@ class Deployment {
|
|
|
19
19
|
|
|
20
20
|
const language = this.language || model.language;
|
|
21
21
|
const memory = language === 'Java' ? '1G' : '500M';
|
|
22
|
-
const cpu = language === 'Java' ? '
|
|
22
|
+
const cpu = language === 'Java' ? '1000m' : '500m';
|
|
23
23
|
const env = language === 'Java' ? {SPRING_PROFILES_ACTIVE: "cloud"} : undefined;
|
|
24
24
|
|
|
25
25
|
return {
|
|
@@ -32,12 +32,11 @@ class Deployment {
|
|
|
32
32
|
env,
|
|
33
33
|
resources: {
|
|
34
34
|
limits: {
|
|
35
|
-
cpu,
|
|
36
35
|
'ephemeral-storage': '1G',
|
|
37
36
|
memory
|
|
38
37
|
},
|
|
39
38
|
requests: {
|
|
40
|
-
cpu
|
|
39
|
+
cpu,
|
|
41
40
|
'ephemeral-storage': '1G',
|
|
42
41
|
memory
|
|
43
42
|
}
|
|
@@ -64,7 +63,6 @@ class Deployment {
|
|
|
64
63
|
|
|
65
64
|
async addToChart(builder) {
|
|
66
65
|
await builder.addSubchartFiles(webApplicationChartPath, 'web-application');
|
|
67
|
-
await builder.addChartFile(Path.join(__dirname, 'subchart-override', 'templates', '_web_application_helpers.tpl'), {fileName: Path.join('charts', 'web-application', 'templates', '_web_application_helpers.tpl')});
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
|
|
@@ -81,13 +81,20 @@ Define Host for the APIRule
|
|
|
81
81
|
{{- end }}
|
|
82
82
|
{{- end }}
|
|
83
83
|
|
|
84
|
+
{{/*
|
|
85
|
+
Define the application uri which will be used for the VCAP_APPLICATION env variable
|
|
86
|
+
*/}}
|
|
87
|
+
{{- define "web-application.applicationUri" -}}
|
|
88
|
+
{{- include "web-application.fullname" . }}
|
|
89
|
+
{{- end }}
|
|
90
|
+
|
|
84
91
|
{{/*
|
|
85
92
|
Service Binding secret mounts
|
|
86
93
|
*/}}
|
|
87
94
|
{{- define "web-application.serviceMounts" -}}
|
|
88
95
|
{{- range $name, $params := .Values.bindings }}
|
|
89
96
|
- mountPath: /bindings/{{ $name }}/
|
|
90
|
-
name: "{{ $name }}
|
|
97
|
+
name: "{{ $name }}"
|
|
91
98
|
readOnly: true
|
|
92
99
|
{{- end }}
|
|
93
100
|
{{- end }}
|
|
@@ -103,18 +110,9 @@ Service Binding secret volumes
|
|
|
103
110
|
{{- else if $params.secretName }}
|
|
104
111
|
{{- $secretName = $params.secretName }}
|
|
105
112
|
{{- end }}
|
|
106
|
-
- name: {{ $name }}
|
|
113
|
+
- name: {{ $name }}
|
|
107
114
|
secret:
|
|
108
115
|
secretName: {{ $secretName }}
|
|
109
|
-
items:
|
|
110
|
-
- key: label
|
|
111
|
-
path: metadata/label
|
|
112
|
-
- key: plan
|
|
113
|
-
path: metadata/plan
|
|
114
|
-
- key: tags
|
|
115
|
-
path: metadata/tags
|
|
116
|
-
- key: credentials
|
|
117
|
-
path: credentials
|
|
118
116
|
{{- end }}
|
|
119
117
|
{{- end }}
|
|
120
118
|
|
|
@@ -132,6 +130,19 @@ Name of the imagePullSecret
|
|
|
132
130
|
{{- end }}
|
|
133
131
|
{{- end }}
|
|
134
132
|
|
|
133
|
+
{{/*
|
|
134
|
+
Calculate the final image name
|
|
135
|
+
*/}}
|
|
136
|
+
{{- define "web-application.imageName" -}}
|
|
137
|
+
{{- $tag := .Values.image.tag | default .Values.global.image.tag | default "latest" }}
|
|
138
|
+
{{- $registry := .Values.image.registry | default .Values.global.image.registry }}
|
|
139
|
+
{{- if $registry }}
|
|
140
|
+
{{- $registry | trimSuffix "/" }}/{{ .Values.image.repository }}:{{ $tag }}
|
|
141
|
+
{{- else }}
|
|
142
|
+
{{- .Values.image.repository }}:{{ $tag }}
|
|
143
|
+
{{- end }}
|
|
144
|
+
{{- end }}
|
|
145
|
+
|
|
135
146
|
{{/*
|
|
136
147
|
Create the name of a service instance.
|
|
137
148
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
@@ -18,7 +18,7 @@ spec:
|
|
|
18
18
|
automountServiceAccountToken: false
|
|
19
19
|
serviceAccountName: {{ .Values.serviceAccountName }}
|
|
20
20
|
containers:
|
|
21
|
-
- image:
|
|
21
|
+
- image: {{ include "web-application.imageName" . }}
|
|
22
22
|
name: {{ include "web-application.name" . }}
|
|
23
23
|
ports:
|
|
24
24
|
- name: http
|
|
@@ -30,10 +30,17 @@ spec:
|
|
|
30
30
|
name: {{ $secretName }}
|
|
31
31
|
{{- end }}
|
|
32
32
|
env:
|
|
33
|
-
{{- include "cap.web-application.env" . | indent 8 }}
|
|
34
33
|
{{- range $k, $v := .Values.env }}
|
|
35
34
|
- name: {{ $k }}
|
|
36
|
-
value: {{
|
|
35
|
+
value: {{ $v | quote }}
|
|
36
|
+
{{- end }}
|
|
37
|
+
{{- if not .Values.env.APPLICATION_NAME }}
|
|
38
|
+
- name: APPLICATION_NAME
|
|
39
|
+
value: {{ include "web-application.fullname" . }}
|
|
40
|
+
{{- end }}
|
|
41
|
+
{{- if not .Values.env.APPLICATION_URI }}
|
|
42
|
+
- name: APPLICATION_URI
|
|
43
|
+
value: {{ include "web-application.applicationUri" . }}
|
|
37
44
|
{{- end }}
|
|
38
45
|
{{- if .Values.bindings }}
|
|
39
46
|
- name: SERVICE_BINDING_ROOT
|
|
@@ -79,7 +86,7 @@ spec:
|
|
|
79
86
|
- name: {{ $volume.name | quote }}
|
|
80
87
|
{{- toYaml $volume.volumeMount | nindent 10 }}
|
|
81
88
|
{{- end }}
|
|
82
|
-
{{- include "
|
|
89
|
+
{{- include "web-application.serviceMounts" . | nindent 8 }}
|
|
83
90
|
resources:
|
|
84
91
|
{{- toYaml .Values.resources | nindent 10 }}
|
|
85
92
|
securityContext:
|
|
@@ -103,7 +110,7 @@ spec:
|
|
|
103
110
|
volumes:
|
|
104
111
|
- emptyDir: {}
|
|
105
112
|
name: tmp
|
|
106
|
-
{{- include "
|
|
113
|
+
{{- include "web-application.serviceVolumes" . | nindent 6 }}
|
|
107
114
|
{{- range $volume := .Values.additionalVolumes }}
|
|
108
115
|
-
|
|
109
116
|
{{- omit $volume "volumeMount" | toYaml | nindent 8 }}
|
|
@@ -9,7 +9,9 @@ spec:
|
|
|
9
9
|
- podSelector:
|
|
10
10
|
matchLabels:
|
|
11
11
|
app: istio-ingressgateway
|
|
12
|
-
namespaceSelector:
|
|
12
|
+
namespaceSelector:
|
|
13
|
+
matchLabels:
|
|
14
|
+
name: istio-system
|
|
13
15
|
podSelector:
|
|
14
16
|
matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
|
|
15
17
|
policyTypes:
|