@@ -69,11 +69,11 @@ var _ = Describe("Test download binaries", func() {
69
69
Expect (actualFiles ).To (ConsistOf ("some-file" ))
70
70
})
71
71
72
- It ("should download v1.32.0 binaries" , func () {
72
+ It ("should download binaries of an exact version " , func () {
73
73
apiServerPath , etcdPath , kubectlPath , err := downloadBinaryAssets (context .Background (), downloadDirectory , "v1.31.0" , fmt .Sprintf ("http://%s/%s" , server .Addr (), "envtest-releases.yaml" ))
74
74
Expect (err ).ToNot (HaveOccurred ())
75
75
76
- // Verify latest stable version (v1.32 .0) was downloaded
76
+ // Verify exact version (v1.31 .0) was downloaded
77
77
versionDownloadDirectory := path .Join (downloadDirectory , fmt .Sprintf ("1.31.0-%s-%s" , runtime .GOOS , runtime .GOARCH ))
78
78
Expect (apiServerPath ).To (Equal (path .Join (versionDownloadDirectory , "kube-apiserver" )))
79
79
Expect (etcdPath ).To (Equal (path .Join (versionDownloadDirectory , "etcd" )))
@@ -87,6 +87,25 @@ var _ = Describe("Test download binaries", func() {
87
87
}
88
88
Expect (actualFiles ).To (ConsistOf ("some-file" ))
89
89
})
90
+
91
+ It ("should download binaries of latest stable version of a release series" , func () {
92
+ apiServerPath , etcdPath , kubectlPath , err := downloadBinaryAssets (context .Background (), downloadDirectory , "1.31" , fmt .Sprintf ("http://%s/%s" , server .Addr (), "envtest-releases.yaml" ))
93
+ Expect (err ).ToNot (HaveOccurred ())
94
+
95
+ // Verify stable version (v1.31.4) was downloaded
96
+ versionDownloadDirectory := path .Join (downloadDirectory , fmt .Sprintf ("1.31.4-%s-%s" , runtime .GOOS , runtime .GOARCH ))
97
+ Expect (apiServerPath ).To (Equal (path .Join (versionDownloadDirectory , "kube-apiserver" )))
98
+ Expect (etcdPath ).To (Equal (path .Join (versionDownloadDirectory , "etcd" )))
99
+ Expect (kubectlPath ).To (Equal (path .Join (versionDownloadDirectory , "kubectl" )))
100
+
101
+ dirEntries , err := os .ReadDir (versionDownloadDirectory )
102
+ Expect (err ).ToNot (HaveOccurred ())
103
+ var actualFiles []string
104
+ for _ , e := range dirEntries {
105
+ actualFiles = append (actualFiles , e .Name ())
106
+ }
107
+ Expect (actualFiles ).To (ConsistOf ("some-file" ))
108
+ })
90
109
})
91
110
92
111
var (
@@ -101,6 +120,15 @@ var (
101
120
"envtest-v1.32.0-linux-s390x.tar.gz" : {},
102
121
"envtest-v1.32.0-windows-amd64.tar.gz" : {},
103
122
},
123
+ "v1.31.4" : map [string ]archive {
124
+ "envtest-v1.31.4-darwin-amd64.tar.gz" : {},
125
+ "envtest-v1.31.4-darwin-arm64.tar.gz" : {},
126
+ "envtest-v1.31.4-linux-amd64.tar.gz" : {},
127
+ "envtest-v1.31.4-linux-arm64.tar.gz" : {},
128
+ "envtest-v1.31.4-linux-ppc64le.tar.gz" : {},
129
+ "envtest-v1.31.4-linux-s390x.tar.gz" : {},
130
+ "envtest-v1.31.4-windows-amd64.tar.gz" : {},
131
+ },
104
132
"v1.31.0" : map [string ]archive {
105
133
"envtest-v1.31.0-darwin-amd64.tar.gz" : {},
106
134
"envtest-v1.31.0-darwin-arm64.tar.gz" : {},
0 commit comments