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

Support pushing cache even when using --no-push #3180

Closed
leosunmo opened this issue May 28, 2024 · 1 comment · Fixed by #3181
Closed

Support pushing cache even when using --no-push #3180

leosunmo opened this issue May 28, 2024 · 1 comment · Fixed by #3181

Comments

@leosunmo
Copy link
Contributor

Actual behavior
When using --no-push with --cache=true (and --cache-repo=my-reg) Kaniko will not push any cached layers to the registry.

INFO[0007] Pushing layer my-reg/cache/52445215:35656a0e1... to cache now 
INFO[0007] Skipping push to container registry due to --no-push flag 

This is undocumented and a bit unexpected given the presence of the --no-push-cache flag.

Expected behavior
Be able to not push the final image with --no-push but still benefit from cache being pushed.

Additional Information
Our use-case and workflow is that we do not push images immediately after Kaniko builds them, but instead save them as tars (--tar-path) and then scan them with a container vulnerability scanner in the CI pipeline. Once that's passed the tar image is pushed to the registry.

It seems like this used to work before https://github.com/GoogleContainerTools/kaniko/pull/3132/files was merged. It seems to fix an issue (#2752) that probably should have used the --no-push-cache option instead of the --no-push option.

Ideally the cache should be pushed as long as the --no-push-cache flag is not provided, regardless of the --no-push being present or not.

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 N/A
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@jability
Copy link

The changes that #2752 brought were completely unexpected. I bet a lot of people were using the pushed layers in their pipelines.
I think this issue is the right way to do it.

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 a pull request may close this issue.

2 participants