mudler / luet

:package: :whale: 0-dependency Container-based Package Manager using SAT solver and QLearning
https://luet.io
GNU General Public License v3.0
253 stars 24 forks source link

Bind luet util {unpack, *} cli arguments to viper to be settable via config file and environment variables. #346

Open pocketbroadcast opened 7 months ago

pocketbroadcast commented 7 months ago

Is your feature request related to a problem? Please describe.

Many tools support docker/config file to set authentication for private registries. Luet has --auth-username and --auth-password besides other cli arguments to set such. Unfortunately, in some cases (to be specific Auroraboot) these cli args cannot be set directly!

Describe the solution you'd like

Bind the cli args (cobra.Command.Flags) to config file or environment variables (viper.BindPFlag) That way, one could override these by setting appropriate environment variables.

Describe alternatives you've considered

An alternative was to follow the approach of other tools and support for docker config to read in authentication for registries.

Additional context

For now the proposed enhancement works for me and I was happy to contribute my changes Feel free to comment any alternatives, additional views on that!