diff --git a/README.md b/README.md index 22dfb53a1..0d58c4013 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Requirements: To run kaniko in a Kubernetes cluster, you will need a standard running Kubernetes cluster and a Kubernetes secret, which contains the auth required to push the final image. -To create the secret, first you will need to create a service account in the Pantheon project you want to push the final image to, with `Storage Admin` permissions. +To create the secret, first you will need to create a service account in the Google Cloud Console project you want to push the final image to, with `Storage Admin` permissions. You can download a JSON key for this service account, and rename it `kaniko-secret.json`. To create the secret, run: diff --git a/integration-test.sh b/integration-test.sh index c44135fd3..2763b0ccd 100755 --- a/integration-test.sh +++ b/integration-test.sh @@ -13,7 +13,16 @@ # limitations under the License. #!/bin/bash -set -e +set -ex + +if [ -f "$KOKORO_GFILE_DIR"/common.sh ]; then + echo "Installing dependencies..." + source "$KOKORO_GFILE_DIR/common.sh" + mkdir -p /usr/local/go/src/github.com/GoogleCloudPlatform/ + cp -r github/kaniko /usr/local/go/src/github.com/GoogleCloudPlatform/ + pushd /usr/local/go/src/github.com/GoogleCloudPlatform/kaniko +fi echo "Running integration tests..." +make out/executor go run integration_tests/integration_test_yaml.go | gcloud container builds submit --config /dev/fd/0 . diff --git a/integration_tests/integration_test_yaml.go b/integration_tests/integration_test_yaml.go index 38d54ac52..fc01d4848 100644 --- a/integration_tests/integration_test_yaml.go +++ b/integration_tests/integration_test_yaml.go @@ -182,7 +182,8 @@ type step struct { } type testyaml struct { - Steps []step + Steps []step + Timeout string } func main() { @@ -232,6 +233,7 @@ func main() { y := testyaml{ Steps: []step{containerDiffStep, containerDiffPermissions, structureTestsStep, structureTestPermissions, GCSBucketTarBuildContext, uploadTarBuildContext, buildExecutorImage, buildOnbuildImage, pushOnbuildBase}, + Timeout: "1200s", } for _, test := range fileTests { // First, build the image with docker diff --git a/pkg/util/fs_util.go b/pkg/util/fs_util.go index 3c25a1878..5fb06f6ee 100644 --- a/pkg/util/fs_util.go +++ b/pkg/util/fs_util.go @@ -160,6 +160,7 @@ func CreateFile(path string, reader io.Reader, perm os.FileMode) error { if err != nil { return err } + defer dest.Close() if _, err := io.Copy(dest, reader); err != nil { return err }