Skip to content

config: context variables do not work in roles_cfg.<...> and app.cfg.<...> #10595

@Totktonada

Description

@Totktonada

Version: all existing tarantool 3.x (tested on 3.2.0).

Config:

config:
  context:
    title:
      from: env
      env: TITLE

process:
  title: '{{ context.title }}'

app:
  cfg:
    title: '{{ context.title }}'

roles_cfg:
  foo:
    title: '{{ context.title }}'

groups:
  g:
    replicasets:
      r:
        instances:
          i-001: {}

Test:

$ TITLE=xxx tarantool -i --name i-001 --config config.yaml
tarantool> config = require('config')

tarantool> config:get('process.title')
---
- xxx
...

tarantool> config:get('app.cfg.title')
---
- '{{ context.title }}'
...

tarantool> config:get('roles_cfg.foo.title')
---
- '{{ context.title }}'
...
And the same for built-in replacements
process:
  title: '{{ instance_name }}'

app:
  cfg:
    title: '{{ instance_name }}'

roles_cfg:
  foo:
    title: '{{ instance_name }}'

groups:
  g:
    replicasets:
      r:
        instances:
          i-001: {}
$ tarantool -i --name i-001 --config config.yaml
tarantool> config = require('config')

tarantool> config:get('process.title')
---
- i-001
...

tarantool> config:get('app.cfg.title')
---
- '{{ instance_name }}'
...

tarantool> config:get('roles_cfg.foo.title')
---
- '{{ instance_name }}'
...

The reason is that app.cfg.<...> and roles_cfg.<...> have any type and this type is not traversed down by the <schema object>:map() method.

return self:map(iconfig, apply_vars_f, vars)

Also tracked in TNTP-372

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions