1- package upgradecheck
2-
31/*
42 Copyright 2021 - 2022 Crunchy Data Solutions, Inc.
53 Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +13,8 @@ package upgradecheck
1513 limitations under the License.
1614*/
1715
16+ package upgradecheck
17+
1818import (
1919 "context"
2020 "encoding/json"
@@ -89,7 +89,7 @@ func TestCheckForUpgrades(t *testing.T) {
8989 }, nil
9090 }
9191
92- res , header , err := checkForUpgrades (ctx , "4.7.3" , backoff ,
92+ res , header , err := checkForUpgrades (ctx , "" , " 4.7.3" , backoff ,
9393 fakeClient , cfg , false )
9494 assert .NilError (t , err )
9595 assert .Equal (t , res , `{"pgo_versions":[{"tag":"v5.0.4"},{"tag":"v5.0.3"},{"tag":"v5.0.2"},{"tag":"v5.0.1"},{"tag":"v5.0.0"}]}` )
@@ -104,7 +104,7 @@ func TestCheckForUpgrades(t *testing.T) {
104104 return & http.Response {}, errors .New ("whoops" )
105105 }
106106
107- res , header , err := checkForUpgrades (ctx , "4.7.3" , backoff ,
107+ res , header , err := checkForUpgrades (ctx , "" , " 4.7.3" , backoff ,
108108 fakeClient , cfg , false )
109109 // Two failed calls because of env var
110110 assert .Equal (t , counter , 2 )
@@ -121,7 +121,7 @@ func TestCheckForUpgrades(t *testing.T) {
121121 panic (fmt .Errorf ("oh no!" ))
122122 }
123123
124- res , header , err := checkForUpgrades (ctx , "4.7.3" , backoff ,
124+ res , header , err := checkForUpgrades (ctx , "" , " 4.7.3" , backoff ,
125125 fakeClient , cfg , false )
126126 // One call because of panic
127127 assert .Equal (t , counter , 1 )
@@ -142,7 +142,7 @@ func TestCheckForUpgrades(t *testing.T) {
142142 }, nil
143143 }
144144
145- res , header , err := checkForUpgrades (ctx , "4.7.3" , backoff ,
145+ res , header , err := checkForUpgrades (ctx , "" , " 4.7.3" , backoff ,
146146 fakeClient , cfg , false )
147147 assert .Equal (t , res , "" )
148148 // Two failed calls because of env var
@@ -171,7 +171,7 @@ func TestCheckForUpgrades(t *testing.T) {
171171 }, nil
172172 }
173173
174- res , header , err := checkForUpgrades (ctx , "4.7.3" , backoff ,
174+ res , header , err := checkForUpgrades (ctx , "" , " 4.7.3" , backoff ,
175175 fakeClient , cfg , false )
176176 assert .Equal (t , counter , 2 )
177177 assert .NilError (t , err )
0 commit comments