Commit Graph

44 Commits

Author SHA1 Message Date
Tejal Desai 31f626cb22 initilize group to 0 2020-02-03 22:15:56 -08:00
Tejal Desai 56125ff464 Rebase from master with some changes 2020-02-03 14:57:10 -08:00
xanonid e3b5a7b85d Support COPY --chown flag (Closes: #9) 2020-02-03 14:56:23 -08:00
Tejal Desai 6894be442f remove duplicate code 2020-02-01 15:19:36 -08:00
Tejal Desai 956495784e fix group string being always set to uid in case a user has a gid set 2020-02-01 15:19:36 -08:00
Moritz Wanzenböck 123dcaf83e Fix caching to respect .dockerignore
Previously kaniko would compute the cache key for any copy command by computing
the combined hash of all files in a directory, even if they were listed
as ignored.

With this change, the cache key creation was updated to be aware of ignored
files.

Related issues:
* https://github.com/GoogleContainerTools/kaniko/issues/594
2020-01-23 15:37:37 -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
Cole Wippern 697037cbcf Add unit tests for compositecache and stagebuilder
* add mock types for testing
* enhance error messaging
* add tests
2019-11-27 21:47:00 -08:00
Monard Vong 019b26e9a0 Simplify logic 2019-09-22 01:09:36 +02:00
Monard Vong d96cbfe0d3 Fix formatting 2019-09-16 00:03:10 +02:00
Monard Vong 38474fad11 Fix #691 - ADD does not understand ENV variables 2019-09-15 23:08:44 +02:00
Taylor Barrella 3422d5572a Misc. small changes/refactoring (#712) 2019-07-23 15:10:22 -07: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 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
Peter van Zetten 073abff176 Improve IsDestDir functionality with filesystem info
Add a check for FileInfo to determine whether a given string is a
directory path. If any error occurs, fall back to the naive string
check.

Fixes #365
2018-10-11 11:11:12 +01:00
Priya Wadhwa ccb6259b06 More linting errors 2018-09-11 14:58:25 -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
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
Nick Kubala e45d1f6aac
Update deps 2018-07-31 16:23:23 -07:00
Priya Wadhwa 54282e3e8c
Fix bug in snapshotting 2018-06-21 14:07:59 -07:00
Jon Johnson 8b0a1a7689 dep update go-containerregistry 2018-06-03 00:59:34 +00:00
Sharif Elgamal 5e6b60f46e
adding metadata tests back to integration tests (#185)
* adding metadata tests back to integration tests and fixing resulting bugs

* fix onbuild and default env

* removing old test files

* adding the ArgsEscaped boolean on CMD commands

* fix onbuild test

* ignore failing test until container-diff is fixed

* code comments

* adding todo to remove uncomment failing test
2018-05-24 11:28:32 -07:00
Priya Wadhwa 282f8abbee
Merge master, refactor to work with ARG 2018-05-11 15:53:11 -07:00
Priya Wadhwa 4de14c34dd
Wrap BuildArgs in our own type 2018-05-11 10:23:13 -07:00
Priya Wadhwa 26d8501489
Support BuildArgs for arg command 2018-05-09 12:24:38 -07:00
Priya Wadhwa 7dbc7a04a7
Support multi stage builds 2018-04-23 17:25:12 -07:00
Priya Wadhwa be38696c7d Updated unit tests after refactor 2018-04-19 20:39:29 -07:00
Priya Wadhwa 6054d7e653 Refactor copy and add
Refactor copy and add

Add/copy pass integration tests
2018-04-19 20:27:41 -07:00
Cyrille Hemidy 84bab8fde2
Update command_util.go
fix comment
2018-04-17 10:53:34 +02:00
priyawadhwa cebb4031b3 copy symlinks (#90) 2018-04-14 08:00:20 -07:00
Priya Wadhwa e5542e8893
fixed comment 2018-04-03 10:43:35 -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 f6139f249a
Merge branch 'master' of github.com:GoogleCloudPlatform/k8s-container-builder into env-replacement 2018-03-26 10:50:23 -07:00
Priya Wadhwa dbb0774778
Environment replacement 2018-03-21 15:01:21 -07:00
Priya Wadhwa f56b3e9542
Environment replacement 2018-03-21 13:37:00 -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