kubeshop / monokle-cli

CLI for Monokle core validation library
20 stars 3 forks source link

fix: handle origin connection issues without throwing #46

Closed f1ames closed 11 months ago

f1ames commented 11 months ago

This PR fixes issue where CLI would error when origin cannot be reached.

This is mostly related to policy config synchronization and:

  1. It makes sense to catch such errors for validate and config commands where we can fallback to local config.
    • The command will run fine. When --debug flag is provided it will additionally display warning with error message (if there is one). This is because it needs to be debug-able and users should be able to see the reason why local config was used as fallback.
  2. For auth related commands the behavior is the same as before since without connecting to origin, those can't basically run. The only addition is that isAuthenticated check will not throw when origin cannot be reached, just return false - this makes the correct error to be shown while those commands fail.

Changes

Fixes

Checklist