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