Commit Graph

594 Commits

Author SHA1 Message Date
daniel-harrison 587a5e28e3 Enable shared config for s3 2018-08-23 20:53:43 +10:00
priyawadhwa 8f71b7fb26
Merge pull request #295 from priyawadhwa/multistage
Fix bug in SaveStage function for multistage builds
2018-08-21 13:15:10 -07:00
Priya Wadhwa 5e5623e5a4 Fix bug in SaveStage function for multistage builds
This change should fix the bug in #294, where kaniko wasn't recognizing
that a stage would be used in a later build and so wasn't saving it as a
tarball.

Each stage of the Dockerfile has a Name and a BaseName (FROM BaseName as
Name), but if a Name isn't specified then it's set to the same value as
BaseName. Our test cases weren't complete enough to catch this
distinction, which is why this bug occurred.

I added more test cases to the unit tests to make sure this fix works.
2018-08-20 15:10:17 -07:00
priyawadhwa 8bc81fd1ac
Merge pull request #293 from priyawadhwa/fedora
Get absolute path of file before checking whitelist
2018-08-19 18:19:11 -04:00
Priya Wadhwa d8ae5618af Get absolute path of file before checking whitelist
Issue 291 pointed out that symlink "../proc/self/mounts" in the fedora image wasn't being extracted properly and kaniko was erroring out.
This is because the file path wasn't absolute so kaniko wasn't recognizing it as a whitelisted path.
With this change, we first resolve a path to it's absolute path before checking the whitelist.
2018-08-17 18:29:11 -04:00
priyawadhwa 10efecbb74
Merge pull request #292 from rawkode/feature/allow-build-only
Add Flag to Disable Push to Container Registry
2018-08-17 10:50:50 -07:00
David McKay 4535039be9
Add Flag to Disable Push to Container Registry
The flag, `--no-push`, is added to allow building a container image
without pushing to a container registry. It can be common, especially
with multi-stage builds and `--target`, to build enough to run the tests,
and then perform a push in a separate CI step. This will facilitate these
workflows.
2018-08-17 17:49:47 +01:00
Guilherme Rezende 60bdda4c49 Add support for insecure registry (#169) 2018-08-15 11:28:16 -07:00
priyawadhwa 3a9b4fe612
ignore sockets when adding to tar (#288) 2018-08-13 11:26:30 -07:00
priyawadhwa 93d139c5fe
Tag latest in cloudbuild.yaml (#287) 2018-08-13 10:20:44 -07:00
priyawadhwa 4e77fa000d
Set default home value (#281)
* Set default home value

* Apply  default home value based on user for run commands

* rename default home function
2018-08-10 12:58:07 -07:00
priyawadhwa 52e9863810
fix add command bug when adding remote URLs (#277) 2018-08-07 17:10:27 -07:00
Andrea Giardini c44c317b00 Environment variables with multiple '=' are not parsed correctly (#278)
* Provide failing test for an env variable with multiple '='

* Environment variables are split only in two parts
2018-08-07 10:22:48 -07:00
Dale Tristram 2261adca68 Ensure cmd.SysProcAttr is set before modifying it (#275) 2018-08-07 10:09:49 -07:00
Christie Wilson 53b5fb41d2 Don't copy same files twice in copy integration tests (#273)
* Don't copy same files twice in copy integration tests

* Use error from RunCommandWithoutTest
2018-08-03 10:01:29 -07:00
priyawadhwa 954b6129d6
Extract intermediate stages to filesystem (#266)
* WIP

* save and extract stage tarballs if there are dependencies
2018-08-02 09:40:24 -07:00
priyawadhwa 71c83e369c
Only add whiteout files once (#270)
* Only add whiteout files once

* Updated vars
2018-08-01 17:27:20 -07:00
dlorenc 8a2492d241
Fix process group handling. (#271)
Also add a makefile target to build the debug image.
2018-08-01 16:47:32 -07:00
Nick Kubala 63ef549b2c
Merge pull request #265 from nkubala/deps
Update deps
2018-08-01 13:21:34 -07:00
Nick Kubala 32fd56e09f
update go-containerregistry 2018-08-01 13:02:54 -07:00
Nick Kubala e59f05e32f
fix deps 2018-08-01 13:02:54 -07:00
Nick Kubala e45d1f6aac
Update deps 2018-07-31 16:23:23 -07:00
Christie Wilson 5604820c82
Merge pull request #264 from bobcatfish/layer_failure
Add a bit more context to layer offset failures
2018-07-31 15:48:18 -07:00
Christie Wilson 57b1159951 Add a bit more context to layer offset failures
In #251 we are investigating test flakes due to layer offsets not
matching, this change will give us a bit more context so we can be sure
which image has which number of layers, and it will also include the
digest of the image, since kaniko always pushes images to a remote repo,
so if the test fails we can pull the digest and see what is up.

Also updated reproducible Dockerfile to be built with reproducible flag,
which I think was the original intent (without this change, there is no
difference between how `kaniko-dockerfile_test_copy_reproducible` and
`kaniko-dockerfile_test_copy` are built.
2018-07-31 15:33:47 -07:00
priyawadhwa 5db5a7b52e
Release v0.3.0 kaniko (#263) 2018-07-31 11:56:00 -07:00
Christie Wilson 0d7eba9285
Merge pull request #256 from bobcatfish/local_integration_tests
Local integration tests
2018-07-31 10:30:10 -07:00
Christie Wilson b5a4d7636f Pass bucket and repo as args to tests
To allow contributors to run the integration tests with their own GCS
buckets and image repos (since not all contributors will have accesss to
the projects used by the kaniko maintainers) this updates the
integration tests so that these can be provided on the command line.

This allows tests to be run individually, without using `make
integration-test`. Previously, part of the test setup was done
in the shell script (creating the context tarball that is required
for the tests that build images with context). Instead it will be
done in the test iself, so we can use `go test` to run tests
individually if we want to.

If we are running only one individual test, we don't want to build
all of the images, so this commit creates a builder which tracks which
images it has built and can be used by a tests to check if it should
build an image before running, or it will use the images that have
already been built by a previous test.

The name of the context tarball has also been made unique (it includes
the unix timestamp) to avoid potential test flakes if two tests using
the same GCS bucket run simultaneously.
2018-07-31 09:53:59 -07:00
dlorenc e43968f02f
Set a kaniko user agent. (#262) 2018-07-30 13:03:25 -07:00
priyawadhwa cac00b9cb2
Add --target flag for multistage builds (#255)
* Add --target flag for multistage builds

* change validate to validateTarget
2018-07-30 09:43:23 -07:00
Balint Pato ba4c7f4b57
Merge pull request #258 from balopat/fix_247_daemons
Kill grandchildren spun up by child processes
2018-07-26 14:49:53 -07:00
balopat 6fe9ea4248 fixes #247 killing grandchildren processes 2018-07-26 13:56:19 -07:00
balopat 8cad6d0082 reproduced 247 with integration test 2018-07-26 11:16:26 -07:00
priyawadhwa ca5069271c
Fully qualify images in dockerfile tests (#257) 2018-07-25 17:56:17 -07:00
John Oss acf0688195 Fix spelling mistake in README (#249) 2018-07-24 10:53:00 -07:00
Jason Hall 0e3fc0bcd7 Look for usable on-cluster credentials using k8schain (#243)
* dep ensure and use k8schain

* checkpoint

* fix vendoring, stuff builds

* Use k8schain for pushes too

* Use NewNoClient

* update ggcr dep

* Move k8schain usage to image_util.go
2018-07-21 10:22:13 -07:00
priyawadhwa eb6faa05a0
Save each stage in multistage dockerfiles as a tarball (#244)
* resolve basenames in dockerfile to fix multistage bug

* WIP

* WIP

* Save dockerfile stages as tarballs

* added unit tests

* fix unit tests
2018-07-19 11:27:49 -07:00
Christie Wilson 697ad41bc5 Add logo to README (#236) 2018-07-18 11:44:23 -07:00
Christie Wilson d293df5c47 Add DEVELOPMENT.md (#238)
This commit adds docs aimed at folks interested in ramping up and
contributing to kaniko.

It starts with setting up a github account and forking to make sure the
barrier to entry is as low as possible.
2018-07-18 10:52:37 -07:00
dlorenc 8716936977
Switch the valid URL to https://google.com. (#242)
It appears sometimes Github goes down :)
2018-07-18 09:43:12 -07:00
Jason Hall f2ddefc966 Add Travis CI badge to README.md (#241) 2018-07-18 08:41:47 -07:00
Christie Wilson 5f9fb2cb8d Fix remote URL test (#237)
When this test was originally created, an HTTP get to
`https://url.com/something/not/real` probably failed, but now it
will return a `503`, i.e. the `http.Get` call will succeed.

This test will now use a URL which should not reasonable ever
succeed (famous last words). Alternatively we could use dependency
injection and mock `http.Get` but it doesn't seem worth it.

This commit also updates the test to use `Run` to run each test
in the table test as a separate test so we can get a clear indication
which cases fail and which succeed.
2018-07-17 17:21:51 -07:00
priyawadhwa 31b7cd3732
Fix bug in copy command by refactoring whitelist checks (#231)
* Fixed bug

* WIP

* fix unit tests
2018-07-10 08:23:35 -07:00
priyawadhwa a80a7ded35
Update readme (#230)
* update readme

* update readme
2018-07-09 16:51:36 -04:00
priyawadhwa 5f908efbf9
Cut v0.2.0 release (#229) 2018-07-09 15:58:21 -04:00
priyawadhwa dbdf116f8c
make path to Dockerfile an absolute path (#228)
* make path to dockerfile an absolute path

* refactored checking dockerfile path
2018-07-09 14:25:27 -04:00
Shingo Omura 19287f89c5 update go-containerregistry so that kaniko works nicely with Harbor or Gitlab. (#227) 2018-07-06 07:23:44 -07:00
Christian Jantz 65d7b0a9aa Feature/contextsources (#195)
* added switch to extract different sources as build context

* first rough implementation of aws s3

* added buildcontext package and interface

* added GetBuildContext func to buildcontext.go
added fallback to gcs
renamed GC struct to GCS

* improved the default behavior of build context retrieval

* renamed gc:// to gs:// in order to follow common standards

* renamed struct File to Dir and some cleanup work

* moved context.tar suffix to the buildcontext processors where it is needed

* added buildcontext retrieval as struct variable

added fallback if prefix in bucket specifier is present

* cleanup if structures

* added prefix to s3

* WIP

* Fixed build context bugs

* refactored build context
2018-07-06 06:24:50 -07:00
priyawadhwa 7e437390af
Merge pull request #223 from priyawadhwa/readme
Update readme
2018-07-03 15:40:31 -07:00
Priya Wadhwa 3e7d8b219a update readme 2018-07-03 11:59:14 -07:00
priyawadhwa 81f520812c
Merge pull request #218 from dlorenc/workdir
Set a workdir so paths can be relative to /workspace.
2018-06-26 12:36:49 -07:00