@sap/cds-dk 8.5.1 → 8.6.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 (50) hide show
  1. package/CHANGELOG.md +29 -3
  2. package/bin/cds.js +2 -3
  3. package/bin/deploy/index.js +9 -11
  4. package/bin/import.js +6 -2
  5. package/bin/repl.js +82 -56
  6. package/lib/bind/cfKeyProvider.js +4 -3
  7. package/lib/bind/index.js +1 -1
  8. package/lib/build/buildTaskEngine.js +1 -1
  9. package/lib/build/plugins/helm/files/subcharts/content-deployment/Chart.yaml +3 -1
  10. package/lib/build/plugins/helm/files/subcharts/content-deployment/templates/_helpers.tpl +3 -5
  11. package/lib/build/plugins/helm/files/subcharts/content-deployment/values.schema.json +1 -16
  12. package/lib/build/plugins/helm/files/subcharts/content-deployment/values.yaml +6 -7
  13. package/lib/build/plugins/helm/files/subcharts/web-application/Chart.yaml +3 -1
  14. package/lib/build/plugins/helm/files/subcharts/web-application/templates/_helpers.tpl +25 -5
  15. package/lib/build/plugins/helm/files/subcharts/web-application/templates/api-rule.yaml +13 -4
  16. package/lib/build/plugins/helm/files/subcharts/web-application/templates/service-binding.yaml +6 -1
  17. package/lib/build/plugins/helm/files/subcharts/web-application/values.schema.json +55 -48
  18. package/lib/build/plugins/helm/files/subcharts/web-application/values.yaml +19 -7
  19. package/lib/build/util.js +3 -1
  20. package/lib/import/common.js +2 -2
  21. package/lib/init/constants.js +3 -1
  22. package/lib/init/index.js +10 -0
  23. package/lib/init/registries/mta.js +7 -1
  24. package/lib/init/template/ams/files/Chart.yaml.hbs +4 -0
  25. package/lib/init/template/ams/files/containerize.yaml.hbs +20 -0
  26. package/lib/init/template/ams/files/manifest.yml.hbs +24 -0
  27. package/lib/init/template/ams/files/mta.yaml.hbs +31 -0
  28. package/lib/init/template/ams/files/package.json.hbs +10 -0
  29. package/lib/init/template/ams/files/values.yaml.hbs +13 -0
  30. package/lib/init/template/ams/index.js +80 -0
  31. package/lib/init/template/approuter/files/mta.yaml.hbs +6 -4
  32. package/lib/init/template/approuter/files/package.json +1 -1
  33. package/lib/init/template/helm/files/values.schema.json +0 -2079
  34. package/lib/init/template/http/index.js +10 -8
  35. package/lib/init/template/ias/files/Chart.yaml.hbs +4 -0
  36. package/lib/init/template/ias/files/manifest.yml.hbs +8 -0
  37. package/lib/init/template/ias/files/mta.yaml.hbs +61 -0
  38. package/lib/init/template/ias/files/package.json.hbs +22 -0
  39. package/lib/init/template/ias/files/services-manifest.yml.hbs +6 -0
  40. package/lib/init/template/ias/files/values.yaml.hbs +52 -0
  41. package/lib/init/template/ias/index.js +71 -0
  42. package/lib/init/template/mta/files/mta.yaml.hbs +15 -1
  43. package/lib/init/template/multitenancy/files/mta.yaml.hbs +38 -5
  44. package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +5 -2
  45. package/lib/init/template/multitenancy/index.js +40 -31
  46. package/lib/init/template/xsuaa/index.js +1 -1
  47. package/lib/util/cf.js +4 -4
  48. package/lib/util/command.js +1 -9
  49. package/npm-shrinkwrap.json +115 -91
  50. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,15 +7,41 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  The format is based on [Keep a Changelog](https://keepachangelog.com/).
9
9
 
10
- ## Version 8.5.1 - 2024-12-05
10
+ ## Version 8.6.1 - 2024-12-18
11
+
12
+ ### Fixed
13
+
14
+ - `cds add ams` now creates correct dependencies for Java projects.
15
+
16
+ ## Version 8.6.0 - 2024-12-17
11
17
 
12
18
  ### Added
13
19
 
20
+ - `cds repl` got new option `--run` to run a server; also available through `.run` command within the REPL.
21
+ - `cds repl` got new option `--use` to make the features of a `cds` available as globals.
22
+ - `cds repl` got new builtin `.inspect` command to inspect object with configurable depth, e.g. `.inspect cds .depth=1`.
14
23
  - `cds watch` now detects a TypeScript project and tries to run with `tsx` if this is installed locally or globally. Otherwise a warning message is emitted. `CDS_TYPESCRIPT=false` can be used to opt out of this behavior.
24
+ - `cds import --group` to allow RFC importer to organize imported modules under a logical name.
25
+ - `cds init/add` for Java projects automatically create a `package-lock.json`.
26
+ - `cds add ias` adds IAS configuration (beta).
27
+ - `cds add ams` adds AMS configuration (beta).
28
+
29
+ ### Changed
30
+
31
+ - Running `cds init` in the user's home dir w/o a project name now fails. This is to prevent creation of configuration that would act as global (user) configuration leading to follow-up problems with later projects.
15
32
 
16
33
  ### Fixed
17
34
 
18
35
  - `cds add html5-repo` adds an `index.html` as `welcomePage` to the `xs-app.json`, if available.
36
+ - `cds bind` fixes the recursive call to `mergeCredentials`.
37
+ - `cds add` won't add a duplicated `SUBSCRIPTION_URL` if it doesn't match the template specification.
38
+ - `cds watch` gives a better error message for TypeScript projects started with if `tsx` isn't installed.
39
+ - `cds build` no longer throws an undefined error when processing build plugin messages.
40
+
41
+ ## Version 8.5.1 - 2024-12-05
42
+
43
+ ### Fixed
44
+
19
45
  - `cds build` now logs existing plugin build messages if a BuildError is thrown.
20
46
 
21
47
  ## Version 8.5.0 - 2024-11-26
@@ -34,8 +60,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
34
60
  - The existing `cds watch --debug` is now an alias to `cds watch --inspect`.
35
61
  - `cds add cloud-logging` adds cloud-logging as an alternative for application logging in Kyma.
36
62
  - `cds add cloud-logging --with-telemetry` or `cds add telemetry` adds cloud-logging as well as support for `cap-js/telemetry` plugin in Kyma.
37
- - `cds add handler` now also works for Node.js projects. It creates an implementation file for each service with event handlers for all entites and actions.
38
- - `cds add esm` creates ESM-compatible Node.js projects. Sample code added by `add sample` and `add handler` will respect this setting if added aftwards. Existing code will not be adjusted by `cds add esm`, though.
63
+ - `cds add handler` now also works for Node.js projects. It creates an implementation file for each service with event handlers for all entities and actions.
64
+ - `cds add esm` creates ESM-compatible Node.js projects. Sample code added by `add sample` and `add handler` will respect this setting if added afterwards. Existing code will not be adjusted by `cds add esm`, though.
39
65
 
40
66
  ### Fixed
41
67
 
package/bin/cds.js CHANGED
@@ -279,9 +279,8 @@ function _prepareTsIfNeeded(cds) {
279
279
  }
280
280
  catch (e) {
281
281
  if (e.code !== 'MODULE_NOT_FOUND') throw e
282
- // cds.root may for some subcommands not point to the correct directory (e.g. cds w where users can pass a project directory)
283
- // showing the full detected path should give the user an idea whether this info is relevant for them
284
- console.error(`Detected ${tsconfig}. If this is a TypeScript project, consider running commands using 'cds-ts' or 'cds-tsx' instead of 'cds'.\n`)
282
+ console.error(`Error: detected ${tsconfig}, but could not run with 'tsx'. Enable Typescript with\n npm install -D tsx typescript\n`)
283
+ DEBUG && console.error(e)
285
284
  }
286
285
  }
287
286
  }
@@ -78,22 +78,20 @@ module.exports = Object.assign(deploy, {
78
78
 
79
79
  *--model-only*
80
80
 
81
- This is a schema evolution option, to only update the information about
82
- the prior cds model. In combination with *--dry* it writes the CSN to
83
- stdout, so you can store it to a file. Use that to migrate existing
84
- databases to auto schema evolution.
81
+ Schema evolution: only update the information about the prior cds model.
82
+ In combination with *--dry* it writes the CSN to stdout, so you can store it to a file.
83
+ Use that to migrate existing databases to auto schema evolution.
85
84
 
86
85
  *--delta-from* <filename>
87
86
 
88
- This is a schema evolution option, to read the information about the
89
- prior cds model from the given file, which has been created by
90
- *cds deploy --model-only --dry*. When used with *--dry* it writes the
91
- generated SQL to stdout.
87
+ Schema evolution: read the information about the prior cds model from the given file,
88
+ which has been created by *cds deploy --model-only --dry*. When used with *--dry* it writes
89
+ the generated SQL to stdout.
92
90
 
93
- *--script
91
+ *--script*
94
92
 
95
- This is a schema evolution option to be used with --delta-from to generate
96
- a script of SQL statements to then check and execute manually or for usage with tools such as LiquiBase.
93
+ Schema evolution: together with *--delta-from* generate a script of SQL
94
+ statements to then check and execute manually or for usage with tools such as LiquiBase.
97
95
  This script might contain potentially lossy statements!
98
96
 
99
97
 
package/bin/import.js CHANGED
@@ -1,8 +1,8 @@
1
1
  module.exports = Object.assign(_import, {
2
2
  _name: 'import',
3
- options: ['--out', '--as', '--name', '--include-namespaces', '--from', '--config', '--destination'],
3
+ options: ['--out', '--as', '--name', '--include-namespaces', '--from', '--config', '--destination', '--group'],
4
+ shortcuts: ['-o', '-as', '-n', '-ns', undefined, '-c', undefined, undefined, '-', '-f'],
4
5
  flags: ['--dry', '--force', '--no-copy', '--no-save', '--keep-namespace', '--beta'],
5
- shortcuts: ['-o', '-as', '-n', '-ns', undefined, '-c', undefined, '-', '-f'],
6
6
  help: `
7
7
  # SYNOPSIS
8
8
 
@@ -72,6 +72,10 @@ module.exports = Object.assign(_import, {
72
72
  The name of the module to be imported
73
73
  Requires valid system credentials as the import connects to the system to fetch the metadata.
74
74
 
75
+ *--group*
76
+ Logical group under which the remote service is imported and registered. This could be a
77
+ function group or an application component name. Defaults to the destination name.
78
+
75
79
  # EXAMPLES
76
80
 
77
81
  cds import ~/Downloads/API_BUSINESS_PARTNER.edmx
package/bin/repl.js CHANGED
@@ -1,13 +1,35 @@
1
-
2
- module.exports = Object.assign (repl, { options: [], help: `
1
+ module.exports = Object.assign (repl, {
2
+ options: [ '--run', '--use' ],
3
+ shortcuts: [ '-r', '-u' ],
4
+ help: `
3
5
  # SYNOPSIS
4
6
 
5
- *cds r | repl*
7
+ *cds repl* [ <options> ]
6
8
 
7
9
  Launches into a read-eval-print-loop, an interactive playground to
8
10
  experiment with cds' JavaScript APIs. See documentation of Node.js'
9
11
  REPL for details at _http://nodejs.org/api/repl.html_
10
12
 
13
+ # OPTIONS
14
+
15
+ *-r | --run* <project>
16
+
17
+ Runs a cds server from a given CAP project folder, or module name.
18
+ You can then access the entities and services of the running server.
19
+ It's the same as using the repl's builtin _.run_ command.
20
+
21
+ *-u | --use* <cds feature>
22
+
23
+ Loads the given cds feature into the repl's global context. For example,
24
+ if you specify _xl_ it makes the _cds.xl_ module's methods available.
25
+ It's the same as doing _{ref,val,xpr,...} = cds.xl_ within the repl.
26
+
27
+ # EXAMPLES
28
+
29
+ *cds repl* --run bookshop
30
+ *cds repl* --run .
31
+ *cds repl* --use cds.ql
32
+
11
33
  # SEE ALSO
12
34
 
13
35
  *cds eval* to evaluate and execute JavaScript.
@@ -15,6 +37,7 @@ module.exports = Object.assign (repl, { options: [], help: `
15
37
 
16
38
  async function repl (_, options={}) {
17
39
 
40
+ const GREEN = '\x1b[32m', RESET = '\x1b[0m'
18
41
  const cds = require('../lib/cds')
19
42
  console.log('\x1b[32m\x1b[1m'+'Welcome to cds repl v', cds.version, '\x1b[0m')
20
43
 
@@ -22,8 +45,12 @@ async function repl (_, options={}) {
22
45
  inspect.defaultOptions.colors = true
23
46
  inspect.defaultOptions.depth = 11
24
47
 
48
+ Object.defineProperty (cds,'repl',{value:true})
49
+ let context={}, repl = { context, displayPrompt(){} }
50
+ if (options.run) await _run (options.run)
51
+ if (options.use) _export (...options.use.split(','))
25
52
 
26
- const repl = require('repl').start ({
53
+ repl = require('repl').start ({
27
54
  ...options,
28
55
  ignoreUndefined: true,
29
56
  useGlobal: true,
@@ -33,7 +60,8 @@ async function repl (_, options={}) {
33
60
  }
34
61
  })
35
62
 
36
- Object.defineProperty (cds,'repl',{value:repl})
63
+ if (Object.keys(context).length) Object.assign (repl.context, context)
64
+
37
65
  cds.extend (repl.context) .with ( class {
38
66
  get Foo() { return ctx.Foo ??= new cds.entity({ name: 'Foo' }) }; set Foo(v) { ctx.Foo = v }
39
67
  get Bar() { return ctx.Bar ??= new cds.entity({ name: 'Bar' }) }; set Bar(v) { ctx.Bar = v }
@@ -41,61 +69,12 @@ async function repl (_, options={}) {
41
69
  } .prototype )
42
70
  const ctx={}
43
71
 
44
- repl.defineCommand ('run', {
72
+ repl.defineCommand ('run', { action: _run,
45
73
  help: 'Runs a cds server from a given CAP project folder, or module name like @capire/bookshop.',
46
- async action (project) {
47
- // await cds.exec ('--project', project, '--port', '0')
48
- await cds.test (project)
49
-
50
- const GREEN = '\x1b[32m', RESET = '\x1b[0m'
51
- console.log ('------------------------------------------------------------')
52
- console.log ('Following are made available as repl globals:')
53
- console.log()
54
- let ntt = _export ('entities')
55
- let srv = _export ('services')
56
- console.log()
57
- console.log('Simply type e.g.', GREEN+ntt+RESET, 'or', GREEN+srv+RESET, 'in the prompt to use the respective objects.')
58
- console.log()
59
- this.displayPrompt()
60
-
61
- function _export (cds_property) {
62
- let exports = cds[cds_property], first
63
- console.log (`from cds.${cds_property}: {`)
64
- for (let each in exports) {
65
- if (each.includes('.')) continue
66
- repl.context[each] = exports [each]
67
- console.log (` ${GREEN}${each}${RESET},`)
68
- first ??= each
69
- }
70
- console.log (`}`)
71
- return first
72
- }
73
- },
74
74
  })
75
75
 
76
- repl.defineCommand ('inspect', {
76
+ repl.defineCommand ('inspect', { action: _inspect,
77
77
  help: 'Sets options for util.inspect, e.g. `.inspect .depth=1`.',
78
- async action (_args) {
79
- const args = _args.split(' '), subjects={}, options = {}, defaults = inspect.defaultOptions
80
- for (let each of args) {
81
- // args of shape .<option>=<value> set inspect options
82
- if (each[0] === '.') each = eval(`options${each}`)
83
- // others are subjects to inpsect with given options
84
- else subjects[each ||= 'defaults'] = each === 'defaults' ? defaults : function _recurse (o,slug) {
85
- const [ head,...tail ] = slug, x = o[head]
86
- if (tail.length && x && typeof x === 'object') return _recurse (x,tail)
87
- else return x
88
- } (repl.context, each.split('.'))
89
- }
90
- // if no subjects were given, just set the options globally
91
- if (!Object.keys(subjects).length) {
92
- Object.assign (defaults, options)
93
- console.log('\n', 'updated node:util.inspect.defaultOptions with:', options)
94
- } else for (let [each,subject] of Object.entries(subjects))
95
- console.log ('\n'+each+':', inspect (subject, options))
96
- console.log()
97
- this.displayPrompt()
98
- }
99
78
  })
100
79
 
101
80
  repl.history = new Array(222)
@@ -108,6 +87,53 @@ async function repl (_, options={}) {
108
87
  process.on('uncaughtException', console.error)
109
88
  process.on('unhandledRejection', console.error)
110
89
 
90
+ async function _run (project) {
91
+ await cds.test (project) // await cds.exec ('--project', project, '--port', '0')
92
+ _export ('entities', 'services')
93
+ }
94
+
95
+ function _export (...cds_features) {
96
+ console.log()
97
+ console.log ('------------------------------------------------------------------------')
98
+ console.log ('Following variables are made available in your repl\'s global context:')
99
+ console.log()
100
+ for (let each of cds_features) {
101
+ let module = cds[each]
102
+ console.log (`from cds.${each}: {`)
103
+ for (let p in module) {
104
+ if (p in global || p.startsWith('_') || p.includes('.')) continue
105
+ console.log (` ${GREEN}${p}${RESET},`)
106
+ repl.context[p] = module [p]
107
+ }
108
+ console.log (`}`)
109
+ console.log()
110
+ }
111
+ console.log('Simply type e.g.', GREEN+ Object.keys(context).at(-1) +RESET, 'in the prompt to use the respective objects.')
112
+ console.log()
113
+ repl.displayPrompt()
114
+ }
115
+
116
+ async function _inspect (_args) {
117
+ const args = _args.split(' '), subjects={}, options = {}, defaults = inspect.defaultOptions
118
+ for (let each of args) {
119
+ // args of shape .<option>=<value> set inspect options
120
+ if (each[0] === '.') each = eval(`options${each}`)
121
+ // others are subjects to inpsect with given options
122
+ else subjects[each ||= 'defaults'] = each === 'defaults' ? defaults : function _recurse (o,slug) {
123
+ const [ head,...tail ] = slug, x = o[head]
124
+ if (tail.length && x && typeof x === 'object') return _recurse (x,tail)
125
+ else return x
126
+ } (repl.context, each.split('.'))
127
+ }
128
+ // if no subjects were given, just set the options globally
129
+ if (!Object.keys(subjects).length) {
130
+ Object.assign (defaults, options)
131
+ console.log('\n', 'updated node:util.inspect.defaultOptions with:', options)
132
+ } else for (let [each,subject] of Object.entries(subjects))
133
+ console.log ('\n'+each+':', inspect (subject, options))
134
+ console.log()
135
+ repl.displayPrompt()
136
+ }
111
137
  }
112
138
 
113
139
  if (!module.parent) repl()
@@ -88,16 +88,17 @@ module.exports = new class CFKeyProvider {
88
88
  async _resolveManagedService(instanceObj, instance, key, org, space, customCredentials) {
89
89
  const create = (cds.cli.command === 'bind' || cds.cli.command === 'deploy') && !cds.cli.options['no-create-service-key']
90
90
  const silent = (cds.cli.options.json || cds.cli.command === 'env') && !DEBUG
91
- const credentials = await cfUtil.getOrCreateServiceKey(instanceObj, key, {}, { create, silent });
91
+ const planObj = await this.getPlan(instanceObj.relationships.service_plan.data.guid);
92
+ const offeringObj = await this.getOffering(planObj.relationships.service_offering.data.guid);
93
+ const parameters = offeringObj.name === "identity" ? { "credential-type": "X509_GENERATED", "app-identifier" : "cds_bind" } : {};
92
94
 
95
+ const credentials = await cfUtil.getOrCreateServiceKey(instanceObj, key, parameters, { create, silent });
93
96
  if (!credentials) {
94
97
  let message = `No service key ${bold(key)} found for service instance ${bold(instance)}.\n\n`;
95
98
  message += `Use ${bold(`cf create-service-key ${instanceObj.name} ${key} [-c ...]`)} to create the required service key.`;
96
99
  throw message;
97
100
  }
98
101
 
99
- const planObj = await this.getPlan(instanceObj.relationships.service_plan.data.guid);
100
- const offeringObj = await this.getOffering(planObj.relationships.service_offering.data.guid);
101
102
  const resolvedBinding = {
102
103
  binding: {
103
104
  type: "cf",
package/lib/bind/index.js CHANGED
@@ -118,7 +118,7 @@ function mergeCredentials(credentials, customCredentials) {
118
118
  if (!credentials[key]) {
119
119
  credentials[key] = {};
120
120
  }
121
- credentials[key] = this.mergeCredentials(credentials[key], customCredentials[key]);
121
+ credentials[key] = mergeCredentials(credentials[key], customCredentials[key]);
122
122
  } else {
123
123
  credentials[key] = customCredentials[key];
124
124
  }
@@ -333,7 +333,7 @@ The higher the value the earlier the plugin is run.`
333
333
  // flatten
334
334
  messages = messages.reduce((acc, m) => acc.concat(m), [])
335
335
  // filter according to log-level
336
- const filteredMessages = messages.filter(message => !message.severity || logLevelIdx >= SEVERITIES.indexOf(message.severity))
336
+ const filteredMessages = messages.filter(message => message && (!message.severity || logLevelIdx >= SEVERITIES.indexOf(message.severity)))
337
337
  // remove duplicates
338
338
  deduplicateMessages(filteredMessages)
339
339
  // sort
@@ -1,5 +1,7 @@
1
1
  apiVersion: v2
2
2
  description: A Helm Chart for creating a Content Deployment job
3
3
  name: content-deployment
4
+ sources:
5
+ - https://github.tools.sap/unified-runtime/content-deployment
4
6
  type: application
5
- version: 1.6.3
7
+ version: 1.7.0
@@ -115,12 +115,10 @@ Name of the imagePullSecret
115
115
  {{ $ips := (dict "local" .Values.imagePullSecret "global" .Values.global.imagePullSecret) }}
116
116
  {{- if $ips.local.name }}
117
117
  {{- $ips.local.name }}
118
- {{- else if $ips.global.name }}
119
- {{- $ips.global.name }}
120
- {{- else if or $ips.local.dockerconfigjson $ips.global.dockerconfigjson }}
118
+ {{- else if or (and $ips.local $ips.local.dockerconfigjson) (and $ips.global $ips.global.dockerconfigjson) }}
121
119
  {{- include "content-deployment.internal.fullname" . }}
122
- {{- else }}
123
- {{- "image-pull-secret" }}
120
+ {{- else if and $ips.global $ips.global.name }}
121
+ {{- $ips.global.name }}
124
122
  {{- end }}
125
123
  {{- end }}
126
124
 
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://github.tools.sap/unified-runtime/content-deployment/blob/main/values.schema.json",
3
4
  "type": "object",
4
5
  "required": [
5
6
  "image", "bindings"
@@ -23,22 +24,6 @@
23
24
  "dockerconfigjson": {
24
25
  "type": "string"
25
26
  }
26
- },
27
- "dependencies": {
28
- "name": {
29
- "not": {
30
- "required": [
31
- "dockerconfigjson"
32
- ]
33
- }
34
- },
35
- "dockerconfigjson": {
36
- "not": {
37
- "required": [
38
- "name"
39
- ]
40
- }
41
- }
42
27
  }
43
28
  },
44
29
  "image": {
@@ -1,12 +1,11 @@
1
1
  # Helm global values, for more information, see https://helm.sh/docs/chart_template_guide/subcharts_and_globals/#global-chart-values
2
2
  global:
3
3
  # Image Pull Secret configuration, for more information, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
4
- imagePullSecret: {}
5
- # Name of the Kubernetes Secret, used as an image pull secret (must be of type kubernetes.io/dockerconfigjson). Can't be used with the `dockerconfigjson` option.
6
- # name: ""
7
- # The content for the dynamically generated Kubernetes Secret, which will be used as an image pull secret. Can't be used with the `name` option.
8
- # dockerconfigjson: ""
9
- # Either name or repository is required.
4
+ imagePullSecret:
5
+ # Name of the Kubernetes Secret, used as an image pull secret (must be of type kubernetes.io/dockerconfigjson).
6
+ name: image-pull-secret
7
+ # The content for the dynamically generated Kubernetes Secret, which will be used as an image pull secret.
8
+ # dockerconfigjson: ""
10
9
  image: {}
11
10
  # registry: gcr.io/my-project
12
11
  # tag: latest
@@ -15,7 +14,7 @@ global:
15
14
  _internal:
16
15
  content-deployment:
17
16
  versions:
18
- 1.6.3: true
17
+ 1.7.0: true
19
18
  # Will be used instead of the `.Chart.Name`, e.g. when generating the Deployment name.
20
19
  # nameOverride: name
21
20
 
@@ -2,5 +2,7 @@ apiVersion: v2
2
2
  description: A Helm chart for web app
3
3
  kubeVersion: '>= 1.21'
4
4
  name: web-application
5
+ sources:
6
+ - https://github.tools.sap/unified-runtime/web-application
5
7
  type: application
6
- version: 1.17.2
8
+ version: 1.20.0
@@ -29,6 +29,22 @@ Define Host for the APIRule
29
29
  {{- end }}
30
30
  {{- end }}
31
31
 
32
+ {{/*
33
+ Define Hosts for the APIRule (since v2alpha1)
34
+ */}}
35
+ {{- define "web-application.internal.exposeHosts" -}}
36
+ {{- if .Values.expose.hosts }}
37
+ {{ .Values.expose.hosts | toYaml }}
38
+ {{- else }}
39
+ {{- $name := (include "web-application.fullname" .) }}
40
+ {{- if hasPrefix $name .Release.Namespace }}
41
+ - {{ .Release.Namespace }}
42
+ {{- else }}
43
+ - {{ printf "%s-%s" $name .Release.Namespace | trunc 63 | trimSuffix "-" }}
44
+ {{- end }}
45
+ {{- end }}
46
+ {{- end }}
47
+
32
48
  {{/*
33
49
  Returns the TENANT_HOST_PATTERN if defined
34
50
  */}}
@@ -92,12 +108,10 @@ Name of the imagePullSecret
92
108
  {{ $ips := (dict "local" .Values.imagePullSecret "global" .Values.global.imagePullSecret) }}
93
109
  {{- if $ips.local.name }}
94
110
  {{- $ips.local.name }}
95
- {{- else if $ips.global.name }}
96
- {{- $ips.global.name }}
97
- {{- else if or $ips.local.dockerconfigjson $ips.global.dockerconfigjson }}
111
+ {{- else if or (and $ips.local $ips.local.dockerconfigjson) (and $ips.global $ips.global.dockerconfigjson) }}
98
112
  {{- include "web-application.fullname" . }}
99
- {{- else }}
100
- {{- "image-pull-secret" }}
113
+ {{- else if and $ips.global $ips.global.name }}
114
+ {{- $ips.global.name }}
101
115
  {{- end }}
102
116
  {{- end }}
103
117
 
@@ -210,5 +224,11 @@ If release name contains chart name it will be used as service instance name.
210
224
  {{- if .checkValues.failureThreshold }}
211
225
  failureThreshold: {{ .checkValues.failureThreshold }}
212
226
  {{- end }}
227
+ {{- if .checkValues.successThreshold }}
228
+ successThreshold: {{ .checkValues.successThreshold }}
229
+ {{- end }}
230
+ {{- if .checkValues.timeoutSeconds }}
231
+ timeoutSeconds: {{ .checkValues.timeoutSeconds }}
232
+ {{- end }}
213
233
  {{- end }}
214
234
  {{- end }}
@@ -1,19 +1,28 @@
1
1
  {{- if .Values.expose.enabled -}}
2
+ {{- if .Values.expose.APIRule.experimental -}}
3
+ apiVersion: gateway.kyma-project.io/v2alpha1
4
+ {{ else }}
2
5
  apiVersion: gateway.kyma-project.io/v1beta1
6
+ {{- end }}
3
7
  kind: APIRule
4
8
  metadata:
5
9
  name: {{ include "web-application.fullname" . }}
6
10
  labels: {{- include "web-application.labels" . | nindent 4 }}
7
11
  spec:
8
- gateway: {{tpl .Values.expose.gateway $ }}
12
+ gateway: {{ tpl .Values.expose.gateway $ }}
13
+ {{- if .Values.expose.APIRule.experimental }}
14
+ hosts:
15
+ {{- include "web-application.internal.exposeHosts" . | indent 4 }}
16
+ {{- else }}
9
17
  host: {{ include "web-application.internal.exposeHost" . }}
18
+ {{- end }}
10
19
  service:
11
20
  name: {{ include "web-application.fullname" . }}
12
21
  port: {{ .Values.port }}
13
22
  rules:
14
- {{- toYaml .Values.expose.rules | nindent 6 }}
15
- {{ if .Values.expose.corsPolicy }}
23
+ {{- toYaml .Values.expose.rules | nindent 4 }}
24
+ {{- if .Values.expose.corsPolicy }}
16
25
  corsPolicy:
17
- {{- toYaml .Values.expose.corsPolicy | nindent 6 }}
26
+ {{- toYaml .Values.expose.corsPolicy | nindent 4 }}
18
27
  {{- end }}
19
28
  {{- end }}
@@ -11,7 +11,12 @@ metadata:
11
11
  labels: {{- include "web-application.labels" $ | nindent 4 }}
12
12
  spec:
13
13
  serviceInstanceName: {{include "web-application.internal.serviceInstanceName" (dict "binding" $mergedParams "root" $) }}
14
- secretKey: credentials
14
+ {{- if $mergedParams.secretKey }}
15
+ secretKey: {{ $mergedParams.secretKey }}
16
+ {{- end }}
17
+ {{- if $mergedParams.serviceInstanceNamespace }}
18
+ serviceInstanceNamespace: {{ $mergedParams.serviceInstanceNamespace }}
19
+ {{- end }}
15
20
  {{- if $mergedParams.externalName }}
16
21
  externalName: {{ $mergedParams.externalName }}
17
22
  {{- end }}