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

Bug 1822326: Add extra checks for ipv6 addresses when checking the etcd env #296

Merged

Conversation

retroflexer
Copy link
Contributor

The fix for Bug 1817028 (https://bugzilla.redhat.com/show_bug.cgi?id=1817028) introduced a new init container to validate the etcd environment before firing up the etcd. However, the checks for ensuring the etcd environment rely on ipstring comparison which fail in the ipv6 environments.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 8, 2020
@openshift-ci-robot
Copy link

@retroflexer: This pull request references Bugzilla bug 1822326, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1822326: Add extra checks for ipv6 addresses when checking the etcd env

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.

@retroflexer
Copy link
Contributor Author

/test e2e-metal-ipi

@@ -25,13 +25,15 @@ spec:
: "${NODE_NODE_ENVVAR_NAME_ETCD_NAME?not set}"
: "${NODE_NODE_ENVVAR_NAME_IP?not set}"

if [ "${NODE_NODE_ENVVAR_NAME_IP}" != "${NODE_IP}" ]; then
# check for ipv4 addresses as well as ipv6 addresses with extra square brackets
if [ "${NODE_NODE_ENVVAR_NAME_IP}" != "${NODE_IP}" -a "${NODE_NODE_ENVVAR_NAME_IP}" != "[${NODE_IP}]" ]; then
Copy link
Contributor

@hexfusion hexfusion Apr 8, 2020

Choose a reason for hiding this comment

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

small nit use of -a syntax has been depricated please use &&[1].

I think we should add shellcheck to our unit tests.

[1] : https://github.com/koalaman/shellcheck/wiki/SC2166

Copy link
Member

Choose a reason for hiding this comment

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

Why is $NODE_IP bracket wrapped?

I think it was a reasonable assumption in the original PR that a variable named $NODE_IP was actually just an IP, so I'd be concerned about this problem surfacing again elsewhere. IMHO, the IP shouldn't be wrapped until it's included in the host portion of a URI.

net.JoinHostPort in go will handle it, and for scripts we have a helper in our env that might be able to be reused:

https://github.com/openshift-metal3/dev-scripts/blob/49a5e1444b24a0f9f1ab7c033f510c3a13255702/utils.sh#L71-L85

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stbenjam Here NODE_IP doesn't come bracket wrapped, but NODE_NODE_ENVVAR_NAME_IP is bracket wrapped as it is used the host portion of a URI. We are trying to match these variables to check the validity of the environment, and hence the check in this init container.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, I misread what was being checked! Sorry.

I think the general point is still the same, it's a reasonable assumption for someone looking at a variable with the name "IP" to assume it's an IP, and not a host for a URI.

@stbenjam
Copy link
Member

stbenjam commented Apr 8, 2020

/test e2e-metal-ipi

@stbenjam
Copy link
Member

stbenjam commented Apr 8, 2020

e2e-metal-ipi failure is new, due to metal3-io/metal3-dev-env#280 - we're getting it fixed now

@stbenjam
Copy link
Member

stbenjam commented Apr 8, 2020

Should be fixed

/test e2e-metal-ipi

@retroflexer
Copy link
Contributor Author

/test e2e-metal-ipi

@hexfusion
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hexfusion, retroflexer

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 9, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@stbenjam
Copy link
Member

stbenjam commented Apr 9, 2020

Not sure why e2e-metal-ipi is failing, it's not even getting to the point where etcd can run. Will have a look in the morning.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@stbenjam
Copy link
Member

stbenjam commented Apr 9, 2020

It was some of the dual stack work (openshift-metal3/dev-scripts#1012)

/test e2e-metal-ipi

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@retroflexer
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link

@retroflexer: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-azure 1bbc1dd link /test e2e-azure
ci/prow/e2e-aws-disruptive 1bbc1dd link /test e2e-aws-disruptive

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 0b3ff60 into openshift:master Apr 9, 2020
@openshift-ci-robot
Copy link

@retroflexer: All pull requests linked via external trackers have merged: openshift/cluster-etcd-operator#296. Bugzilla bug 1822326 has been moved to the MODIFIED state.

In response to this:

Bug 1822326: Add extra checks for ipv6 addresses when checking the etcd env

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.

@retroflexer
Copy link
Contributor Author

/cherrypick release-4.4

@openshift-cherrypick-robot

@retroflexer: #296 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	bindata/etcd/pod.yaml
M	pkg/operator/etcd_assets/bindata.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/operator/etcd_assets/bindata.go
CONFLICT (content): Merge conflict in pkg/operator/etcd_assets/bindata.go
Auto-merging bindata/etcd/pod.yaml
CONFLICT (content): Merge conflict in bindata/etcd/pod.yaml
Patch failed at 0001 Add extra checks for ipv6 addresses to match the environment variables with node ip

In response to this:

/cherrypick release-4.4

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.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. 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

7 participants