mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 23:45:25 +02:00
Merge pull request #56 from priyawadhwa/mtime
Add --snapshot-mode flag to allow only considering mtime when snapshotting
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user