Commit Graph

29 Commits

Author SHA1 Message Date
Tejal Desai 31f626cb22 initilize group to 0 2020-02-03 22:15:56 -08:00
xanonid 517cb50278 Add Unit test for GetUIDAndGIDFromString 2020-02-03 14:56:23 -08:00
ohchang-kwon d6fe98aa49 Fixed an issue where the image is broken if there are symlink in the destination path when ADD, COPY 2020-01-03 16:28:12 +09:00
Tejal Desai 9eb4a1c1ff
Merge pull request #801 from victornoel/776-dockerignore-relative
Support Dockerfile.dockerignore
2019-10-04 01:56:40 -07:00
Victor Noel db12a77e6c Fix #776 2019-10-03 17:53:14 +02:00
Monard Vong 13b8fb6345 remove trailing whitespace 2019-09-15 23:29:54 +02:00
Monard Vong 38474fad11 Fix #691 - ADD does not understand ENV variables 2019-09-15 23:08:44 +02:00
dlorenc 246cc92a33
Optimize file copying and stage saving between stages. (#605)
This change calculates the exact files and directories needed between
stages used in the COPY command. Instead of saving the entire
stage as a tarball, we now save only the necessary files.
2019-03-13 07:47:28 -07:00
dlorenc 2abe109eb2
Environment variables should be replaced in URLs in ADD commands. (#580)
We were previously explicitly skipping this for some reason, but Docker
seems to expand these in URLs so we should too.
2019-02-25 10:42:34 -06:00
Priya Wadhwa 7fd164deab Only parse .dockerignore once 2018-12-11 13:31:51 -08:00
Priya Wadhwa b0b36ed85a Re-add support for .dockerignore file
This PR adds support for the dockerignore file. Previously when kaniko
had support for the dockerignore file, kaniko first went through the
build context and deleted files that were meant to be ignored. This
resulted in a really bad bug where files in user mounted volumes would
be deleted (my bad).

This time around, instead of modifying the build context at all, kaniko
will check if a file should be excluded when executing ADD/COPY
commands. If a file should be excluded (based on the .dockerignore) it
won't be copied over from the buildcontext and shouldn't end up in the
final image.

I also added a .dockerignore file and Dockerfile as an integration test,
which should fail if the dockerignore is not being processed correctly or if files aren't being excluded correctly.
Also, I removed all the integration testing from the previous version of the
dockerignore support.
2018-12-10 15:20:25 -08:00
Priya Wadhwa 99ab68e7f4 Replace gometalinter with GolangCI-Lint
gometalinter is broken @ HEAD, and I looked into why that was. During
that process, I remembered that we took the linting scripts from
skaffold, and found that in skaffold gometalinter was replaced with
GolangCI-Lint:

https://github.com/GoogleContainerTools/skaffold/pull/619

The change made linting in skaffold faster, so I figured instead of
fixing gometalinter it made more sense to remove it and replace it with
GolangCI-Lint for kaniko as well.
2018-09-11 13:30:42 -07:00
Priya Wadhwa 1513295103 Make sure paths are absolute before matching files to wildcard sources
The bug in #329 occurred because of a bug in matchSources, where the
filepath wasn't absolute, so the source "/kaniko-bug/*" wasn't being
matched to the file "kaniko-bug/test-file"

To fix this, I added logic for making filepaths absolute and added to
the unit test for the function to test that it works.
2018-08-31 11:57:20 -07:00
priyawadhwa 52e9863810
fix add command bug when adding remote URLs (#277) 2018-08-07 17:10:27 -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
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
Sharif Elgamal f8aa88b119
Integration test refactoring (#126)
* integration test refactoring

* config file cleanup

* more test refactoring

* remove debug file

* moving around more files

* fixing up integration tests

* integration tests work

* some housekeeping

* fixing tests

* addressing comments

* debugging

* debugging

* actual debugging

* skip integration tests for travis

* install container-diff before integration tests

* syntax

* make test failures less noisy

* fixing tests

* hopefully fixing CI?

* fixes

* more fixes

* let's actually fix CI

* more testing

* testing

* proper auth

* typos

* adding support for args in integration tests

* formatting

* formatting

* adding support for testing bucket context

* adding bucket test dockerfile

* addressing comments

* syntax
2018-05-15 13:42:35 -07:00
Priya Wadhwa be38696c7d Updated unit tests after refactor 2018-04-19 20:39:29 -07:00
Matt Rickard cff201dee6 org rename from GoogleCloudPlatform to GoogleContainerTools 2018-04-17 11:45:39 -07:00
Priya Wadhwa ec510a161b
change imports from k8s-container-builder to kaniko 2018-04-12 15:35:54 -07:00
Priya Wadhwa 89400b7410
Add command with unit tests 2018-03-28 13:34:00 -07:00
Priya Wadhwa b64f23b078
Use default token for parsing 2018-03-27 09:44:51 -07:00
Priya Wadhwa dbb0774778
Environment replacement 2018-03-21 15:01:21 -07:00
Priya Wadhwa cf24231121
WIP 2018-03-20 17:15:09 -07:00
Priya Wadhwa 58e70d8b77
Environment replacement 2018-03-20 15:56:31 -07:00
Priya Wadhwa cc0c672697
Add support for dest = '.' and additional DestinationFilepath test 2018-03-20 14:10:13 -07:00
Priya Wadhwa de8cc1a285
Fixed check srcs function and create file with correct permissions 2018-03-16 14:11:06 -07:00
Priya Wadhwa 5ebf156d94
Fixed relative filepath and unit test 2018-03-15 13:47:40 -07:00
Priya Wadhwa 21a9207428
Copy command and unit tests 2018-03-14 17:06:46 -07:00