mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 00:30:55 +02:00
Changed /work-dir to /kbuild
This commit is contained in:
@@ -39,7 +39,7 @@ out/executor: $(GO_FILES)
|
||||
|
||||
|
||||
out/kbuild: $(GO_FILES)
|
||||
GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS) -tags $(GO_BUILD_TAGS) -o $@ $(KBUILD_PACKAGE)
|
||||
GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=1 go build -ldflags $(GO_LDFLAGS) -tags $(GO_BUILD_TAGS) -o $@ $(KBUILD_PACKAGE)
|
||||
|
||||
.PHONY: test
|
||||
test: out/executor out/kbuild
|
||||
|
||||
@@ -15,5 +15,5 @@
|
||||
# Builds the static Go image to execute in a Kubernetes job
|
||||
|
||||
FROM scratch
|
||||
ADD out/executor /work-dir/executor
|
||||
ADD out/executor /kbuild/executor
|
||||
ADD files/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
@@ -48,7 +48,7 @@ type testyaml struct {
|
||||
}
|
||||
|
||||
var executorImage = "executor-image"
|
||||
var executorCommand = "/work-dir/executor"
|
||||
var executorCommand = "/kbuild/executor"
|
||||
var dockerImage = "gcr.io/cloud-builders/docker"
|
||||
var ubuntuImage = "ubuntu"
|
||||
var testRepo = "gcr.io/kbuild-test/"
|
||||
|
||||
@@ -37,9 +37,9 @@ func TestSnapshotFileChange(t *testing.T) {
|
||||
}
|
||||
// Make some changes to the filesystem
|
||||
newFiles := map[string]string{
|
||||
"foo": "newbaz1",
|
||||
"bar/bat": "baz",
|
||||
"work-dir/bat": "bat",
|
||||
"foo": "newbaz1",
|
||||
"bar/bat": "baz",
|
||||
"kbuild/bat": "bat",
|
||||
}
|
||||
if err := testutil.SetupFiles(testDir, newFiles); err != nil {
|
||||
t.Fatalf("Error setting up fs: %s", err)
|
||||
@@ -134,15 +134,15 @@ func TestSnapshotFiles(t *testing.T) {
|
||||
}
|
||||
// Make some changes to the filesystem
|
||||
newFiles := map[string]string{
|
||||
"foo": "newbaz1",
|
||||
"work-dir/file": "bat",
|
||||
"foo": "newbaz1",
|
||||
"kbuild/file": "bat",
|
||||
}
|
||||
if err := testutil.SetupFiles(testDir, newFiles); err != nil {
|
||||
t.Fatalf("Error setting up fs: %s", err)
|
||||
}
|
||||
filesToSnapshot := []string{
|
||||
filepath.Join(testDir, "foo"),
|
||||
filepath.Join(testDir, "work-dir/file"),
|
||||
filepath.Join(testDir, "kbuild/file"),
|
||||
}
|
||||
contents, err := snapshotter.TakeSnapshotOfFiles(filesToSnapshot)
|
||||
if err != nil {
|
||||
@@ -197,9 +197,9 @@ func setUpTestDir() (string, *Snapshotter, error) {
|
||||
return testDir, nil, errors.Wrap(err, "setting up temp dir")
|
||||
}
|
||||
files := map[string]string{
|
||||
"foo": "baz1",
|
||||
"bar/bat": "baz2",
|
||||
"work-dir/file": "file",
|
||||
"foo": "baz1",
|
||||
"bar/bat": "baz2",
|
||||
"kbuild/file": "file",
|
||||
}
|
||||
// Set up initial files
|
||||
if err := testutil.SetupFiles(testDir, files); err != nil {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var whitelist = []string{"/work-dir"}
|
||||
var whitelist = []string{"/kbuild"}
|
||||
|
||||
// ExtractFileSystemFromImage pulls an image and unpacks it to a file system at root
|
||||
func ExtractFileSystemFromImage(img string) error {
|
||||
|
||||
@@ -46,7 +46,7 @@ func Test_fileSystemWhitelist(t *testing.T) {
|
||||
}
|
||||
|
||||
actualWhitelist, err := fileSystemWhitelist(path)
|
||||
expectedWhitelist := []string{"/work-dir", "/proc", "/dev", "/dev/pts", "/sys"}
|
||||
expectedWhitelist := []string{"/kbuild", "/proc", "/dev", "/dev/pts", "/sys"}
|
||||
sort.Strings(actualWhitelist)
|
||||
sort.Strings(expectedWhitelist)
|
||||
testutil.CheckErrorAndDeepEqual(t, false, err, expectedWhitelist, actualWhitelist)
|
||||
|
||||
Reference in New Issue
Block a user