Skip to content

cluster: provide cbuilder config modifying API right inside cluster #426

@Totktonada

Description

@Totktonada

Let's hold config value inside cluster and allow to modify it with the cbuilder API.

This is convenient to don't write code like this in a test:

local config_1 = cbuilder:new(base_config)
     :set_glogal_option(<...>)
     :config()
local cluster = cluster:new(config_1)

-- <..do workload..>

local config_2 = cbuilder:new(config_1)
     :set_glogal_option(<...>)
     :config()
cluster:sync(config_2)

-- <..do workload..>

It is easy to take base_config instead of config_1 in the second cbuilder:new call by a mistake, for example.

I would like if the code above would look so:

local cluster = cluster:new(cbuilder:new(base_config)
     :set_glogal_option(<...>)
     :config())

-- <..do workload..>

cluster:sync(cbuilder:new(cluster:config())
     :set_glogal_option(<...>)
     :config())

-- <..do workload..>

Or, better:

local cluster = cluster:new(cbuilder:new(base_config)
     :set_glogal_option(<...>)
     :config())

-- <..do workload..>

cluster:modify_config()        -- returns cbuilder object initialized with cluster:config()
     :set_glogal_option(<...>) -- and saves all the modifications
cluster:sync() -- applies the previously created config

-- <..do workload..>

Naming is just what appears first in the head, let's discuss it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions