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

Remove all IPV6 listeners in ingress resources with -disable-ipv6 command line #3139

Conversation

haywoodsh
Copy link
Contributor

@haywoodsh haywoodsh commented Oct 11, 2022

Proposed changes

When -disable-ipv6 command line argument is used, remove all IPV6 listeners in upstream deployed with ingress.
Closes #3138

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@github-actions github-actions bot added the bug An issue reporting a potential bug label Oct 11, 2022
@haywoodsh haywoodsh changed the title Fix -disable-ipv6 command line in ingress upstream Remove all IPV5s listeners in ingress upstream with -disable-ipv6 command line Oct 11, 2022
@haywoodsh haywoodsh changed the title Remove all IPV5s listeners in ingress upstream with -disable-ipv6 command line Remove all IPV6 listeners in ingress upstream with -disable-ipv6 command line Oct 11, 2022
@haywoodsh haywoodsh changed the title Remove all IPV6 listeners in ingress upstream with -disable-ipv6 command line Remove all IPV6 listeners in ingress resources with -disable-ipv6 command line Oct 11, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2022

Codecov Report

Merging #3139 (69a6f64) into main (7ea15be) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #3139   +/-   ##
=======================================
  Coverage   52.54%   52.55%           
=======================================
  Files          58       58           
  Lines       16069    16070    +1     
=======================================
+ Hits         8444     8445    +1     
  Misses       7349     7349           
  Partials      276      276           
Impacted Files Coverage Δ
internal/configs/version1/config.go 0.00% <ø> (ø)
internal/configs/ingress.go 76.90% <100.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more


result, warnings := generateNginxCfg(&cafeIngressEx, nil, nil, false, configParams, isPlus, false, &StaticConfigParams{DisableIPV6: true}, false)

if diff := cmp.Diff(expected, result); diff != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about calculating diff between expected and result only after it is discovered that the values are not equal (aka test fails)?

if !cmp.Equal(expected, result) {
    t.Errorf("generateNginxCfg() returned unexpected result (-want +got):\n%s", cmp.Diff(expected, result))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! Updated in the latest commit.

@github-actions github-actions bot added the tests Pull requests that update tests label Oct 12, 2022
@haywoodsh haywoodsh force-pushed the fix/remove-all-ingress-ipv6-listeners-when-commandline-argument-used branch from 7b304d5 to db33331 Compare October 12, 2022 21:42
@haywoodsh haywoodsh marked this pull request as ready for review October 13, 2022 08:14
@pytest.mark.parametrize(
"ingress_controller",
[
pytest.param({"extra_args": ["-disable-ipv6"]}, id="one-additional-cli-args"),
Copy link
Contributor

@shaun-nx shaun-nx Oct 13, 2022

Choose a reason for hiding this comment

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

What does the id="one-additional-cli-args" option do? I haven't seen that before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just the test ID of the parametrize values in pytest. Since I only have one set of values, I have removed the id and let pytest generate it.

@haywoodsh haywoodsh force-pushed the fix/remove-all-ingress-ipv6-listeners-when-commandline-argument-used branch from ff2d037 to 66899e0 Compare October 13, 2022 11:40
@haywoodsh haywoodsh enabled auto-merge (squash) October 14, 2022 09:49
@haywoodsh haywoodsh disabled auto-merge October 14, 2022 09:49
@haywoodsh haywoodsh enabled auto-merge (squash) October 14, 2022 09:49
@haywoodsh haywoodsh merged commit 4e6caf0 into main Oct 14, 2022
@haywoodsh haywoodsh deleted the fix/remove-all-ingress-ipv6-listeners-when-commandline-argument-used branch October 14, 2022 09:53
haywoodsh added a commit that referenced this pull request Oct 19, 2022
…mand line (#3139)

* Remove ipv6 listeners in ingress upstream with command line argument

Co-authored-by: Venktesh <[email protected]>
(cherry picked from commit 4e6caf0)
@haywoodsh haywoodsh mentioned this pull request Oct 19, 2022
6 tasks
ciarams87 added a commit that referenced this pull request Oct 19, 2022
* Remove all IPV6 listeners in ingress resources with -disable-ipv6 command line  (#3139)

* Remove ipv6 listeners in ingress upstream with command line argument

Co-authored-by: Venktesh <[email protected]>
(cherry picked from commit 4e6caf0)

* Fix typo in Action.Proxy.ResponseHeaders (#3157)

Corrected bool to []string in Action.Proxy.ResponseHeaders section

(cherry picked from commit 4824823)

Co-authored-by: Ciara Stacke <[email protected]>
Co-authored-by: tomasohaodha <[email protected]>
coolbry95 pushed a commit to coolbry95/kubernetes-ingress that referenced this pull request Nov 18, 2022
…mand line (nginxinc#3139)

* Remove ipv6 listeners in ingress upstream with command line argument

Co-authored-by: Venktesh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a potential bug tests Pull requests that update tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to version 2.4.0 with "-disable-ipv6=true" cannot reach upstream.
5 participants