diff --git a/cmd/rancher_release/list_images_rc.go b/cmd/rancher_release/list_images_rc.go index 2f386b33..7815b16e 100644 --- a/cmd/rancher_release/list_images_rc.go +++ b/cmd/rancher_release/list_images_rc.go @@ -26,6 +26,7 @@ func listImagesRCCommand() cli.Command { func listImagesRC(c *cli.Context) error { tag := c.String("tag") logrus.Debug("tag: " + tag) + imagesRC, err := rancher.ListRancherImagesRC(tag) if err != nil { return err diff --git a/release/rancher/rancher.go b/release/rancher/rancher.go index 6a16a899..2d969668 100644 --- a/release/rancher/rancher.go +++ b/release/rancher/rancher.go @@ -65,11 +65,9 @@ func rancherImages(imagesURL string) (string, error) { if resp.StatusCode != http.StatusOK { return "", errors.New("failed to download rancher-images.txt file, expected status code 200, got: " + strconv.Itoa(resp.StatusCode)) } - images, err := io.ReadAll(resp.Body) if err != nil { return "", err } - return string(images), nil } diff --git a/release/rancher/rancher_test.go b/release/rancher/rancher_test.go index 12d87565..bbe429fc 100644 --- a/release/rancher/rancher_test.go +++ b/release/rancher/rancher_test.go @@ -10,7 +10,6 @@ import ( func TestFindRCNonMirroredImages(t *testing.T) { images := "rancher/pushprox-proxy:v0.1.0-rancher2-proxy\nrancher/rancher-agent:v2.7.6-rc5\nrancher/rancher-csp-adapter:v2.0.2\nrancher/rancher-webhook:v0.3.5\nrancher/rancher:v2.7.6-rc5\nrancher/mirrored-rke-tools:v0.1.88-rc3" exptectedRCImages := []string{"rancher/rancher-agent:v2.7.6-rc5", "rancher/rancher:v2.7.6-rc5"} - result := nonMirroredRCImages(images) if reflect.DeepEqual(exptectedRCImages, result) != true { t.Errorf("failed: result images does not equal expected images, expected %+v, got %+v", exptectedRCImages, result)