Add IBM Cloud Service constants#1612
Conversation
|
in general i think this is a fine place for these constants that aren't necessarily used by the API and also are not in an ibm sdk package. curious to hear what @JoelSpeed thinks |
ef01862 to
8868604
Compare
|
Can you provide an example of where these constants will be used? |
|
Sure, here are a few of the references that are currently dependent on "local" constants (local to the component/repo): https://github.com/openshift/installer/pull/7632/files#diff-0b98c83784b19fcbc6c922a2837517b15df4331ec67a851d806db02af4b45d86R102-R104 |
pkg/cloudprovider/const.go
Outdated
| package cloudprovider | ||
|
|
||
| const ( | ||
| // IBM Cloud Service Name constants. |
There was a problem hiding this comment.
given @JoelSpeed 's comment, i think it's worthwhile to add a comment here explaining what these are used for/by. eg something
// These constants are used by MAO, MCO, CIO, Installer to identify blah blah blah
7bfbb39 to
12f144f
Compare
|
Given we now have a concrete list of supported constants, why can we not make the API an enum? |
|
I will see if I can refactor that, given I would expect to make conversions to/from string, should those helped functions be placed alongside, or somewhere also in |
|
@cjschaef imo, if we move this to an enum in openshift/api then we should put the helper functions there as well. edit: |
|
Enum in openshift API should be kube compliant, which means PascalCase. For the IBM SDK you need a different format. So I'd expect a conversion util and consts that are IBM SDK compliant to exist where this PR proposes them today. The conversion util would take in one of the enum values from openshift/api and convert it to the IBM SDK equivalent. It doesn't even need to have any care for wider types since the API enum should use a typed string alias. |
just to be clear, you want to see the consts and util funcs here, and then the enum in the api package? |
|
There should be two sets of constants. In the API, the enum will be constructed based on type aliases for the different services This is what I expect to see in API, here, there should be something similar but for the IBM SDK versions (lower cased), and then a transform |
|
Okay, I'll see about getting a new Updated |
|
I opened the I will refactor this PR, which would strictly be the helper functions, as I don't have hard requirements to use all lowercase names, currently, if we will be refactoring downstream PR's as well (MAPI, installer, etc.). Done |
12f144f to
65ff370
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cjschaef 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 |
Add helper functions for converting IBMCloudServiceName types to strings and back. Related: https://issues.redhat.com/browse/SPLAT-1097
Update go mod to pull in PR changes to openshift/api, for the IBMCloudServiceName enum.
65ff370 to
0e6fcc0
Compare
|
@cjschaef: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
I don't know that these helper functions are required any longer, now that the I'm going to close this PR, as downsteam uses of the new |
Add constants for the IBM Cloud Services, in relation to the ability to override these service endpoints in operators and the installer.
Related: https://issues.redhat.com/browse/SPLAT-1097