Fixed no-push flag and added compressedCaching option when building skaffold kaniko
Fixes: #7008 Fixed kaniko's no-push option.
Fixes: compressedCaching Added to support kaniko's compressedCaching=false flag.
Description
I used kaniko when building our company's CICD, but while trying to migrate to skaffold for multi-architecture builds, I discovered that the no-push option and compressedCaching=false that I had been using were not possible with skaffold. While testing kaniko when building CICD, I discovered that the no-push option could only be used if there was no destination. Also, when there are a lot of images and the like during build, turning off the compressed caching option was a necessary option because it reduced excessive memory usage, although the build time increased.
User facing changes (remove if N/A) skaffold enables the use of kaniko's no-push and compressedCaching=false options.
Follow-up Work (remove if N/A) To add the new flag feature, I looked into reverting the commit that removed the existing no-push feature and added the necessary code.
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.
I sincerely apologize for the immaturity of my initial PR, as my contribution experience is still limited. Since there were config changes and I noticed that the previous version had already been released, I created a new version and added a commit with the new feature. However, the commit history became cluttered, so I consolidated it into two final commits to keep things cleaner.
I also later discovered that the test code is quite sensitive to the order of Kaniko arguments. Adapting the test code to the main code changes turned out to be more challenging than expected, so I minimized the modifications while still ensuring the tests pass.
Please let me know if there are any additional changes or adjustments you would like me to make. Thank you very much for your time and review.
The modified Kaniko no-push works correctly for single-platform builds. However, the issue described in the main text was confirmed to occur in multi-platform builds. The problem appears to arise during the process of generating a new image after each platform build by checking the remote registry metadata. Accordingly, Kaniko no-push was modified to skip this step. While it may not be the optimal solution, tests have shown that it works reliably, including layer caching after the build.
I believe it would be more appropriate to split this PR. Therefore, I am reverting b903841 commit and will submit a separate PR specifically addressing the #9861 issue.