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

ADD using an url with GET parameters and a directory destination includes the GET parameters in the file name #3032

Closed
elan-slovelock opened this issue Feb 29, 2024 · 1 comment · Fixed by #3053
Labels
cmd/add differs-from-docker priority/p1 Basic need feature compatibility with docker build. we should be working on this next. priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@elan-slovelock
Copy link

Actual behavior
The GET parameters of the url are included in the filename when the destination is a directory.

Expected behavior
The filename should have the GET parameters removed.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Dockerfile with the following contents
FROM ubuntu:jammy
ADD https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf?ext=.txt test-dir/
RUN ls -l test-dir
  1. Build using docker to observe the output from line 3 is
total 16
-rw------- 1 root root 13264 Aug 27  2007 dummy.pdf
  1. Build using kaniko to observe the output from line 3 is
total 16
-rw------- 1 root root 13264 Aug 27  2007 dummy.pdf?ext=.txt

Additional Information

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@JeromeJu JeromeJu added differs-from-docker cmd/add priority/p1 Basic need feature compatibility with docker build. we should be working on this next. priority/p2 High impact feature/bug. Will get a lot of users happy labels Feb 29, 2024
prima101112 added a commit to prima101112/kaniko that referenced this issue Mar 7, 2024
prima101112 added a commit to prima101112/kaniko that referenced this issue Mar 17, 2024
@prima101112
Copy link
Contributor

hi @JeromeJu already rebased the PR. please review anytime

prima101112 added a commit to prima101112/kaniko that referenced this issue Mar 21, 2024
aaron-prindle pushed a commit that referenced this issue Mar 22, 2024
#3053)

* Fix #3032: Remove query parameters in ADD command when the destination is a directory

* fixing linter URL sorry forget to lint

* add error in extractFilename and realize that ResolveEnvironmentReplacement better execute before getting the filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/add differs-from-docker priority/p1 Basic need feature compatibility with docker build. we should be working on this next. priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants