Skip to content

Commit 8124efb

Browse files
committed
fix: cache e2e
Failing cache e2e due to missing command. Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com>
1 parent 4adcda0 commit 8124efb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

internal/integration/cli/image.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ func (suite *ImageSuite) TestPull() {
156156
)
157157
}
158158

159-
// TestCacheCreate verifies creating a cache tarball.
160-
func (suite *ImageSuite) TestCacheCreate() {
159+
// TestCacheCreateOCI verifies creating a cache tarball.
160+
func (suite *ImageSuite) TestCacheCreateOCI() {
161161
if testing.Short() {
162162
suite.T().Skip("skipping in short mode")
163163
}
@@ -172,7 +172,7 @@ func (suite *ImageSuite) TestCacheCreate() {
172172

173173
cacheDir := suite.T().TempDir()
174174

175-
args := []string{"image", "cache-create", "--image-cache-path", cacheDir, "--force"}
175+
args := []string{"image", "cache-create", "--image-cache-path", cacheDir, "--force", "--layout", "oci"}
176176

177177
args = append(args, imagesArgs...)
178178

@@ -181,32 +181,30 @@ func (suite *ImageSuite) TestCacheCreate() {
181181
assert.FileExistsf(suite.T(), cacheDir+"/index.json", "index.json should exist in the image cache directory")
182182
}
183183

184-
// TestRegistryCreate verifies creating a registry cache.
185-
func (suite *ImageSuite) TestRegistryCreate() {
184+
// TestCacheCreateFlat verifies creating a cache directory.
185+
func (suite *ImageSuite) TestCacheCreateFlat() {
186186
if testing.Short() {
187187
suite.T().Skip("skipping in short mode")
188188
}
189189

190-
stdOut, _ := suite.RunCLI([]string{"image", "source-bundle", "v1.11.2"})
190+
stdOut, _ := suite.RunCLI([]string{"image", "default"})
191191

192192
imagesList := strings.Split(strings.Trim(stdOut, "\n"), "\n")
193193

194194
imagesArgs := xslices.Map(imagesList[:2], func(image string) string {
195195
return "--images=" + image
196196
})
197197

198-
storageDir := suite.T().TempDir()
198+
cacheDir := suite.T().TempDir()
199199

200-
args := []string{"image", "registry", "create", storageDir}
200+
args := []string{"image", "cache-create", "--image-cache-path", cacheDir, "--force", "--layout", "flat"}
201201

202202
args = append(args, imagesArgs...)
203203

204204
suite.RunCLI(args, base.StdoutEmpty(), base.StderrNotEmpty())
205205

206-
assert.FileExistsf(suite.T(), storageDir+"pause/index.json", "pause/index.json should exist in the image cache directory")
207-
assert.FileExistsf(suite.T(), storageDir+"pause/oci-layout", "pause/oci-layout should exist in the image cache directory")
208-
assert.FileExistsf(suite.T(), storageDir+"siderolabs/kubelet/index.json", "siderolabs/kubelet/index.json should exist in the image cache directory")
209-
assert.FileExistsf(suite.T(), storageDir+"siderolabs/kubelet/oci-layout", "siderolabs/kubelet/oci-layout should exist in the image cache directory")
206+
assert.DirExistsf(suite.T(), cacheDir+"/blob", "blob directory should exist in the image cache directory")
207+
assert.DirExistsf(suite.T(), cacheDir+"/manifests", "manifests directory should exist in the image cache directory")
210208
}
211209

212210
func init() {

0 commit comments

Comments
 (0)