feat: add insecure registries configuration for buildpacks buildstrategy#2159
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This is similar to what the buildah and source-to-image BuildStragegy provide. Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
f696fc0 to
0ad9f06
Compare
SaschaSchwarze0
left a comment
There was a problem hiding this comment.
Thanks @sgaist for your contribution. Some ideas/questions/suggestions:
- In a Build, one can set
.spec.output.insecure = true. For a strategy-managed push buildstrategy (like buildpacks), we can pass this value to the build strategy using the system-defined parametershp-output-insecure. Today, we only honor this in BuildKit's sample build strategy: https://github.com/shipwright-io/build/blob/v0.19.2/samples/v1beta1/buildstrategy/buildkit/buildstrategy_buildkit_cr.yaml#L69-L70. I think with the CNB variable you are using, we can also support it in Buildpacks with some scripting in the bash script. We should do this, though, it would only be for the output registry. In most scenarios, that is probably enough. - The parameter that you are added is a single string. Users will need to know the format that Buildpacks expect (like how to separate multiple registry hosts). For consistency, it would be nice to have it as an array like in BuildAh. Do you see blockers for this ?
- Brings me to the question, whether you think this is only needed for the registry the image is pushed to (then I'd say supporting
shp-output-insecureis enough), or if you think that users may also want to access other images (only the run-image comes to my mind) from an insecure registry.
Do you mean have an
My bad, I thought I had updated the description, it's a comma separated list. I will fix while we discuss design. I wanted to use an array for it however it seems that it's something that is not possible for environment variable content but maybe I missed something during my tests.
I completely missed that second scenario and I think that is also a valid use case. |
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This is required to have the insecure registries support. Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
16eee1e to
f90dda6
Compare
|
@sgaist correct, it means to programmatically fill the content of the |
Move the handling logic into the script part. This allows users users to use a list in their Build/BuildRun and also matches other implementations. Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
c56cb3b to
2976db7
Compare
Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
|
@SaschaSchwarze0 There's another thing that could be done to simplify things in these BuildStrategies: pack's lifecycle now also has the creator executable that run the five phases in order. |
Changes
This PR adds the insecure registries configuration option for buildpacks buildstrategy.
This is similar to what the buildah and source-to-image BuildStragegy provide and will allow people using local registries or registries behind self-signed certificate to use buildpacks to build their image.
Related Issue
Not a secure solution but partly related to #1835 while waiting for SHIP-0042 implementation.
Type of PR
/kind feature
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes