@sap/cds-dk 6.0.4 → 6.1.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 +40 -1
- package/bin/add.js +29 -16
- package/bin/compile/index.js +6 -1
- package/bin/fix-redirects.js +4 -2
- package/bin/init.js +5 -0
- package/bin/login.js +8 -2
- 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/client/activate.js +1 -1
- package/lib/client/auth_manager.js +7 -3
- package/lib/client/extend.js +1 -1
- package/lib/client/helper/cf_helper.js +1 -0
- package/lib/client/helper/url_helper.js +7 -3
- package/lib/client/index.js +1 -1
- package/lib/client/params.js +4 -2
- package/lib/client/pull.js +51 -0
- package/lib/client/push.js +49 -0
- package/lib/client/settings_manager.js +74 -21
- 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 +0 -1
- package/lib/import/odata/v4parser.js +103 -29
- package/lib/import/openapi/importOpenAPI.js +3 -3
- package/lib/init/constants.js +9 -3
- package/lib/init/template/_merging/registry-mta.js +290 -0
- package/lib/init/template/approuter/index.js +22 -32
- package/lib/init/template/auditlog/index.js +7 -9
- 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 +74 -61
- 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 +112 -110
- package/lib/k8s/ChartAdder.js +11 -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/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/k8s/resources/helm/chart/values.schema.json +449 -0
- package/lib/lint/Linter.js +155 -158
- package/lib/lint/io.js +13 -5
- package/npm-shrinkwrap.json +510 -86
- 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
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
{{/*
|
|
2
|
-
|
|
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
|
*/}}
|
|
@@ -45,14 +45,6 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|
|
45
45
|
{{/*
|
|
46
46
|
Image
|
|
47
47
|
*/}}
|
|
48
|
-
{{- define "cap.image.srv" -}}
|
|
49
|
-
{{- if .Values.srv.image.tag -}}
|
|
50
|
-
{{ .Values.srv.image.repository }}:{{ .Values.srv.image.tag }}
|
|
51
|
-
{{- else -}}
|
|
52
|
-
{{ .Values.srv.image.repository }}
|
|
53
|
-
{{- end -}}
|
|
54
|
-
{{- end -}}
|
|
55
|
-
|
|
56
48
|
{{- define "cap.image" -}}
|
|
57
49
|
{{- if .image.tag -}}
|
|
58
50
|
{{ .image.repository }}:{{ .image.tag }}
|
|
@@ -64,14 +56,6 @@ Image
|
|
|
64
56
|
{{/*
|
|
65
57
|
Image Pull Policy
|
|
66
58
|
*/}}
|
|
67
|
-
{{- define "cap.imagePullPolicy.srv" -}}
|
|
68
|
-
{{- if and (.Values.srv.image.tag) (ne .Values.srv.image.tag "latest") -}}
|
|
69
|
-
IfNotPresent
|
|
70
|
-
{{- else -}}
|
|
71
|
-
Always
|
|
72
|
-
{{- end -}}
|
|
73
|
-
{{- end -}}
|
|
74
|
-
|
|
75
59
|
{{- define "cap.imagePullPolicy" -}}
|
|
76
60
|
{{- if and (.image.tag) (ne .image.tag "latest") -}}
|
|
77
61
|
IfNotPresent
|
|
@@ -90,23 +74,6 @@ imagePullSecrets:
|
|
|
90
74
|
{{- end -}}
|
|
91
75
|
{{- end -}}
|
|
92
76
|
|
|
93
|
-
|
|
94
|
-
{{/*
|
|
95
|
-
Binding
|
|
96
|
-
*/}}
|
|
97
|
-
{{- define "cap.binding" -}}
|
|
98
|
-
apiVersion: services.cloud.sap.com/v1alpha1
|
|
99
|
-
kind: ServiceBinding
|
|
100
|
-
metadata:
|
|
101
|
-
name: {{ include "cap.bindingSecretName" $ | quote }}
|
|
102
|
-
namespace: {{ $.Release.Namespace }}
|
|
103
|
-
labels: {{- include "cap.labels" $ | nindent 4 }}
|
|
104
|
-
spec:
|
|
105
|
-
serviceInstanceName: {{ $.Release.Name }}-{{ $.binding.service }}
|
|
106
|
-
externalName: {{ include "cap.bindingSecretName" $ | quote }}
|
|
107
|
-
secretName: {{ include "cap.bindingSecretName" $ | quote }}
|
|
108
|
-
{{- end -}}
|
|
109
|
-
|
|
110
77
|
{{/*
|
|
111
78
|
Service Instance NEW
|
|
112
79
|
ternary dict ($.Files.Get $.service.config | fromJson)
|
|
@@ -6,7 +6,7 @@ SAPCP Service Bindings: volume mounts
|
|
|
6
6
|
{{- $ := . -}}
|
|
7
7
|
{{- range $key, $binding := .bindings }}
|
|
8
8
|
- name: {{ $key | replace "_" "-" }}-secret
|
|
9
|
-
mountPath: /
|
|
9
|
+
mountPath: /bindings/{{ $key }}
|
|
10
10
|
readOnly: true
|
|
11
11
|
{{- end }}
|
|
12
12
|
{{- end }}
|