@@ -69,11 +69,11 @@ var _ = Describe("Test download binaries", func() {
6969 Expect (actualFiles ).To (ConsistOf ("some-file" ))
7070 })
7171
72- It ("should download v1.32.0 binaries" , func () {
72+ It ("should download binaries of an exact version " , func () {
7373 apiServerPath , etcdPath , kubectlPath , err := downloadBinaryAssets (context .Background (), downloadDirectory , "v1.31.0" , fmt .Sprintf ("http://%s/%s" , server .Addr (), "envtest-releases.yaml" ))
7474 Expect (err ).ToNot (HaveOccurred ())
7575
76- // Verify latest stable version (v1.32 .0) was downloaded
76+ // Verify exact version (v1.31 .0) was downloaded
7777 versionDownloadDirectory := path .Join (downloadDirectory , fmt .Sprintf ("1.31.0-%s-%s" , runtime .GOOS , runtime .GOARCH ))
7878 Expect (apiServerPath ).To (Equal (path .Join (versionDownloadDirectory , "kube-apiserver" )))
7979 Expect (etcdPath ).To (Equal (path .Join (versionDownloadDirectory , "etcd" )))
@@ -87,6 +87,25 @@ var _ = Describe("Test download binaries", func() {
8787 }
8888 Expect (actualFiles ).To (ConsistOf ("some-file" ))
8989 })
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+ })
90109})
91110
92111var (
@@ -101,6 +120,15 @@ var (
101120 "envtest-v1.32.0-linux-s390x.tar.gz" : {},
102121 "envtest-v1.32.0-windows-amd64.tar.gz" : {},
103122 },
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+ },
104132 "v1.31.0" : map [string ]archive {
105133 "envtest-v1.31.0-darwin-amd64.tar.gz" : {},
106134 "envtest-v1.31.0-darwin-arm64.tar.gz" : {},
0 commit comments