Allow to exclude build-args and env vars from cache key
Description
We are building a system that helps us build docker images inside k8s. We are using kaniko for this purpose. This system is highly interactive as we aim to offer a seamless experience for our end-users. To achieve this, we utilize build caches. However, for every build, we need to generate different build-args and environment variables that cannot be the same each time. Although they change with each build, they do not affect the resulting docker image. Therefore, we require options in kaniko to exclude these build-args and envs from the cache key. If we do not do this, we will experience 100% cache misses, which would be undesirable.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you review them:
- [X] Includes unit tests
- [ ] Adds integration tests if needed.
See the contribution guide for more details.
Reviewer Notes
- [ ] The code flow looks good.
- [ ] Unit tests and or integration tests added.
Release Notes
- kaniko/executor adds a new flag
--exclude-build-arg-from-cache-keyspecify build-args that should be excluded from composite cache key - kaniko/executor adds a new flag
--exclude-env-from-cache-keyspecify environment variables that should be excluded from composite cache key
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.