Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-5901] Init viper when dev config path missing
You: Want to use `configtxgen` but you don't have the FABRIC_CFG_PATH environment variable set. You know how the configuration path searching works, and you are thinking that if you have a `configtx.yaml` file in your CWD you should be good to go. You: Are mistaken. If there is no $GOPATH/src/github.com/hyperledger/fabric/sampleconfig (a.k.a. `DevConfigPath`) present in your system, you will get an "unsupported config type" error, and be unable to use `configtxgen`. The reason: The viper-based configuration layer is not initialized properly when the `DevConfigPath` is missing (`InitViper` exits early). This seems: 1. Wrong logically; I should be able to roll with just the CWD. 2. Inconsistent with our treatment of the `/etc/hyperledger/fabric` configuration path (a.k.a. `OfficialPath`); if the `OfficialPath` does not exist, we go on with the initialization as usual. This changeset removes the error check for the presence of `DevConfigPath` and the respective early-termination path of the configuration layer. Change-Id: I31ed6de163625d48e861e7ad1fd2c41dadf5e3e4 Signed-off-by: Kostas Christidis <kostas@christidis.io>
- Loading branch information