cluster: implement environment variable parsing based on a schema
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 113
- Forks
- 18
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 23
Description
At this moment we use environment variables just as strings. It leads to incompatibility with tarantool:
It fails for tt:
$ TT_CONFIG_ETCD_ENDPOINTS="http://127.0.0.1:2379" TT_CONFIG_ETCD_PREFIX="/default" tt start app1
⨯ can't collect instance information for app1: error loading instance "router-a-001" configuration from config "/home/user/work/tmp/vshard_template/instances.enabled/app1/config.yaml": unable to parse cluster config from file: failed to parse a configuration data as a cluster config: failed to unmarshal ClusterConfig: yaml: unmarshal errors:
line 3: cannot unmarshal !!str `http://...` into []string
But if you run tarantool with the same environment variables, then everything works fine.
So we need to re-implement logic from the tarantool to parse environment variables in the same way:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the documented TT_CONFIG_ETCD_ENDPOINTS and TT_CONFIG_ETCD_PREFIX values while loading instances.enabled/app1/config.yaml. Read Tarantool's schema.lua environment-variable parsing implementation at the linked lines, then verify that tt start app1 accepts the same values and loads the cluster configuration successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100