Skip to content
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

Merged
merged 1 commit into from
May 14, 2024

Conversation

bryan-cox
Copy link
Member

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 13, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented May 13, 2024

@bryan-cox: This pull request references HOSTEDCP-1655 which is a valid jira issue.

In response to this:

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2024
Copy link
Contributor

openshift-ci bot commented May 13, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added do-not-merge/needs-area area/cli Indicates the PR includes changes for CLI and removed do-not-merge/needs-area labels May 13, 2024
Copy link
Contributor

openshift-ci bot commented May 13, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2024
@bryan-cox
Copy link
Member Author

/test all

@bryan-cox
Copy link
Member Author

/test all

@bryan-cox
Copy link
Member Author

/retest

// 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)
Copy link
Contributor

@muraee muraee May 13, 2024

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
  }
}

@bryan-cox bryan-cox force-pushed the HOSTEDCP-1655 branch 2 times, most recently from 154a91d to 473734e Compare May 13, 2024 17:57
@bryan-cox
Copy link
Member Author

/test all

@bryan-cox
Copy link
Member Author

/retest

cmd/infra/azure/create.go Outdated Show resolved Hide resolved
Signed-off-by: Bryan Cox <brcox@redhat.com>
@Patryk-Stefanski
Copy link
Contributor

/lgtm

@bryan-cox bryan-cox marked this pull request as ready for review May 14, 2024 13:41
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2024
@bryan-cox
Copy link
Member Author

/retest

@bryan-cox
Copy link
Member Author

/retest

1 similar comment
@bryan-cox
Copy link
Member Author

/retest

Copy link
Contributor

openshift-ci bot commented May 14, 2024

@bryan-cox: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure cc58a30 link false /test e2e-azure

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 83d120a into openshift:main May 14, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cli Indicates the PR includes changes for CLI jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants