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

Automated cherry pick of #2486: fix tunnel interface name issue #2560

Conversation

luolanzone
Copy link
Contributor

Cherry pick of #2486 on release-1.2.

#2486: fix tunnel interface name issue

For details on the cherry pick process, see the cherry pick requests page.

the purpose of this commit is to fix a tunnel interface issue
founded during some IPSec PoC verification:

1. when the node name is like 'lan-k8s-0-0', the IPsec tunnel interface name will be
like '-k8s-0-2-e8dbe6', then it will failed to run command like
`ipsec up '-k8s-0-2-e8dbe6'` with error `/usr/lib/ipsec/stroke: invalid option -- 'k'`
due to the first char is '-', ipsec command interrupted it as an
option. so changed the `generateInterfaceName` method to use `strings.TrimLeft()` to remove '-' in left.

2. `createIPSecTunnelPort` method can't handle the case when tunnel
interface name changed when there is cache matched for the node. it
will reuse the existing tunnel name without creating a new one with new
name which means any change in `generateInterfaceName` won't take
affect.

and also add some unit test cases.

Signed-off-by: Lan Luo <luola@vmware.com>
@luolanzone luolanzone added the kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release label Aug 9, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2021

Codecov Report

Merging #2560 (b994559) into release-1.2 (2051c8e) will increase coverage by 13.27%.
The diff coverage is 84.61%.

Impacted file tree graph

@@               Coverage Diff                @@
##           release-1.2    #2560       +/-   ##
================================================
+ Coverage        46.75%   60.03%   +13.27%     
================================================
  Files              278      284        +6     
  Lines            21468    22297      +829     
================================================
+ Hits             10037    13385     +3348     
+ Misses           10107     7481     -2626     
- Partials          1324     1431      +107     
Flag Coverage Δ
e2e-tests ∅ <ø> (?)
kind-e2e-tests 47.02% <7.69%> (+0.27%) ⬆️
unit-tests 42.37% <84.61%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/util/net.go 51.28% <50.00%> (ø)
...gent/controller/noderoute/node_route_controller.go 60.60% <90.90%> (+18.68%) ⬆️
pkg/antctl/command_list.go 47.61% <0.00%> (ø)
pkg/antctl/command_definition.go 53.86% <0.00%> (ø)
pkg/antctl/antctl.go 100.00% <0.00%> (ø)
pkg/antctl/raw/traceflow/command.go 24.40% <0.00%> (ø)
pkg/antctl/command_message.go 42.85% <0.00%> (ø)
pkg/antctl/client.go 1.38% <0.00%> (ø)
pkg/ovs/ovsconfig/ovs_client.go 48.74% <0.00%> (+0.83%) ⬆️
pkg/flowaggregator/flowaggregator.go 63.94% <0.00%> (+1.85%) ⬆️
... and 86 more

@luolanzone luolanzone requested review from antoninbas and tnqn and removed request for antoninbas August 9, 2021 05:39
@antoninbas
Copy link
Contributor

/test-all

@antoninbas antoninbas merged commit 65d836a into antrea-io:release-1.2 Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants