This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When an image is very small, filesystem creation using mkfs fails due to not enough space. This adds a minimum base image size that's used when the image is too small. Also, fixes the /etc/resolv.conf symlink error when there's no /etc directory in the image filesystem. /etc dir is created as part of the import step if it doesn't exists. Adds an e2e test for this fix using hello-world docker container image which is tiny and lacks /etc dir.
- Loading branch information
Showing
2 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package e2e | ||
|
||
import ( | ||
"fmt" | ||
"os/exec" | ||
"testing" | ||
|
||
"gotest.tools/assert" | ||
) | ||
|
||
func TestImportTinyImage(t *testing.T) { | ||
assert.Assert(t, e2eHome != "", "IGNITE_E2E_HOME should be set") | ||
|
||
// NOTE: Along with tiny image, this also tests the image import failure | ||
// when there's no /etc directory in the image filesystem. | ||
|
||
testImage := "hello-world:latest" | ||
// Remove if the image already exists. | ||
rmvImgCmd := exec.Command( | ||
igniteBin, | ||
"image", "rm", testImage, | ||
) | ||
// Igore error if the image doesn't exists. | ||
_, _ = rmvImgCmd.CombinedOutput() | ||
|
||
// Import the image. | ||
importImgCmd := exec.Command( | ||
igniteBin, | ||
"image", "import", testImage, | ||
) | ||
importImgOut, importImgErr := importImgCmd.CombinedOutput() | ||
assert.Check(t, importImgErr, fmt.Sprintf("image import: \n%q\n%s", importImgCmd.Args, importImgOut)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters