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 a Git context, kaniko will fail if the repository already exits in the local filesystem. #1118

Open
rkamradt opened this issue Mar 8, 2020 · 2 comments
Labels
area/context area/jenkins-parallel issues related to kaniko usage in jenkins kind/enhancement New feature or request

Comments

@rkamradt
Copy link

rkamradt commented Mar 8, 2020

Actual behavior
My use-case is I'm using Kaniko in Kubernetes to pull source from GitHub, build an image and push to a local repository. My Jenkins pipeline creates a Kaniko pod and will keep it around for a specified amount of time and reuse it if needed. When it gets reused to build from the same git repository if gives the error 'Error: error resolving source context: repository already exists'

Expected behavior
For a git context, it should ignore any exiting files and overwrite them with a new clone, or a pull from the repository.

Additional Information
The repository I am using is here https://github.com/rkamradt/HelloK8sBuild
In particular, the Jenkinsfile creates the kaniko pod to be used to build images.

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
@tejal29
Copy link
Contributor

tejal29 commented Mar 18, 2020

Thanks @rkamradt for your issue. When we designed kaniko we did not think of it as a pod which could be reusable.
Do you see any performance improvement for your Jenkins job when keeping the pod around and re-using it?

Looking forward to make Kaniko as re-usable as possible.

@tejal29 tejal29 added area/context kind/enhancement New feature or request area/jenkins-parallel issues related to kaniko usage in jenkins labels Mar 18, 2020
@rkamradt
Copy link
Author

it takes about 30 seconds to spin up a slave pod for kaniko. My workaround, for now, is to create two worker pods, since my pipeline creates an app image and a tester image. You can read more about what I'm trying to accomplish here: https://medium.com/better-programming/playing-with-pipelines-b5cf357ddd06?source=friends_link&sk=fa2e5729c6c8b02641cee94e8b99d340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/context area/jenkins-parallel issues related to kaniko usage in jenkins kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants