@sap/cds-dk 6.6.2 → 6.7.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/bin/add.js +5 -3
  3. package/bin/build/all.js +1 -1
  4. package/bin/cds.js +10 -8
  5. package/bin/env.js +4 -6
  6. package/bin/login.js +6 -4
  7. package/bin/migrate.js +0 -1
  8. package/bin/repl.js +1 -1
  9. package/bin/serve.js +7 -0
  10. package/bin/subscribe.js +5 -5
  11. package/bin/unsubscribe.js +4 -5
  12. package/bin/upgrade.js +67 -0
  13. package/bin/watch.js +8 -5
  14. package/lib/bind/bindingManager.js +3 -2
  15. package/lib/bind/cfKeyProvider.js +7 -6
  16. package/lib/bind/userCdsrcJsonStorageProvider.js +5 -4
  17. package/lib/cds.js +12 -0
  18. package/lib/client/activate.js +4 -3
  19. package/lib/client/auth_manager.js +4 -3
  20. package/lib/client/base_command.js +7 -2
  21. package/lib/client/helper/cf_helper.js +12 -11
  22. package/lib/client/helper/dependency_helper.js +3 -2
  23. package/lib/client/helper/logging.js +0 -7
  24. package/lib/client/params.js +4 -2
  25. package/lib/client/settings_manager.js +35 -34
  26. package/lib/client/tenant_action.js +78 -0
  27. package/lib/init/constants.js +1 -1
  28. package/lib/init/index.js +4 -4
  29. package/lib/init/template/_merging/registry-mta.js +31 -46
  30. package/lib/init/template/approuter/files/mta.yaml.hbs +12 -8
  31. package/lib/init/template/approuter/files/xs-app.json.hbs +0 -3
  32. package/lib/init/template/approuter/index.js +26 -34
  33. package/lib/init/template/auditlog/files/mta.yaml.hbs +2 -1
  34. package/lib/init/template/auditlog/index.js +8 -21
  35. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +4 -4
  36. package/lib/init/template/cf-manifest/index.js +2 -1
  37. package/lib/init/template/connectivity/index.js +4 -5
  38. package/lib/init/template/data/index.js +19 -22
  39. package/lib/init/template/destinations/index.js +5 -17
  40. package/lib/init/template/enterprise-messaging/files/mta.yaml.hbs +2 -1
  41. package/lib/init/template/enterprise-messaging/index.js +7 -19
  42. package/lib/init/template/extensibility/index.js +3 -1
  43. package/lib/init/template/hana/files/mta.yaml.hbs +4 -5
  44. package/lib/init/template/hana/index.js +49 -84
  45. package/lib/init/template/helm/chart/templates/_helpers.tpl +4 -1
  46. package/lib/init/template/helm/files/Chart.yaml.hbs +1 -4
  47. package/lib/init/template/helm/index.js +45 -13
  48. package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +21 -31
  49. package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +3 -12
  50. package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +12 -14
  51. package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +27 -4
  52. package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +0 -2
  53. package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +2 -2
  54. package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +2 -2
  55. package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +16 -13
  56. package/lib/init/template/helm/subcharts/web-application/templating.md +16 -9
  57. package/lib/init/template/helm/subcharts/web-application/values.md +317 -379
  58. package/lib/init/template/helm/subcharts/web-application/values.schema.json +87 -107
  59. package/lib/init/template/helm/subcharts/web-application/values.yaml +28 -2
  60. package/lib/init/template/html5-repo/index.js +6 -29
  61. package/lib/init/template/java/index.js +1 -1
  62. package/lib/init/template/kibana-logging/files/mta.yaml.hbs +2 -1
  63. package/lib/init/template/kibana-logging/index.js +5 -8
  64. package/lib/init/template/lint/index.js +8 -8
  65. package/lib/init/template/mta/files/mta.yaml.hbs +3 -2
  66. package/lib/init/template/mta/index.js +3 -2
  67. package/lib/init/template/multitenancy/files/mta.yaml.hbs +25 -31
  68. package/lib/init/template/multitenancy/files/{java/mtxs-configmap.yaml → mtxs-configmap-java.yaml} +1 -1
  69. package/lib/init/template/multitenancy/files/{mtxs-configmap.yaml → mtxs-configmap-nodejs.yaml} +5 -1
  70. package/lib/init/template/multitenancy/files/package.json.hbs +28 -0
  71. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +21 -0
  72. package/lib/init/template/multitenancy/files/values.yaml.hbs +16 -9
  73. package/lib/init/template/multitenancy/index.js +51 -99
  74. package/lib/init/template/nodejs/files/.vscode/extensions.json +1 -2
  75. package/lib/init/template/nodejs/files/.vscode/launch.json +2 -2
  76. package/lib/init/template/nodejs/files/.vscode/tasks.json +2 -2
  77. package/lib/init/template/nodejs/files/package.json.hbs +2 -2
  78. package/lib/init/template/nodejs/index.js +4 -3
  79. package/lib/init/template/pipeline/index.js +3 -2
  80. package/lib/init/template/samples/index.js +5 -4
  81. package/lib/init/template/sqlite/files/package.json.hbs +19 -0
  82. package/lib/init/template/sqlite/index.js +11 -0
  83. package/lib/init/template/toggles/index.js +3 -5
  84. package/lib/init/template/xsuaa/files/mta.yaml.hbs +4 -5
  85. package/lib/init/template/xsuaa/files/values.yaml.hbs +0 -2
  86. package/lib/init/template/xsuaa/index.js +14 -35
  87. package/lib/init/util/commandUtil.js +3 -2
  88. package/lib/init/util/fsUtil.js +19 -2
  89. package/lib/init/util/md5Tracking.js +36 -63
  90. package/lib/init/util/projectReader.js +12 -26
  91. package/lib/lint/Linter.js +0 -3
  92. package/lib/util/exec.js +2 -1
  93. package/lib/util/term.js +1 -1
  94. package/lib/watch/livereload-connect.js +5 -4
  95. package/lib/watch/livereload-server.js +3 -6
  96. package/lib/watch/node-watch.js +1 -1
  97. package/npm-shrinkwrap.json +569 -479
  98. package/package.json +4 -4
  99. package/readme.md +1 -1
  100. package/lib/client/subscription.js +0 -84
  101. package/lib/init/template/approuter/files/chart.yaml +0 -4
  102. package/lib/init/template/auditlog/files/auditlog.yaml +0 -4
  103. package/lib/init/template/destinations/files/destination.yaml +0 -4
  104. package/lib/init/template/enterprise-messaging/files/event-mesh.yaml +0 -4
  105. package/lib/init/template/hana/files/hana-deployer.yaml +0 -4
  106. package/lib/init/template/hana/files/hana.yaml +0 -4
  107. package/lib/init/template/html5-repo/files/html5-apps-deployer.yaml +0 -4
  108. package/lib/init/template/html5-repo/files/html5-apps-repo-host.yaml +0 -4
  109. package/lib/init/template/multitenancy/files/cds.package.json +0 -7
  110. package/lib/init/template/multitenancy/files/cds.package.json.hbs +0 -9
  111. package/lib/init/template/multitenancy/files/dependencies.package.json +0 -5
  112. package/lib/init/template/multitenancy/files/java/.cdsrc.json +0 -22
  113. package/lib/init/template/multitenancy/files/java/package.json +0 -33
  114. package/lib/init/template/multitenancy/files/saas-registry.yaml +0 -4
  115. package/lib/init/template/multitenancy/files/service-manager.yaml +0 -4
  116. package/lib/init/template/multitenancy/files/sidecar.yaml +0 -4
  117. package/lib/init/template/xsuaa/files/xsuaa.yaml +0 -4
@@ -32,10 +32,8 @@ spec:
32
32
  {{- $envFromVars.vars | toYaml | nindent 8}}
33
33
  {{- end }}
34
34
  env:
35
- {{- if .Values.bindings }}
36
35
  - name: SERVICE_BINDING_ROOT
37
36
  value: /bindings
38
- {{- end }}
39
37
  - name: PORT
40
38
  value: {{ .Values.port | quote }}
41
39
  - name: TMPDIR
@@ -52,40 +50,40 @@ spec:
52
50
  - name: APPLICATION_URI
53
51
  value: {{ include "web-application.applicationUri" . }}
54
52
  {{- end }}
55
- {{- $health := .Values.health_check | default .Values.health }}
56
53
  livenessProbe:
57
- {{- if $health.liveness.path }}
54
+ {{- if .Values.health.liveness.path }}
58
55
  httpGet:
59
- path: {{ $health.liveness.path }}
56
+ path: {{ .Values.health.liveness.path }}
60
57
  port: http
61
58
  {{- else }}
62
59
  tcpSocket:
63
60
  port: {{ .Values.port }}
64
61
  {{- end }}
65
62
  readinessProbe:
66
- {{- if $health.readiness.path }}
63
+ {{- if .Values.health.readiness.path }}
67
64
  httpGet:
68
- path: {{ $health.readiness.path }}
65
+ path: {{ .Values.health.readiness.path }}
69
66
  port: http
70
67
  {{- else }}
71
68
  tcpSocket:
72
69
  port: {{ .Values.port }}
73
70
  {{- end }}
74
71
  startupProbe:
75
- {{- if $health.liveness.path }}
72
+ {{- if .Values.health.liveness.path }}
76
73
  httpGet:
77
- path: {{ $health.liveness.path }}
74
+ path: {{ .Values.health.liveness.path }}
78
75
  port: http
79
76
  {{- else }}
80
77
  tcpSocket:
81
78
  port: {{ .Values.port }}
82
79
  {{- end }}
83
- {{- $startupTimeout := .Values.startupTimeout | default .Values.startupTimeoutSeconds }}
84
- failureThreshold: {{ div (add1 $startupTimeout) 2 }}
80
+ failureThreshold: {{ div (add1 .Values.startupTimeoutSeconds) 2 }}
85
81
  periodSeconds: 2
86
82
  volumeMounts:
87
83
  - name: tmp
88
84
  mountPath: /tmp
85
+ - name: bindings-root
86
+ mountPath: /bindings
89
87
  {{- range $volume := .Values.additionalVolumes }}
90
88
  - name: {{ $volume.name | quote }}
91
89
  {{- toYaml $volume.volumeMount | nindent 10 }}
@@ -99,14 +97,13 @@ spec:
99
97
  drop:
100
98
  - ALL
101
99
  privileged: false
102
- readOnlyRootFilesystem: false
100
+ readOnlyRootFilesystem: {{ .Values.readOnlyRootFilesystem | default false }}
103
101
  seccompProfile:
104
102
  type: RuntimeDefault
105
103
  restartPolicy: Always
106
104
  terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
107
105
  securityContext:
108
106
  runAsNonRoot: true
109
- {{- if (include "web-application.ha" .) }}
110
107
  topologySpreadConstraints:
111
108
  {{- range $constraint := .Values.availability.topologySpreadConstraints }}
112
109
  - labelSelector:
@@ -115,10 +112,11 @@ spec:
115
112
  topologyKey: {{ $constraint.topologyKey }}
116
113
  whenUnsatisfiable: {{ $constraint.whenUnsatisfiable }}
117
114
  {{- end }}
118
- {{- end }}
119
115
  volumes:
120
116
  - emptyDir: {}
121
117
  name: tmp
118
+ - emptyDir: {}
119
+ name: bindings-root
122
120
  {{- include "web-application.serviceVolumes" . | nindent 6 }}
123
121
  {{- range $volume := .Values.additionalVolumes }}
124
122
  -
@@ -1,18 +1,41 @@
1
- apiVersion: networking.k8s.io/v1
1
+ {{- if .Values.networkSecurity.enabled -}}
2
2
  kind: NetworkPolicy
3
+ apiVersion: networking.k8s.io/v1
3
4
  metadata:
4
5
  name: {{ include "web-application.fullname" . }}
5
6
  labels: {{- include "web-application.labels" . | nindent 4 }}
6
7
  spec:
7
8
  ingress:
9
+ {{- if .Values.expose.enabled }}
8
10
  - from:
9
11
  - podSelector:
10
12
  matchLabels:
11
13
  app: istio-ingressgateway
12
14
  namespaceSelector:
13
15
  matchLabels:
14
- name: istio-system
15
- podSelector:
16
- matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
16
+ kubernetes.io/metadata.name: istio-system
17
+ {{- end }}
18
+ {{- if .Values.networkSecurity.allowNamespaceInternal }}
19
+ - from:
20
+ - podSelector: {}
21
+ {{- end }}
22
+ {{- range $netRule := .Values.networkSecurity.ingress }}
23
+ - from:
24
+ -
25
+ {{- if $netRule.namespace }}
26
+ namespaceSelector:
27
+ matchLabels:
28
+ kubernetes.io/metadata.name: {{ tpl $netRule.namespace $ }}
29
+ {{- end }}
30
+ {{- if $netRule.podLabelsSelector }}
31
+ podSelector:
32
+ matchLabels: {{ tpl ($netRule.podLabelsSelector | toYaml) $ | nindent 10 }}
33
+ {{- else }}
34
+ podSelector: {}
35
+ {{- end }}
36
+ {{- end }}
17
37
  policyTypes:
18
38
  - Ingress
39
+ podSelector:
40
+ matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
41
+ {{- end }}
@@ -1,4 +1,3 @@
1
- {{- if (include "web-application.ha" .) }}
2
1
  apiVersion: policy/v1
3
2
  kind: PodDisruptionBudget
4
3
  metadata:
@@ -8,4 +7,3 @@ spec:
8
7
  maxUnavailable: {{ .Values.availability.podDisruptionBudget.maxUnavailable }}
9
8
  selector:
10
9
  matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
11
- {{- end }}
@@ -1,4 +1,4 @@
1
- {{ if or .Values.imagePullSecret.dockerconfigjson .Values.global.imagePullSecret.dockerconfigjson }}
1
+ {{- if or .Values.imagePullSecret.dockerconfigjson .Values.global.imagePullSecret.dockerconfigjson -}}
2
2
  apiVersion: v1
3
3
  kind: Secret
4
4
  type: kubernetes.io/dockerconfigjson
