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

Using --no-push and remote caching dont work with each other #2752

Closed
dosilyoun opened this issue Sep 19, 2023 · 4 comments · Fixed by #3132
Closed

Using --no-push and remote caching dont work with each other #2752

dosilyoun opened this issue Sep 19, 2023 · 4 comments · Fixed by #3132
Labels
area/caching For all bugs related to cache issues area/cli bugs related to kaniko CLI differs-from-docker issue/tar kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@dosilyoun
Copy link

dosilyoun commented Sep 19, 2023

Actual behavior
If I build and push with kaniko using remote caching, everything works as expected. If I just want to create a tarball and dont push final image but use remote-cache for the layers then it is not working.

Error uploading layer to cache: failed to push to destination ..io/********:*** POST https://..io/v2/****/blobs/uploads/: : Not Found

Expected behavior
I am able to use remote caching even If I dont push the built image itself

To Reproduce
Use any docker image to build and the most recent kaniko debug docker image.
Use flags --cache, --cache-repo and --no-push.

Description Yes/No
Please check if this a new feature you are proposing No
Please check if the build works in docker but not in kaniko Yes
Please check if this error is seen when you use --cache flag Yes
Please check if your dockerfile is a multistage dockerfile No
@aaron-prindle aaron-prindle added kind/bug Something isn't working issue/tar area/caching For all bugs related to cache issues priority/p2 High impact feature/bug. Will get a lot of users happy area/cli bugs related to kaniko CLI labels Sep 20, 2023
@JeromeJu
Copy link
Collaborator

JeromeJu commented Sep 27, 2023

Thanks for the issue @dosilyoun , would you mind providing more details i.e. which version of kaniko image is used here? There happened to be a patch on --no-push option with the usage of tarball in v1.15.0 earlier, wondering if that could be the corner case there.

@dosilyoun
Copy link
Author

@JeromeJu I have only used v1.15.0

@dosilyoun
Copy link
Author

dosilyoun commented Dec 18, 2023

@JeromeJu v1.15.0 version of kaniko debug image:
used parameters: --context=/builds/test --dockerfile=/builds/test/Dockerfile --destination=test.jfrog.io/test-repo/test: --cache=true --cache-repo=test.jfrog.io/test-repo --tar-path=test-image.tar --image-name-tag-with-digest-file=digest-file-test-image.tar --no-push --skip-push-permission-check --reproducible --log-timestamp=true --compressed-caching=false --ignore-path=/usr/lib/libcrypto.so.3 --ignore-path=/usr/lib/libssl.so.3

warning message:
WARN[2023-12-18T11:12:51Z] Error uploading layer to cache: failed to push to destination test.jfrog.io/test-repo:9a1bb639d73987c818596cce99235f8de7b5779d47fd193e01507a675df79543: POST https://test.jfrog.io/v2/test-repo/blobs/uploads/: : Not Found

this file has never existed in my JFrog artifactory(https://test.jfrog.io/v2/test-repo/blobs/uploads/)

Samarth08 added a commit to Samarth08/kaniko that referenced this issue Apr 22, 2024
--no-push and remote caching dont work with each other
@Samarth08 Samarth08 mentioned this issue Apr 22, 2024
4 tasks
@aaron-prindle
Copy link
Collaborator

aaron-prindle commented Jun 4, 2024

As noted in #3180, the fix here was not correct and has been undone given the --no-push-cache flags usage and current use cases around pushing cached images but not the target image. To not push cache layers, the --no-cach-push flag should be used and to not push anything both the --no-push and --no-push-cache flag should be used. This was not documented well prior, this PR adds this flag to the public docs:
https://github.com/GoogleContainerTools/kaniko/pull/3188/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/caching For all bugs related to cache issues area/cli bugs related to kaniko CLI differs-from-docker issue/tar kind/bug Something isn't working 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