Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a soft failure if version lookup fails #934

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rgee0
Copy link
Contributor

@rgee0 rgee0 commented Sep 25, 2022

Signed-off-by: Richard Gee richard@technologee.co.uk

Description

Currently if an error is returned from the Version lookup against GitHub the CLI will exit with an error. This is unnecessary as the version lookup is an informational item.

This change removes the error in favour of a message to the terminal to inform the user that a version lookup wasn't possible.

There is an additional benefit in not bubbling up the error message. findRelease() which is used to determine whether there is a later release was written for a specific tool (kubeseal) and if the location header that is returned is zero-sized the error message passed back is specific to kubeseal. This would add further confusion for the user who may have just installed a fully functional CLI.

Motivation and Context

How Has This Been Tested?

% faas version
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  0451db85faebbc4b2c9c69c8af64686ff6617825
 version: 0.14.7
Unable to find latest version online error: Head "https://github.com/openfaas/faas-cli/releases/latest": dial tcp 127.0.0.1:443: connect: connection refused
% echo $?
1
% ./faas-cli version
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  d08553ed3f60fd33ee7b7d3ee35e9738d6e0e3c8-dirty
 version: 0.6.13-397-gd08553ed
Unable to determine from GitHub whether a later CLI version is available.
% echo $?           
0

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Currently if an error is returned from the Version lookup against GitHub
the CLI will exit with an error.  This is unnecessary as the version lookup
is an informational item.

This change removes the error in favour of a message to the terminal to
inform the user that a version lookup wasnt possible.

Signed-off-by: Richard Gee <richard@technologee.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] Suppress error output when GitHub version check fails
1 participant