defenseunicorns / uds-cli

GNU Affero General Public License v3.0
26 stars 11 forks source link

Viper config file identification #861

Closed brandtkeller closed 1 month ago

brandtkeller commented 2 months ago

Looking at the viper configuration - I believe it is expected that uds identifies when a config file is not present for logging purposes - IE see warning here and here

based on this conditional - the warning will never be executed as you want to be checking for ok instead of !ok.

This is duplicated in the following function - and when fixed I expect you would see multiple warning messages for a single command execution. Might be worth removing the additional check.

Steps to reproduce

  1. Execute any uds command which can process viper configurations without having a valid uds-config file present in the expected locations

Expected result

Warning when a config file was not identified

Actual Result

no warning message

Severity/Priority

Low

brandtkeller commented 2 months ago

Ah - I should read more. Comments indicate ignoring the errors on purpose. Thus those warnings would never be hit.

I was trying to debug #860 and was getting a message "using config file" and had to do some tracing to understand that this was just missed. Can close this issue if intent is to not log config file not being found.

catsby commented 1 month ago

Hey @brandtkeller , me again - I believe we took care of that in https://github.com/defenseunicorns/uds-cli/issues/912 (by way of https://github.com/zarf-dev/zarf/pull/2985), so I'm going to close this now. Let me know if I've missed something!