Just wanted to understand this I observe that vipe...
# atmos-dev
s
Just wanted to understand this I observe that viper and cobra are not binded as per recommendations While i do understand why it might have been that way. I would recommend let us change that so that we remove a lot of code Wdyt @Andriy Knysh (Cloud Posse) cc: @Erik Osterman (Cloud Posse)
a
please explain in more details how they are not integrated and how we can improve the code
note that you don’t need to use Viper with Cobra, Cobra can be used separately
in the current code, we are using Viper to merge the CLI configurations loaded from different places
s
So what i noticed is we manually check if a flag was set and the modify the config. If i remember the viper and cobra correctly viper can directly handle this binding Unless this is something we already have planned to remove and i am looking at some old code
ohh sorry it is cobra+viper or viper+native that automatically handles this. Not sure if we want to do that or we already droped that for some reasons
image.png
a snippet from chat gpt 😅
e
We do want to use viper, but I have not written the task
We want to convert our handling of atmos.yml to use viper
I probably won’t get to writing task until Monday
a
we already using Viper to handle atmos.yaml and merge the config from many files if they are found
s
Ok... this: https://github.com/cloudposse/atmos/blob/main/pkg/config/utils.go#L188-L387 Could be handled by viper viper help attached for reference:
We can even standardize env and arguments in a future Major version so it is intutive for the user to know the env and flag maybe 🙂 Not diverging the topic avoid this
a
yes, you are right, we can use Viper to handle the ENV vars (this will need to be tested for all scenarios)