@sap/cds-dk 8.5.1 → 8.6.0
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 +23 -3
- package/bin/cds.js +2 -3
- package/bin/deploy/index.js +9 -11
- package/bin/import.js +6 -2
- package/bin/repl.js +82 -56
- package/lib/bind/cfKeyProvider.js +4 -3
- package/lib/bind/index.js +1 -1
- package/lib/build/buildTaskEngine.js +1 -1
- package/lib/build/plugins/helm/files/subcharts/content-deployment/Chart.yaml +3 -1
- package/lib/build/plugins/helm/files/subcharts/content-deployment/templates/_helpers.tpl +3 -5
- package/lib/build/plugins/helm/files/subcharts/content-deployment/values.schema.json +1 -16
- package/lib/build/plugins/helm/files/subcharts/content-deployment/values.yaml +6 -7
- package/lib/build/plugins/helm/files/subcharts/web-application/Chart.yaml +3 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/_helpers.tpl +25 -5
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/api-rule.yaml +13 -4
- package/lib/build/plugins/helm/files/subcharts/web-application/templates/service-binding.yaml +6 -1
- package/lib/build/plugins/helm/files/subcharts/web-application/values.schema.json +55 -48
- package/lib/build/plugins/helm/files/subcharts/web-application/values.yaml +19 -7
- package/lib/import/common.js +2 -2
- package/lib/init/constants.js +2 -0
- package/lib/init/index.js +10 -0
- package/lib/init/registries/mta.js +7 -1
- package/lib/init/template/ams/files/Chart.yaml.hbs +4 -0
- package/lib/init/template/ams/files/containerize.yaml.hbs +20 -0
- package/lib/init/template/ams/files/manifest.yml.hbs +24 -0
- package/lib/init/template/ams/files/mta.yaml.hbs +31 -0
- package/lib/init/template/ams/files/package.json.hbs +10 -0
- package/lib/init/template/ams/files/values.yaml.hbs +13 -0
- package/lib/init/template/ams/index.js +80 -0
- package/lib/init/template/approuter/files/mta.yaml.hbs +6 -4
- package/lib/init/template/approuter/files/package.json +1 -1
- package/lib/init/template/helm/files/values.schema.json +0 -2079
- package/lib/init/template/http/index.js +10 -8
- package/lib/init/template/ias/files/Chart.yaml.hbs +4 -0
- package/lib/init/template/ias/files/manifest.yml.hbs +8 -0
- package/lib/init/template/ias/files/mta.yaml.hbs +61 -0
- package/lib/init/template/ias/files/package.json.hbs +22 -0
- package/lib/init/template/ias/files/services-manifest.yml.hbs +6 -0
- package/lib/init/template/ias/files/values.yaml.hbs +52 -0
- package/lib/init/template/ias/index.js +71 -0
- package/lib/init/template/mta/files/mta.yaml.hbs +15 -1
- package/lib/init/template/multitenancy/files/mta.yaml.hbs +38 -5
- package/lib/init/template/multitenancy/files/package.sidecar.json.hbs +5 -2
- package/lib/init/template/multitenancy/index.js +40 -31
- package/lib/init/template/xsuaa/index.js +1 -1
- package/lib/util/cf.js +4 -4
- package/lib/util/command.js +1 -9
- package/npm-shrinkwrap.json +114 -90
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,15 +7,35 @@ 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.
|
|
10
|
+
## Version 8.6.0 - 2024-12-17
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
|
|
14
|
+
- `cds repl` got new option `--run` to run a server; also available through `.run` command within the REPL.
|
|
15
|
+
- `cds repl` got new option `--use` to make the features of a `cds` available as globals.
|
|
16
|
+
- `cds repl` got new builtin `.inspect` command to inspect object with configurable depth, e.g. `.inspect cds .depth=1`.
|
|
14
17
|
- `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.
|
|
18
|
+
- `cds import --group` to allow RFC importer to organize imported modules under a logical name.
|
|
19
|
+
- `cds init/add` for Java projects automatically create a `package-lock.json`.
|
|
20
|
+
- `cds add ias` adds IAS configuration (beta).
|
|
21
|
+
- `cds add ams` adds AMS configuration (beta).
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- 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
26
|
|
|
16
27
|
### Fixed
|
|
17
28
|
|
|
18
29
|
- `cds add html5-repo` adds an `index.html` as `welcomePage` to the `xs-app.json`, if available.
|
|
30
|
+
- `cds bind` fixes the recursive call to `mergeCredentials`.
|
|
31
|
+
- `cds add` won't add a duplicated `SUBSCRIPTION_URL` if it doesn't match the template specification.
|
|
32
|
+
- `cds watch` gives a better error message for TypeScript projects started with if `tsx` isn't installed.
|
|
33
|
+
- `cds build` no longer throws an undefined error when processing build plugin messages.
|
|
34
|
+
|
|
35
|
+
## Version 8.5.1 - 2024-12-05
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
19
39
|
- `cds build` now logs existing plugin build messages if a BuildError is thrown.
|
|
20
40
|
|
|
21
41
|
## Version 8.5.0 - 2024-11-26
|
|
@@ -34,8 +54,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
|
34
54
|
- The existing `cds watch --debug` is now an alias to `cds watch --inspect`.
|
|
35
55
|
- `cds add cloud-logging` adds cloud-logging as an alternative for application logging in Kyma.
|
|
36
56
|
- `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
|
|
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
|
|
57
|
+
- `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.
|
|
58
|
+
- `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
59
|
|
|
40
60
|
### Fixed
|
|
41
61
|
|
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
|
-
|
|
283
|
-
|
|
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
|
}
|
package/bin/deploy/index.js
CHANGED
|
@@ -78,22 +78,20 @@ module.exports = Object.assign(deploy, {
|
|
|
78
78
|
|
|
79
79
|
*--model-only*
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
96
|
-
|
|
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',
|
|
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
|
-
|
|
1
|
+
module.exports = Object.assign (repl, {
|
|
2
|
+
options: [ '--run', '--use' ],
|
|
3
|
+
shortcuts: [ '-r', '-u' ],
|
|
4
|
+
help: `
|
|
3
5
|
# SYNOPSIS
|
|
4
6
|
|
|
5
|
-
*cds
|
|
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
|
-
|
|
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.
|
|
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
|
|
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] =
|
|
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
|
|
@@ -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.
|
|
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
|
-
{{-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.
|
|
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
|
|
|
@@ -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.
|
|
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
|
-
{{-
|
|
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
|
|
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
|
|
26
|
+
{{- toYaml .Values.expose.corsPolicy | nindent 4 }}
|
|
18
27
|
{{- end }}
|
|
19
28
|
{{- end }}
|
package/lib/build/plugins/helm/files/subcharts/web-application/templates/service-binding.yaml
CHANGED
|
@@ -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
|
|
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 }}
|