Sub volumes support is added to Volinfo. Code based volfile generation
is implemented(Still exploring the possible approach to do that based on
input json/yml/toml)
All volfiles available in `$SRC/glusterd2/volgen2/volfile_*.go`
Features:
- Easy to add condition while generating volfile(For example, bitrot
volfile only contains local bricks information)
- Easy to generate Cluster level, Volume level and Brick level volfiles
- Adding new volfile support is easy(Add one file)
- Full access to Cluster Info/Volume Info/Brick Info
- All supported volfiles are available now
- All generated volfiles are stored in etcd
- REST endpoint available to trigger regeneration of volfiles(Selective
regeneration not yet available)
Limitations:
- Currently limited to code based volfile generation. If new volfile
added or modified, Glusterd2 need to be recompiled. I tried template
based approach to support cluster volfiles but it is getting over
complecated. If this is not blocker now, we can proceed with this
approach.
Future:
- Template file(json/yml/toml) support can be added on top of
this if required.
Fixes: #388
Signed-off-by: Aravinda VK <avishwan@redhat.com>