@@ -291,24 +291,25 @@ func Test_gitHubRepository_getLatestContractRelease(t *testing.T) {
291291 mux .HandleFunc ("/repos/o/r1/releases" , func (w http.ResponseWriter , r * http.Request ) {
292292 testMethod (t , r , "GET" )
293293 fmt .Fprint (w , `[` )
294- fmt .Fprint (w , `{"id":1, "tag_name": "v0.4.0", "assets": [{"id": 1, "name": "metadata.yaml"}]},` )
295- fmt .Fprint (w , `{"id":2, "tag_name": "v0.3.2", "assets": [{"id": 1, "name": "metadata.yaml"}]},` )
296- fmt .Fprint (w , `{"id":3, "tag_name": "v0.3.1", "assets": [{"id": 1, "name": "metadata.yaml"}]}` )
294+ fmt .Fprint (w , `{"id":1, "tag_name": "v0.5.0", "assets": [{"id": 1, "name": "metadata.yaml"}]},` )
295+ fmt .Fprint (w , `{"id":2, "tag_name": "v0.4.0", "assets": [{"id": 1, "name": "metadata.yaml"}]},` )
296+ fmt .Fprint (w , `{"id":3, "tag_name": "v0.3.2", "assets": [{"id": 1, "name": "metadata.yaml"}]},` )
297+ fmt .Fprint (w , `{"id":4, "tag_name": "v0.3.1", "assets": [{"id": 1, "name": "metadata.yaml"}]}` )
297298 fmt .Fprint (w , `]` )
298299 })
299300
300301 // test.NewFakeGitHub and handler for returning a fake release
301- mux .HandleFunc ("/repos/o/r1/releases/tags/v0.4 .0" , func (w http.ResponseWriter , r * http.Request ) {
302+ mux .HandleFunc ("/repos/o/r1/releases/tags/v0.5 .0" , func (w http.ResponseWriter , r * http.Request ) {
302303 testMethod (t , r , "GET" )
303- fmt .Fprint (w , `{"id":13, "tag_name": "v0.4 .0", "assets": [{"id": 1, "name": "metadata.yaml"}] }` )
304+ fmt .Fprint (w , `{"id":13, "tag_name": "v0.5 .0", "assets": [{"id": 1, "name": "metadata.yaml"}] }` )
304305 })
305306
306307 // test.NewFakeGitHub an handler for returning a fake release metadata file
307308 mux .HandleFunc ("/repos/o/r1/releases/assets/1" , func (w http.ResponseWriter , r * http.Request ) {
308309 testMethod (t , r , "GET" )
309310 w .Header ().Set ("Content-Type" , "application/octet-stream" )
310311 w .Header ().Set ("Content-Disposition" , "attachment; filename=metadata.yaml" )
311- fmt .Fprint (w , "apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3\n releaseSeries:\n - major: 0\n minor: 4\n contract: v1alpha4\n - major: 0\n minor: 3\n contract: v1alpha3\n " )
312+ fmt .Fprint (w , "apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3\n releaseSeries:\n - major: 0\n minor: 4\n contract: v1alpha4\n - major: 0\n minor: 5 \n contract: v1alpha4 \n - major: 0 \n minor: 3\n contract: v1alpha3\n " )
312313 })
313314
314315 configVariablesClient := test .NewFakeVariableClient ()
@@ -329,7 +330,7 @@ func Test_gitHubRepository_getLatestContractRelease(t *testing.T) {
329330 providerConfig : config .NewProvider ("test" , "https://github.com/o/r1/releases/latest/path" , clusterctlv1 .CoreProviderType ),
330331 },
331332 contract : "v1alpha4" ,
332- want : "v0.4 .0" ,
333+ want : "v0.5 .0" ,
333334 wantErr : false ,
334335 },
335336 {
@@ -346,7 +347,7 @@ func Test_gitHubRepository_getLatestContractRelease(t *testing.T) {
346347 field : field {
347348 providerConfig : config .NewProvider ("test" , "https://github.com/o/r1/releases/latest/path" , clusterctlv1 .CoreProviderType ),
348349 },
349- want : "v0.4 .0" ,
350+ want : "v0.5 .0" ,
350351 contract : "foo" ,
351352 wantErr : false ,
352353 },
0 commit comments