Bug 2037209: refactor for AlibabaResourceReference changes#26
Conversation
|
@elmiko: This pull request references Bugzilla bug 2037209, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions 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. |
|
this is most likely going to fail until we merge the API changes in openshift/api#1096 |
313325b to
eb21db0
Compare
| // An error will be returned if no group id can be found, or if multiple groups are | ||
| // found from the search tags. | ||
| func getResourceGroupId(machineProviderConfig *machinev1.AlibabaCloudMachineProviderConfig) (string, error) { | ||
| switch machineProviderConfig.ResourceGroup.Type { |
There was a problem hiding this comment.
What happens when resource group is nil? Is this allowed? IIRC someone said resource group was an optional field?
There was a problem hiding this comment.
it seems like we fail if the resource group is nil currently, the way the code is structured i'm not sure how it's supposed to find the security groups without the group id. but maybe that's ok?
There was a problem hiding this comment.
i asked around a little bit, and we should not allow creation of resources in the default group. the user should always specify the resource group.
There was a problem hiding this comment.
I saw a comment about most customers using the default group, are we sure this is correct?
There was a problem hiding this comment.
sorry, i worded that poorly. we definitely should allow creation in the default group, but we should force the user to always specify the resource group so that there are no surprises when creating new machines.
There was a problem hiding this comment.
It looks to me that resource group will never be nil in a provider config https://github.com/openshift/api/blob/master/machine/v1/types_alibabaprovider.go#L140 it's not a pointer
There was a problem hiding this comment.
+1, we agreed that the user should always provide this information, even in the case where they want to use the default resource group. this will help ensure that the user isn't creating resources in the wrong group by accident.
3f585d6 to
b7f49e3
Compare
|
updated to match the API changes and to reflect our requirements |
|
@jianli-wei it looks like it is still unable to build this, until we get the api change in place. |
|
/hold this will need to revendor the api before we can merge it |
|
here is the installer patch that should work this as well, openshift/installer#5562 |
|
i have added a second commit to vendor from my branch of the api, this is only for testing and should be replaced before we merge. |
This change updates the logic around security group IDs, vswitch IDs, and resource group IDs to match the union changes in the resource reference API. AlibabaResourceReferences now contain a `Type` variable which indicates whether it is an ID or a list of Tags. The behavior has not been changed for security groups, vswitches, and resource groups. This change is being added to help allow for scenarios where the ResourceGroupID is not known and must be searched. Now that the AlibabaResourceReference contains a discriminating union of ID and Tags, we can properly address scenarios with limited information.
b0f5174 to
bf65da9
Compare
bf65da9 to
1bf50a9
Compare
This is required to support the resource reference changes.
1bf50a9 to
d773426
Compare
|
now that the API changes have merged, i have revendored this repository. we need one final round of manual testing before releasing the hold here. |
| // An error will be returned if no group id can be found, or if multiple groups are | ||
| // found from the search tags. | ||
| func getResourceGroupId(machineProviderConfig *machinev1.AlibabaCloudMachineProviderConfig) (string, error) { | ||
| switch machineProviderConfig.ResourceGroup.Type { |
There was a problem hiding this comment.
It looks to me that resource group will never be nil in a provider config https://github.com/openshift/api/blob/master/machine/v1/types_alibabaprovider.go#L140 it's not a pointer
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexander-demichev, elmiko The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@elmiko: all tests passed! 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. |
|
Test with this code today: and /lgtm |
|
removing the hold here as we have a good test signal. thanks @kwoodson ! |
|
@elmiko: Some pull requests linked via external trackers have merged: The following pull requests linked via external trackers have not merged:
These pull request must merge or be unlinked from the Bugzilla bug in order for it to move to the next state. Once unlinked, request a bug refresh with Bugzilla bug 2037209 has not been moved to the MODIFIED state. DetailsIn response to this:
Instructions 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. |
This change updates the logic around security group IDs, vswitch IDs,
and resource group IDs to match the union changes in the resource
reference API. AlibabaResourceReferences now contain a
Typevariablewhich indicates whether it is an ID or a list of Tags.
The behavior has not been changed for security groups, vswitches, and
resource groups. This change is being added to help allow for scenarios
where the ResourceGroupID is not known and must be searched. Now that
the AlibabaResourceReference contains a discriminating union of ID and
Tags, we can properly address scenarios with limited information.