-
Notifications
You must be signed in to change notification settings - Fork 367
Add cnb file support #4320
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
Add cnb file support #4320
Conversation
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Nicolas Bender <nicolas.bender@sap.com>
Co-authored-by: Nicolas Bender <nicolas.bender@sap.com>
Co-authored-by: Nicolas Bender <nicolas.bender@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Nicolas Bender <nicolas.bender@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
|
|
|
||
| def self.list_admin_buildpacks(stack_name=nil, lifecycle=Config.config.get(:default_app_lifecycle)) | ||
| scoped = exclude(key: nil).exclude(key: '') | ||
| scoped = scoped.filter(lifecycle:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to remove this line (or the default arg). This hides all buildpacks of the non-default type on the list endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is intentional: https://github.com/cloudfoundry/community/blob/main/toc/rfc/rfc-0031-system-cnb.md#proposal
It's very confusing though, and breaks the CLI if you are trying to update a buildpack that is not of the default lifecycle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list of admin buildpacks for an app must be of the same lifecycle as the app itself, therefore scoping is necessary.
The list endpoint is filtered in a different place:
| dataset = dataset.where(lifecycle: message.requested?(:lifecycle) ? message.lifecycle : Config.config.get(:default_app_lifecycle)) |
Also the list must be filtered. Current versions of CF CLI would receive a misleading list of buildpack of different lifecycles and mixed orders, which would produce incorrect buildpack tables.
We plan to implement CNB support in CLI, so both types can be queried/updated
| mime_bits_at_offset = File.read(bits_path, 8, 257) | ||
| return if mime_bits_at_offset =~ /^#{VCAP::CloudController::CNB_MIME}/ | ||
|
|
||
| errors.add(:base, "#{bits_name} is not a zip or gzip archive or cnb file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CNB file has to specific format, it's simly a tarball
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the cnb file is part of the buildpack spec (https://github.com/buildpacks/spec/blob/main/distribution.md#buildpackage). Even though its just a tar, we want to imply that we are just following the cnb spec and if that format changes in the future we would expect to adapt to that change.
Co-authored-by: Nicolas Bender <nicolas.bender@sap.com> Co-authored-by: Pavel Busko <pavel.busko@sap.com>
|
Would you mind opening a PR with your additions to the original (https://github.com/sap-contributions/cloud_controller_ng/tree/cnb-system-buildpacks)? |
- This is a follow on to cloudfoundry#3898 which only supports uploading CNBs as zip or tgz whereas they are released in cnb format Signed-off-by: Tom Kennedy <tom.kennedy@broadcom.com>
8b21e57 to
07231d1
Compare
* also add missing docs
|
Closing in favor of https://github.com/sap-contributions/cloud_controller_ng/pull/374/files |
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
An explanation of the use cases your change solves
Links to any other associated PRs
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests