Skip to content

Commit 953adb9

Browse files
[olm] Improve error message in olm install cmd
Notify user when olm tag is present in github but manifests cannot be located while installing olm.
1 parent 7db9ec2 commit 953adb9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
Inform user to verify the presence of olm deployment manifests in github when `olm install` command gives a 404 http error.
6+
7+
# kind is one of:
8+
# - addition
9+
# - change
10+
# - deprecation
11+
# - removal
12+
# - bugfix
13+
kind: "bugfix"
14+
15+
# Is this a breaking change?
16+
breaking: false

internal/olm/installer/client.go

+3
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ func (c Client) doRequest(ctx context.Context, url string) (*http.Response, erro
229229
defer resp.Body.Close()
230230
body, err := ioutil.ReadAll(resp.Body)
231231
msg := fmt.Sprintf("failed GET '%s': unexpected status code %d, expected %d", url, resp.StatusCode, http.StatusOK)
232+
if resp.StatusCode == 404 {
233+
return nil, fmt.Errorf("%s; manifests may not exist for this release, please check the releases page for olm.yaml and crds.yaml", msg)
234+
}
232235
if err != nil {
233236
return nil, fmt.Errorf("%s: %v", msg, err)
234237
}

0 commit comments

Comments
 (0)