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

Commits on Aug 9, 2021

  1. fix tunnel interface name issue

    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 committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    b994559 View commit details
    Browse the repository at this point in the history