containernetworking / plugins

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

feature: support flag configuration for ipvlan #1032

Open AryaLee opened 2 months ago

AryaLee commented 2 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,
    }