Comments (3)
Debugging this, it appears as this is how Viper is designed to work.
The docs are not useful, the best you get from BindEnv
is "binds an environment variable..." without any explanation of what "Bind" means.
The values are getting written as part of our call to config.CreateNewConfig
Reading the source and stepping through with the debugger:
viper.SafeWriteConfigAs()
calls (internally) v.AllKeys()
to get the list of keys to write to the config file.
AllKeys()
specifically returns keys that were put in v.env by BindEnv
https://github.com/spf13/viper/blob/419fd86e49ef061d0d33f4d1d56d5e2a480df5bb/viper.go#L1969
It then writes values to the config file from all of those keys
from cli.
Looks like this was already handled by using a secondary Viper inside config set
; however the global Viper would also write the config file as well, this is how the env vars leaked into it.
Fix: The global Viper can pick up all the env vars and flags, but must not write to the file and config set
viper can write to the file, but it must NOT pickup env vars and flags.
from cli.
Fixed on 0.2.5
from cli.
Related Issues (20)
- Enhancement: Add support for toggling enabled state of deployment targets
- `project view`, `project-group view` commands don't respect `--output-format` switch HOT 1
- No way to disable prompting for creating projects or project group HOT 1
- Cannot create a project using Config As Code and a custom base path HOT 2
- `release deploy` command does not respect Runbook or Environment scoping on Prompted variables
- CLI fails when behind custom webListenPrefixes HOT 1
- Feature: support for creating Project Variable Templates HOT 1
- URL and APIKey required HOT 1
- Panic when invoked with no arguments
- CLI doesn't function when server bindings have a virtual directory configured
- Bug: Cannot use base "Octopus" command with no parameters HOT 2
- No respect of colour scheme for white background terminal HOT 1
- Feature: Library Variable Sets
- Windows Server 2019 install fails to set up path
- Repository not set up correctly for Go major versioning
- Add v2.3.0 release to releases.json
- Add progress logs to task wait command HOT 1
- Specifying `-f json` to `task wait` is ignored HOT 1
- Specifiying `-f json` to `octopus space view` is ignored
- No way to prevent release progression
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.