@@ -7,4 +7,4 @@ metadata:
7
7
  labels: {{- include "web-application.labels" . | nindent 4 }}
8
8
  data:
9
9
  .dockerconfigjson: {{ default .Values.global.imagePullSecret.dockerconfigjson .Values.imagePullSecret.dockerconfigjson }}
10
- {{- end -}}
10
+ {{- end }}
@@ -1,6 +1,6 @@
1
- {{if not .Values.serviceAccountName}}
1
+ {{- if not .Values.serviceAccountName -}}
2
2
  apiVersion: v1
3
3
  kind: ServiceAccount
4
4
  metadata:
5
5
  name: {{ include "web-application.fullname" . }}
6
- {{end}}
6
+ {{- end }}
@@ -1,5 +1,8 @@
1
- {{- range $name, $params := .Values.bindings }}
2
- {{- if not $params.fromSecret }}
1
+ {{- $bindings := omit .Values.bindings "defaultProperties" -}}
2
+ {{- range $name, $params := $bindings }}
3
+ {{- $defaultProperties := deepCopy $.Values.bindings.defaultProperties -}}
4
+ {{- $mergedParams := (deepCopy $params | mergeOverwrite $defaultProperties ) -}}
5
+ {{- if not $mergedParams.fromSecret }}
3
6
  ---
4
7
  apiVersion: services.cloud.sap.com/v1
5
8
  kind: ServiceBinding
@@ -7,22 +10,22 @@ metadata:
7
10
  name: {{ include "web-application.bindingName" (dict "root" $ "name" $name) }}
8
11
  labels: {{- include "web-application.labels" $ | nindent 4 }}
9
12
  spec:
10
- serviceInstanceName: {{include "web-application.serviceInstanceName" (dict "binding" $params "root" $) }}
13
+ serviceInstanceName: {{include "web-application.serviceInstanceName" (dict "binding" $mergedParams "root" $) }}
11
14
  secretKey: credentials
12
- {{- if $params.externalName }}
13
- externalName: {{ $params.externalName }}
15
+ {{- if $mergedParams.externalName }}
16
+ externalName: {{ $mergedParams.externalName }}
14
17
  {{- end }}
15
- {{- if $params.secretName }}
16
- secretName: {{ tpl $params.secretName $ }}
18
+ {{- if $mergedParams.secretName }}
19
+ secretName: {{ tpl $mergedParams.secretName $ }}
17
20
  {{- end }}
18
- {{- if $params.parameters }}
19
- parameters: {{ $params.parameters | toYaml | nindent 4 }}
21
+ {{- if $mergedParams.parameters }}
22
+ parameters: {{ $mergedParams.parameters | toYaml | nindent 4 }}
20
23
  {{- end }}
21
- {{- if $params.parametersFrom }}
22
- parametersFrom: {{ tpl ($params.parametersFrom | toYaml) $ | nindent 4 }}
24
+ {{- if $mergedParams.parametersFrom }}
25
+ parametersFrom: {{ tpl ($mergedParams.parametersFrom | toYaml) $ | nindent 4 }}
23
26
  {{- end }}
24
- {{- if $params.credentialsRotationPolicy }}
25
- credentialsRotationPolicy: {{ $params.credentialsRotationPolicy | toYaml | nindent 4 }}
27
+ {{- if $mergedParams.credentialsRotationPolicy }}
28
+ credentialsRotationPolicy: {{ $mergedParams.credentialsRotationPolicy | toYaml | nindent 4 }}
26
29
  {{- end }}
27
30
  {{- end }}
28
31
  {{- end }}
@@ -20,17 +20,24 @@ env:
20
20
  name: my-configmap-{{ .Release.Name }}
21
21
  key: my-key
22
22
  envFrom:
23
- - configMapRef:
24
- name: my-configmap1-{{ .Release.Name }}
25
- - secretRef:
23
+ - configMapRef:
24
+ name: my-configmap1-{{ .Release.Name }}
25
+ - secretRef:
26
26
  name: my-secret-ref1-{{ .Release.Name }}
27
27
  additionalVolumes:
28
- - name: my-volume
29
- secret:
30
- secretName: my-secret-{{ .Release.Name }}
31
- volumeMount:
32
- mountPath: /etc/mysecret
33
- readOnly: true
28
+ - name: my-volume
29
+ secret:
30
+ secretName: my-secret-{{ .Release.Name }}
31
+ volumeMount:
32
+ mountPath: /etc/mysecret
33
+ readOnly: true
34
+ expose:
35
+ host: "{{ .Release.Name }}-app"
36
+ networkSecurity:
37
+ ingress:
38
+ - namespace: "{{ .Release.Namespace }}"
39
+ podLabelsSelector:
40
+ app: "{{ .Release.Name }}-my-app"
34
41
  bindings:
35
42
  hana:
36
43
  serviceInstanceName: hana-{{ .Release.Name }}