-
Notifications
You must be signed in to change notification settings - Fork 24
Retrieve the latest release using the HTTP client #1544
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
base: devel
Are you sure you want to change the base?
Conversation
|
🤖 Created branch: z_pr1544/skitt/drop-go-github-dep |
6d26776 to
f685b9d
Compare
| if err == nil { | ||
| upgradeSubctlVersion = *latestRelease.TagName | ||
| tag, err := retrieveLatestReleaseTag() | ||
| if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should at least log the error instead of silencing it. Also shouldn't this be:
| if err != nil { | |
| if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, yes, it should be! We didn’t log the error in the past, and where should we log it? This is in subctl, so apart from the screen there isn’t anywhere to log it. The error is unlikely to be user-actionable so this would probably only confuse people...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can log it to the status as a warning. It may not be actionable but it would be informational, in case something else goes wrong as a side-effect that might provide a clue. I don't think it's best practice to ignore errors.
This avoids a dependency on go-github, which drops a few transitive dependencies that were only used to retrieve the latest release from the GitHub API. This helps our dependency tree... Signed-off-by: Stephen Kitt <[email protected]>
f685b9d to
4d5305e
Compare
This avoids a dependency on go-github, which drops a few transitive dependencies that were only used to retrieve the latest release from the GitHub API. This helps our dependency tree...