containernetworking / plugins

Some reference and example networking plugins, maintained by the CNI team.
Apache License 2.0
2.23k stars 788 forks source link

feature: support flag configuration for ipvlan #1032

Open AryaLee opened 6 months ago

AryaLee commented 6 months ago

Support flag configuration for ipvlan. The value is one of “bridge”, “private”, “vepa”, defaults to “bridge”.

    mv := &netlink.IPVlan{
        LinkAttrs: netlink.LinkAttrs{
            MTU:         conf.MTU,
            Name:        tmpName,
            ParentIndex: m.Attrs().Index,
            Namespace:   netlink.NsFd(int(netns.Fd())),
        },
        Mode: mode,
        Flag: flag,
    }