-
Notifications
You must be signed in to change notification settings - Fork 367
Read storage-cli config JSON from capi (AzureRM) #4581
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
base: main
Are you sure you want to change the base?
Conversation
Stop building storage-cli JSON inside CC; instead consume files rendered by capi job templates. StorageCliClient now selects the JSON file by `resource_type`.
05de380 to
dbf843c
Compare
dbf843c to
8c8c630
Compare
e763ccc to
4d069a4
Compare
4d069a4 to
4c7d0cc
Compare
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.
Looks good, just some minor findings.
| raise BlobstoreError.new("Unknown resource_type: #{resource_type}") | ||
| end | ||
|
|
||
| path = VCAP::CloudController::Config.config.get(key) |
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.
What if config.get(key) returns nil? Maybe include key in the error message?
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.
If resource_type does not match any of the specified cases line 50-54, the else branch will raise a BlobstoreError before key is assigned, so execution will not reach line 59 with a nil value for key.
| json | ||
| end | ||
|
|
||
| def config_path_for!(resource_type) |
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.
Why an exclamation mark in the method name? It doesn't modify the passed object. Same for the other methods in this class.
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.
In cloud controller validation/check functions that raise an error end with an exclamation mark vs validation/check function that raise not an error do not end with an exclamation mark..
…nt is not building the config any more
5c884e0 to
2596e92
Compare
Stop building storage-cli JSON inside CC; instead consume files rendered by capi job templates. StorageCliClient now selects the JSON file by
resource_type.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:
Adopt storage_cli_client to read json configs rendered by capi. Detect correct json file by resource_type.
An explanation of the use cases your change solves
Switch responsibility of JSON generation to capi-release so CC only reads well-formed per-resource configs. This removes duplication of storage cli config file creation.
Links to any other associated PRs
Use single blobstore_configs.json + pre-start to write config files capi-release#580
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