Skip to content
New issue

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

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

Already on GitHub? # to your account

[olm] Improve error message in olm install cmd #3907

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions changelog/fragments/olm-improve-logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
Inform user to verify the presence of olm deployment manifests in github when `olm install` command gives a 404 http error.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "bugfix"

# Is this a breaking change?
breaking: false
4 changes: 4 additions & 0 deletions internal/olm/installer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ func (c Client) doRequest(ctx context.Context, url string) (*http.Response, erro
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
msg := fmt.Sprintf("failed GET '%s': unexpected status code %d, expected %d", url, resp.StatusCode, http.StatusOK)
if resp.StatusCode == 404 {
return nil, fmt.Errorf("%s; manifests may not exist for this OLM release,"+
"please check https://github.com/operator-framework/operator-lifecycle-manager/releases for olm.yaml and crds.yaml", msg)
}
if err != nil {
return nil, fmt.Errorf("%s: %v", msg, err)
}
Expand Down