Merge pull request #56 from priyawadhwa/mtime

Add --snapshot-mode flag to allow only considering mtime when snapshotting
This commit is contained in:
priyawadhwa
2018-04-12 15:01:59 -07:00
committed by GitHub
4 changed files with 46 additions and 2 deletions
+9 -1
View File
@@ -45,6 +45,7 @@ var fileTests = []struct {
kanikoContext string
kanikoContextBucket bool
repo string
snapshotMode string
}{
{
description: "test extract filesystem",
@@ -53,6 +54,7 @@ var fileTests = []struct {
dockerContext: dockerfilesPath,
kanikoContext: dockerfilesPath,
repo: "extract-filesystem",
snapshotMode: "time",
},
{
description: "test run",
@@ -69,6 +71,7 @@ var fileTests = []struct {
dockerContext: dockerfilesPath,
kanikoContext: dockerfilesPath,
repo: "test-run-2",
snapshotMode: "time",
},
{
description: "test copy",
@@ -77,6 +80,7 @@ var fileTests = []struct {
dockerContext: buildcontextPath,
kanikoContext: buildcontextPath,
repo: "test-copy",
snapshotMode: "time",
},
{
description: "test bucket build context",
@@ -231,13 +235,17 @@ func main() {
// Then, buld the image with kaniko
kanikoImage := testRepo + kanikoPrefix + test.repo
snapshotMode := ""
if test.snapshotMode != "" {
snapshotMode = "--snapshotMode=" + test.snapshotMode
}
contextFlag := "--context"
if test.kanikoContextBucket {
contextFlag = "--bucket"
}
kaniko := step{
Name: executorImage,
Args: []string{"--destination", kanikoImage, "--dockerfile", test.dockerfilePath, contextFlag, test.kanikoContext},
Args: []string{"--destination", kanikoImage, "--dockerfile", test.dockerfilePath, contextFlag, test.kanikoContext, snapshotMode},
}
// Pull the kaniko image