-
Notifications
You must be signed in to change notification settings - Fork 48
Catalog handling to filter plans/services in case of cross consumption #207
Catalog handling to filter plans/services in case of cross consumption #207
Conversation
* Parameterized the path that gets registered as broker. * Added settings for supported_platform and osbapi_compliant_name * Catalogs are shown based on the supported_platform * Changed implementation for PlatformManagers, instance assignment is removed from it. * Added new test for K8S catalog * Fixed Quota test which was changing the catalog
|
Hey subhankarc! Thanks for submitting this pull request! All pull request submitters and commit authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA (individual or corporate). When sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization. If you are confident that you're covered under a Corporate CLA, please make sure you've publicized your membership in the appropriate Github Org, per these instructions. Once you've publicized your membership, one of the owners of this repository can close and reopen this pull request, and dreddbot will take another look. |
|
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/155509320 The labels on this github issue will be updated when the story is started. |
CC API version check was added to support 2.8 version. Removing that check now.
kamath-prasad
left a comment
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.
minor comments.
lib/fabrik/Fabrik.js
Outdated
| } | ||
|
|
||
| static getPlatformManager(platform) { | ||
| const PlatformManager = (platform && CONST.PLATFORM_MANAGER[platform]) ? require(`./${CONST.PLATFORM_MANAGER[platform]}`) : undefined; |
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.
attribute name should start with small case here - platformManager
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.
As it is a class reference, kept it as PlatformManager
| supportUrl: 'https://sap.com/' | ||
| dashboard_client: | ||
| id: 'service-fabrik-blueprint-client' | ||
| secret: 'service-fabrik-blueprint-secret' |
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.
maybe its better to have a new plan to have support for k8s and leave the current one's for cf as the plan name in k8s has to be in different format ?!
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 will not be any new plan. The same existing BOSH plans will be shown for K8S as well.
jagadish-kb
left a comment
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.
Per discussion please also update the method ensurePlatformContext.
|
|
||
| PLATFORM_MANAGER: { | ||
| 'cloudfoundry': 'CfPlatformManager' | ||
| 'cloudfoundry': 'CfPlatformManager', |
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.
instead of duping, would it rather make sense to set PLATFORM_ALIAS in context at the top of broker processing? that way we always access the manager class via the alias?
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 have change this and removed the duped ones. Have handled that in the getPlatformManager code.
| return; | ||
| } else { | ||
| throw new PreconditionFailed(`At least Broker API version ${minVersion} is required.`); | ||
| } |
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 below ensures that if the calls from CF are coming in, then for the dependencies of SF on CF are checked via this. This might be true always, but nevertheless a check that could help in rarest of scenarios. Obviously if we are never going to increase the version of minCloudControllerApiVersion & we for sure know CF is already upgraded above this version then this check is unnecessary. Nevertheless worth a discussion before removal.
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.
Post discussion, this is not needed. Keeping this comment for history.
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.
sure.
lib/fabrik/BasePlatformManager.js
Outdated
|
|
||
| get platform() { | ||
| return this.context.platform; | ||
| getPlatformSpecificCatalog(catalog) { |
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.
Platformmanager is to return things platformSpecifc :-), so may be can we strip this from the method name and just keep it getCatalog. Also can return undefined from BasePlatformManager as its implementation from specific manager is absent.
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.
:) changed it.
changing the name of method getCatalog in platform specific catalog filtering Removed the duped key values
jagadish-kb
left a comment
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.
good to go!
Also, see cloudfoundry/servicebroker#442 and cloudfoundry/servicebroker#452