• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 8344188800
88%

Build:
DEFAULT BRANCH: master
Ran 19 Mar 2024 02:03PM UTC
Jobs 1
Files 513
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Mar 2024 01:48PM UTC coverage: 87.007% (+0.006%) from 87.001%
8344188800

push

github

locker
config: access config of other cluster members

Fixes #9680

@TarantoolBot document
Title: config: access configuration of other cluster members

## `config:instances()`

List all instances of the cluster.

Returns a table of the following format.

```lua
{
    [<instance_name>] = {
        instance_name = <...>,
        replicaset_name = <...>,
        group_name = <...>,
    },
    <...>
}
```

If an action should be performed for each instance of the given cluster,
it can be written this way:

```lua
for instance_name in pairs(config:instances()) do
    action(instance_name)
end
```

If replicaset/group names matter, the instances may be filtered this
way:

```lua
-- Perform an action for all instances of the given replicaset.
for instance_name, def in pairs(config:instances()) do
    if def.replicaset_name == box.info.replicaset.name then
        action(instance_name)
    end
end
```

## `config:get(<...>, {instance = '<...>'})`

The new `instance` option of the `config:get()` method allows to
retrieve a configuration value of another instance from the given
cluster.

Example:

```lua
-- Collect all the enabled roles within the cluster.
local enabled_roles = {}
for instance_name in pairs(config:instances()) do
    local roles = config:get('roles', {instance = instance_name})
    for _, role in ipairs(roles) do
        enabled_roles[role] = true
    end
end
```

Note: There is a difference between a missing `instance` option and the
`instance` option that is equal to the given instance name. The former
returns an instance configuration taking into account instance
configuration sources (environment variables). The latter takes into
account only cluster configuration, so the environment variables are
ignored.

67092 of 119507 branches covered (56.14%)

99630 of 114508 relevant lines covered (87.01%)

2602250.4 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8344188800.1 19 Mar 2024 02:03PM UTC 0
87.01
GitHub Action Run
Source Files on build 8344188800
Detailed source file information is not available for this build.
  • Back to Repo
  • 30a9c1ca on github
  • Prev Build on master (#8341397288)
  • Next Build on master (#8355481110)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc