Skip to content

Conversation

@sethboyles
Copy link
Member

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 main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

nicolasbender and others added 16 commits April 24, 2025 09:47
Co-authored-by: Nicolas Bender <[email protected]>
Co-authored-by: Pavel Busko <[email protected]>
Co-authored-by: Johannes Dillmann <[email protected]>
Co-authored-by: Johannes Dillmann <[email protected]>
Co-authored-by: Pavel Busko <[email protected]>
Co-authored-by: Nicolas Bender <[email protected]>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 24, 2025

CLA Not Signed


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:)
Copy link
Member Author

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

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gerg pointed out to me that line in the RFC is about POST, not list. @pbusko was it your intention to have a default filter on the list endpoint?

Copy link
Contributor

@pbusko pbusko Apr 25, 2025

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")
Copy link
Contributor

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

Copy link
Contributor

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 <[email protected]>
Co-authored-by: Pavel Busko <[email protected]>
@pbusko
Copy link
Contributor

pbusko commented Apr 25, 2025

Would you mind opening a PR with your additions to the original (https://github.com/sap-contributions/cloud_controller_ng/tree/cnb-system-buildpacks)?

tomkennedy513 and others added 2 commits April 25, 2025 11:31
- 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 <[email protected]>
@sethboyles
Copy link
Member Author

@sethboyles sethboyles closed this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants