Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #691 - ADD does not understand ENV variables #768

Merged
merged 6 commits into from
Oct 4, 2019
Merged

Fix #691 - ADD does not understand ENV variables #768

merged 6 commits into from
Oct 4, 2019

Conversation

N4rm0
Copy link
Contributor

@N4rm0 N4rm0 commented Sep 15, 2019

Fixes #691

The issue was that function ResolveEnvironmentReplacementList tries to check if value is a remote url. However, it misses the case the url is enclosed in the environment variable.

I made an additional check to fix #691, but IHMO I think it would be cleaner to remove the flag "isFilepath", and let the function ResolveEnvironmentReplacement handle the remote file url case.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@N4rm0
Copy link
Contributor Author

N4rm0 commented Sep 15, 2019

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@tejal29
Copy link
Member

tejal29 commented Sep 20, 2019

Looks like the integration test failed due to-

Error building images: Failed to build image gcr.io/kaniko-test/docker-dockerfile_test_whitelist with kaniko command "[docker run -v /home/kbuilder/.config/gcloud:/root/.config/gcloud -v /tmpfs/tmp/171480209:/kaniko/benchmarks -v /usr/local/go/src/github.com/GoogleContainerTools/kaniko/integration:/workspace -e BENCHMARK_FILE=false executor-image -f /workspace/dockerfiles/Dockerfile_test_whitelist -d gcr.io/kaniko-test/kaniko-dockerfile_test_whitelist  -c /workspace]": exit status 1 INFO[0000] Resolved base name debian@sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe to debian@sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe 
INFO[0000] Resolved base name debian@sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe to debian@sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe 
INFO[0000] Error while retrieving image from cache: getting file info: stat /cache/sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe: no such file or directory 
INFO[0000] Downloading base image debian@sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe 
INFO[0000] Built cross stage deps: map[]                
INFO[0000] Error while retrieving image from cache: getting file info: stat /cache/sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe: no such file or directory 
INFO[0000] Downloading base image debian@sha256:38236c068c393272ad02db100e09cac36a5465149e2924a035ee60d6c60c38fe 
INFO[0000] Unpacking rootfs as cmd RUN mkdir -p /var/test     && mkdir -p /etc/test     && touch /var/test/testfile     && touch /etc/test/testfile     && ls -lah /var/test     && ls -lah /etc/test; requires it. 
INFO[0019] Taking snapshot of full filesystem...        
INFO[0053] RUN mkdir -p /var/test     && mkdir -p /etc/test     && touch /var/test/testfile     && touch /etc/test/testfile     && ls -lah /var/test     && ls -lah /etc/test; 
INFO[0053] cmd: /bin/sh                                 
INFO[0053] args: [-c mkdir -p /var/test     && mkdir -p /etc/test     && touch /var/test/testfile     && touch /etc/test/testfile     && ls -lah /var/test     && ls -lah /etc/test;] 
total 8.0K
drwxr-xr-x  2 root root 4.0K Sep 17 17:50 .
drwxr-xr-x 12 root root 4.0K Sep 17 17:50 ..
-rw-r--r--  1 root root    0 Sep 17 17:50 testfile
total 8.0K
drwxr-xr-x 2 root root 4.0K Sep 17 17:50 .
drwxr-xr-x 1 root root 4.0K Sep 17 17:50 ..
-rw-r--r-- 1 root root    0 Sep 17 17:50 testfile
INFO[0053] Taking snapshot of full filesystem...        
error pushing image: failed to push to destination gcr.io/kaniko-test/kaniko-dockerfile_test_whitelist:latest: UNKNOWN: Unable to write upload.
exit status 1
FAIL	github.com/GoogleContainerTools/kaniko/integration	356.172s


[ID: 5997453] Build finished after 443 secs, exit value: 1

@N4rm0
Copy link
Contributor Author

N4rm0 commented Sep 21, 2019

@tejal29 I am not sure what cause the issue with the integration test, as I ran them without encountering the error mentioned in your log.
I took the liberty of adding a test case in the integration test for ADD.

Could you relaunch the integration tests ?

@tejal29
Copy link
Member

tejal29 commented Oct 4, 2019

re-launching the tests.

@tejal29 tejal29 merged commit 2218859 into GoogleContainerTools:master Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ADD does not understand ENV variables
4 participants