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

Adding node ip hint for all who want to use it #185

Merged

Conversation

tsorya
Copy link
Contributor

@tsorya tsorya commented Jul 6, 2022

No description provided.

@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 Jul 6, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 6, 2022

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

@tsorya
Copy link
Contributor Author

tsorya commented Jul 6, 2022

@cybertron this is what you meant in openshift/machine-config-operator#3222 ?

Copy link
Contributor

@dougsland dougsland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems a good patch but it's in Draft mode. Are you planing to update it?

@tsorya tsorya force-pushed the igal/ovs_config_node_ip_file branch from bb4381c to d330904 Compare September 6, 2022 10:12
@tsorya tsorya marked this pull request as ready for review September 8, 2022 15:50
@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 Sep 8, 2022
@tsorya
Copy link
Contributor Author

tsorya commented Sep 8, 2022

@dougsland waited for enhancement to be pushed

@openshift-ci openshift-ci bot requested a review from creydr September 8, 2022 15:50
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
@tsorya tsorya force-pushed the igal/ovs_config_node_ip_file branch 3 times, most recently from 15e5ebd to 21853a3 Compare September 9, 2022 10:40
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 9, 2022
@tsorya tsorya force-pushed the igal/ovs_config_node_ip_file branch from 21853a3 to 311abcd Compare September 9, 2022 10:43
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 9, 2022
@tsorya tsorya force-pushed the igal/ovs_config_node_ip_file branch from 311abcd to 7cee609 Compare September 9, 2022 10:50
Copy link
Member

@cybertron cybertron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of things from my test in a dual stack env. Otherwise lgtm.

cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
@tsorya tsorya force-pushed the igal/ovs_config_node_ip_file branch 2 times, most recently from cc9b257 to 05314b5 Compare September 10, 2022 16:10
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
return err
}
ipv6Created = true
} else if !ipv4Created {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me a little nervous. If we ever got two ipv6 chosenAddresses, it could potentially result in us writing an ipv6 address to the ipv4 file. To avoid checking IsIPv6 twice (which, honestly, I think is premature optimization. This is a service that runs once per boot and is not performance critical code), I think we need that to be an outer check and then within the cases for it we do the ipv*Created checks. Something like:

if isipv6 {
  if !ipv6Created {
    create file
  }
} else {
  if !ipv4Created {
     create file
  }
}

Note that I don't think it's currently possible to get two ipv6 addresses in chosenAddresses, but if I'm wrong or that changes in the future I'd prefer to have this code handle it correctly.

Copy link
Contributor Author

@tsorya tsorya Sep 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a bug from my side . We should check if not ipv6 , this is why it was there from the start. Sorry

@tsorya
Copy link
Contributor Author

tsorya commented Sep 14, 2022

/retest

Copy link
Member

@cybertron cybertron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question inline, but the logic looks good to me and this version worked correctly in my local dual stack deployment.

@@ -142,7 +166,7 @@ func checkAddressUsable(chosen []net.IP) (err error) {
// If using IPv6, verify that the choosen address isn't tentative
// i.e. we can actually bind to it
if len(chosen) > 0 && net.IPv6len == len(chosen[0]) {
_, err = net.Listen("tcp", "["+chosen[0].String()+"]:")
_, err = net.Listen("tcp", "["+chosen[0].String()+"]:10010")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it as test and forgot to remove

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think we should remove it so we aren't adding another required port. Since ci has passed on this version, do you want to do that as a followup?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 14, 2022

@tsorya: all tests passed!

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/test-infra repository. I understand the commands that are listed here.

@cybertron
Copy link
Member

/lgtm
/approve

Checked locally in a dual stack env and this correctly populated all of the files. We should be good to go here.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 15, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cybertron, tsorya

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 Sep 15, 2022
@openshift-merge-robot openshift-merge-robot merged commit 0504b5d into openshift:master Sep 15, 2022
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants