-
Notifications
You must be signed in to change notification settings - Fork 296
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
HOSTEDCP-1655: Don't Ignore SubnetID and Network Security Group ID flags when values are passed through #4021
Conversation
@bryan-cox: This pull request references HOSTEDCP-1655 which is a valid jira issue. In 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 openshift-eng/jira-lifecycle-plugin repository. |
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
/test all |
/retest |
cmd/infra/azure/create.go
Outdated
// Extract network security group ID from the VNET ID if the network security group ID was not passed through the flag | ||
networkSecurityGroupID := o.NetworkSecurityGroupID | ||
if len(networkSecurityGroupID) <= 0 || len(result.SecurityGroupID) <= 0 { | ||
vnet, err := azureutil.GetVnetInfoFromVnetID(ctx, result.VNetID, subscriptionID, azureCreds) |
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 both subnetID and NetworkSecurityGroupID are not set, we are going to call this GetVnetInfoFromVnetID
API twice.
I think the check whether to call this API or not should consider both, i.e.:
if len(subnetID) == 0 || len(NetworkSecurityGroupID) == 0 {
vnet, err := azureutil.GetVnetInfoFromVnetID(ctx, result.VNetID, subscriptionID, azureCreds)
if len(subnetID) == 0 {
subnetID = *vnet.Properties.Subnets[0].ID
}
if len(NetworkSecurityGroupID) == 0 {
networkSecurityGroupID = *vnet.Properties.Subnets[0].Properties.NetworkSecurityGroup.ID
}
}
154a91d
to
473734e
Compare
/test all |
/retest |
Signed-off-by: Bryan Cox <brcox@redhat.com>
/lgtm |
/retest |
/retest |
1 similar comment
/retest |
@bryan-cox: The following test failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
83d120a
into
openshift:main
What this PR does / why we need it:
Doesn't ignore the SubnetID and Network Security Group ID flags when values are passed in
Which issue(s) this PR fixes:
Fixes HOSTEDCP-1655
Checklist