Commit Graph

45 Commits

Author SHA1 Message Date
Andreas Fleig 01763bce5b
Fix fs_util tests failing on systems with /tmp mountpoint (#2583)
* Rename IgnoreListPath to MountInfoPath in config & constants

The string points to /proc/self/mountinfo

* fs_util_test.go: fix tests failing when /tmp mountpoint present

The tests

* Test_GetFSFromLayers_ignorelist
* Test_GetFSFromLayers_with_whiteouts_include_whiteout_disabled
* Test_GetFSFromLayers_with_whiteouts_include_whiteout_enabled

were failing on systems with a /tmp mountpoint:

fs_util.InitIgnoreList() adds all mountpoints to the ignore list,
but the tests were expecting file operations in a /tmp subdirectory.

This change provides an empty mountinfo list for the affected tests.

Fixes #1779
2023-06-19 12:01:20 -07:00
Joe Kimmel 906cc96b59
Upgrade docker (#2440)
* somehow now the only thing that doesnt work is devices.Device

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* this gets rid of all the compiler errors in the vendored code

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* fixed some things but a bunch of tests and maybe some compiler steps are still failing

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* all the things i figured out how to fix so far

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* guess i had to redo go mods after rebasing again

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* update docker constants to be SHOUTY CASE now

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* include DestPath in resolveEnv

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* fix one mistake in Docker lib upgrade and some typos/deprecations in the file

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

* last changes (hopefully) to update to new docker libs

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>

---------

Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
2023-03-23 20:34:25 -04:00
Jack d4cf49077a
feat: kaniko dir config option (#1997)
* remove configurables from constants

* add configurables to config init

* add kaniko dir flag

* cleanup pkg constants

* replace buildcontext constants pkg occurrences with config

* add KanikoDir to KanikoOptions

* replace executor constants pkg occurrences with config

* remove redundant KanikoDir assignment

* replace constants to config for IntermediateStagesDir

* fix imports

* add default kaniko directory into constants

* add check for kanikoDir on use

* update init to use default path constant

* update executor kanikoDir check

Co-authored-by: Jason Hall <jasonhall@redhat.com>

* alter checkKanikoDir parameter

* add TestKanikoDir func

* update error handling style

Co-authored-by: Jason Hall <jasonhall@redhat.com>

* remove shorthand flag usage from test

Co-authored-by: Jason Hall <jasonhall@redhat.com>

* add docstring to integration test

Co-authored-by: Jason Hall <jasonhall@redhat.com>

* remove shorthand flag from kaniko-dir

Co-authored-by: Jason Hall <jasonhall@redhat.com>
2022-03-31 15:10:23 -04:00
Naveen 783979948d
Fix - Incomplete regular expression for hostnames (#1993)
Fixed the codeql issue
```
Sanitizing untrusted URLs is an important technique for preventing attacks such as request forgeries and malicious redirections. Often, this is done by checking that the host of a URL is in a set of allowed hosts.

If a regular expression implements such a check, it is easy to accidentally make the check too permissive by not escaping regular-expression meta-characters such as ..

Even if the check is not used in a security-critical context, the incomplete check may still cause undesirable behavior when it accidentally succeeds.

```
2022-03-16 00:16:04 -04:00
Tejal Desai 094fe52b37
Revert "save snaphots to tmp dir (#1662)" (#1670)
This reverts commit 754253d375.
2021-06-14 12:09:07 -07:00
Patrick Barker 754253d375
save snaphots to tmp dir (#1662) 2021-06-14 12:08:47 -07:00
Lars bdcdec7c93
Remove unused code (#1495) 2020-12-08 16:11:42 -08:00
Tejal Desai ec3ca84ad9 add another redo snapshotter 2020-06-04 22:02:13 -07:00
Tejal Desai cbf3073fda rename whitelist to ignorelist 2020-06-02 15:56:27 -07:00
Or Sela 9dd050b892 set log format using a flag 2020-02-07 00:05:59 +02:00
Tao Yang a86ffc8c57
Apply suggestions from code review
fix formatting based on review

Co-Authored-By: Tejal Desai <tejal29@gmail.com>
2019-10-21 10:19:32 +08:00
yangtaokm 3e6a24b152 Initial commit for Azure Blob Storage SupportX 2019-10-13 20:52:19 +08:00
Takeaki Matsumoto 35bb350a49 Add support for S3 custom endpoint
For S3-compatible object storage (like minio),
this patch enable to use custom endpoint-url.

Fix #531
2019-06-13 12:42:52 +09:00
Priya Wadhwa 3da2fdf2d0 Merge branch 'issue#269' of https://github.com/vkartik97/kaniko into vkartik97-issue#269 2019-02-21 11:55:51 -08:00
dlorenc 877abd30ed
Refactor whitelist handling. (#559)
Also speed up stage deletion.
2019-02-13 11:17:56 -06:00
Kartik Verma 2f8bdd99b7
Resolved Merge Conflicts 2019-02-02 11:28:40 +05:30
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
Kartik Verma fdac2fa94c
Resolved merge in README 2018-11-02 19:46:48 +05:30
Priya Wadhwa 55e6157000 Fix bugs with .dockerignore and improve integration test
I improved handling of the .dockerignore file by:

1. Using docker's parser to parse the .dockerignore and using their
helper functions to determine if a file should be deleted
2. Copying the Dockerfile we are building to /kaniko/Dockerfile so that
if the Dockerfile is specified in .dockerignore it won't be deleted, and
if it is specified in the .dockerignore it won't end up in the final
image
3. I also improved the integration test to create a temp directory with
files to ignore, and updated the .dockerignore to include exclusions (!)
2018-10-31 12:50:23 -07:00
peter-evans 49b2fa5199 Set root user to default home 2018-10-18 17:59:07 +09:00
dlorenc 9a0e29c441
Refactor the build loop. (#385)
This change refactors the build loop a bit to make cache optimization easier in the future. Some notable changes:

The special casing around volume snapshots is removed. Every volume is added to the snapshotFiles list for every command that will snapshot anyway.
Snapshot saving was extracted to a sub-function
The decision on whether or not to snapshot was extracted
2018-10-09 12:15:17 -05:00
Kartik Verma 30640261d2
Updating the Fork 2018-10-02 16:21:44 +05:30
peter-evans b1e28ddb4f Fix handling of volume directive 2018-09-28 11:16:25 +09:00
Priya Wadhwa cd1b957e43 Address code review comments; review unnecessary error check 2018-09-17 11:11:51 +01:00
Kartik Verma 7da7bc016f
Created Git buildcontext 2018-09-03 18:03:20 +05:30
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
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
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
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 52c5759fc4
create list of build files 2018-04-16 11:08:40 -07:00
Priya Wadhwa c7bcc673fc
allow snapshot of kaniko certs so kaniko can build kaniko 2018-04-16 10:43:01 -07:00
Priya Wadhwa 50ef6fe9c1
Build trigger for building kaniko executor image 2018-04-12 15:25:40 -07:00
Priya Wadhwa 8d2e646214
Fixed merge conflict 2018-04-12 15:03:09 -07:00
Priya Wadhwa d38319c416
Add support for scratch images, and integration test 2018-04-12 14:57:33 -07:00
Priya Wadhwa 3f561782a8
Fixed merge conflict, added validation 2018-04-12 10:30:25 -07:00
Priya Wadhwa c63a03d123
rename to kaniko 2018-04-04 14:52:13 -07:00
Priya Wadhwa bd49b459e5
Merged master, fixed merge conflict 2018-04-04 14:38:39 -07:00
Priya Wadhwa 74c4a6629d
Unpack context.tar.gz from bucket 2018-04-03 14:58:50 -07:00
Priya Wadhwa fad0d25aec
Add README and update name to kaniko 2018-04-02 14:00:15 -07:00
Priya Wadhwa 85bbb6edff
Unpack tar from GCS bucket 2018-03-26 13:59:56 -07:00
Priya Wadhwa 75e7e47b76
Added integration test, minor changes to files 2018-03-08 11:49:56 -08:00
Priya Wadhwa 43bad54292
Added snapshot package and tests 2018-02-28 11:05:57 -08:00
Priya Wadhwa 093dfd04df
Unpack filesystem and whitelist from /proc/self/mountinfo 2018-02-21 11:02:30 -08:00
Priya Wadhwa c284f25441 Added CLI flags and set logs 2018-02-20 20:50:03 -08:00