41 Commits

Author SHA1 Message Date
Matthieu MOREL
10ddd9e454
enable govet and unparam linters
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-04-11 12:07:04 +02:00
Casey Callendrello
deec68747e
Merge pull request #853 from mmorel-35/ginkgolinter
enable ginkgolinter linter
2023-04-04 15:24:20 +02:00
Marcelo Guerrero Viveros
d71d0f2da1 Fix revive linter errors
Golangci-lint is now running version 1.52.1. This introduced some errors.

Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
2023-03-24 21:04:39 +01:00
Matthieu MOREL
09f36a295d enable ginkgolinter linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-13 22:27:21 +00:00
Matthieu MOREL
79f524689c enable gocritic linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-13 17:59:33 +01:00
Matthieu MOREL
d12b81dec5 ci(lint): setup golangci-lint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-01 06:55:40 +00:00
liornoy
2d1005ec02
Update tests to utilize ginkgo/v2
This commit updates the import of ginkgo to v2 in
all of the tests.

Signed-off-by: liornoy <lnoy@redhat.com>
Co-authored-by: Sascha Grunert <sgrunert@redhat.com>
2023-02-13 21:15:18 +02:00
Austin Vazquez
1a6f478913 Remove references to io/ioutil package
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-12-01 22:27:05 +00:00
Casey Callendrello
90e8e1faf9 Fix host-device gofmt
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2022-01-26 18:00:39 +01:00
David Ward
3b2afc93dc host-device: Bring interfaces up after moving into container
If an interface is not configured with IPAM (because it functions at
layer 2), it will not be brought up otherwise.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
2022-01-26 18:00:39 +01:00
Periyasamy Palanisamy
547a516c30 add ipam tests for dpdk device
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2021-11-18 15:10:29 +01:00
Periyasamy Palanisamy
3033fd2e75 add ipam support for dpdk device
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2021-11-17 21:08:08 +01:00
Kavya
5b02c2ab70 Fix broken links to online docs in plugin READMEs
Signed-off-by: Kavya <kavya.g@ibm.com>
2021-03-25 13:07:33 +05:30
Dan Williams
34cee8c758 host-device: increase test coverage to 1.0.0 and older spec versions
Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-02-11 23:27:08 -06:00
Dan Williams
7d8c767622 plugins: update to spec version 1.0.0
Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-02-11 23:27:08 -06:00
peri
d41acb83c4
host-device: Add support for DPDK device (#490)
This commit would make host-device plugin as a placeholder
for DPDK device when applications wants to attach it with
a pod container through network attachment definition.

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2021-01-20 17:35:42 +01:00
Nate W
cccf5395e8
Updating plugin README.md files (#549)
Removing content and pointing at the new website as a part of the CNI Documentation migration.

Signed-off-by: Nate W <4453979+nate-double-u@users.noreply.github.com>
2020-11-18 17:38:45 +01:00
cns
79192cb1f1 host-device: Bring interfaces down before moving.
When trying to move a master and slave interface into a container it is not
possible without first bringing the interfaces down. This change ensures
that the interface is set to down prior to trying to move the interface
into the container. This matches the behaviour on moving an interface out
of the container.

Signed-off-by: cns <christopher.swindle@metaswitch.com>
2020-05-17 20:46:43 +01:00
Adrian Chiris
a78853f29f
Support device id in host device plugin (#471)
* Add support for `deviceID` runtime config attribute

Signed-off-by: Adrian Chiris <adrianc@mellanox.com>
2020-04-15 10:45:14 -05:00
Periyasamy Palanisamy
a9b4e04bc4 Make host-device to work with virtio net device
In case pciBusID contains pci address of the virtio device,
then lookup the net directory under virtio<id> directory.

Issue: https://github.com/containernetworking/plugins/issues/320

Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2020-02-11 18:05:37 +01:00
smarkm
0d0dcfc02f Cleanup netns after test suit
Signed-off-by: smarkm <smark@freecoop.net>
2019-08-22 08:10:35 +08:00
Bruce Ma
5e2e365291 host-device: remove useless Expects in testcases
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-29 21:09:03 +08:00
Bruce Ma
4b68f56820 host-device: add testcases for imdempotence of CmdDel
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-29 20:47:28 +08:00
Bruce Ma
57650a1e5b host-device: revert name setting to make retries idempotent
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-19 21:26:07 +08:00
Zenghui Shi
79b1c402c4 host-device: add deviceID property
Fixes #253
2019-04-25 12:17:40 +08:00
Casey Callendrello
72f2a1ffd4 plugins: correctly output build version, cosmetic cleanups
Now that libcni has the ability to print a version message, plumb it
through correctly.

While we're at it,
- fix import paths
- run gofmt
- add some more comments to sample
- add container runtime swappability for release
2019-04-15 16:52:07 +02:00
Michael Cambria
74a2596573 Add check support for: bridge, ipvlan, macvlan, p2p, vlan and host-device main plugins
host-local and static ipam plugins
  tuning, bandwidth and portmap meta plugins

  Utility functions created for common PrevResult checking

  Fix windows build
2019-04-03 13:08:07 -04:00
Tomofumi Hayashi
d29d56bc4d Fix host-device README.md
host-device's README.md missing 'type' field, so this change
just adds 'type' in config example.
2019-01-30 01:51:57 +09:00
Dan Williams
5fc8209482
Merge pull request #218 from hwchiu/fix-readme
fix the typo of macvlan and also modify documents to meet the current plugins.
2018-11-07 09:30:29 -06:00
hwchiu
d3284f7c5e Support the IPAM for host-device plugin
- Change variable name to camel style to fix golint warning
- Execute the IPAM to assign the IP address if it's inside in the config
- Test the IPAM module with static plugin
2018-11-01 01:12:47 +00:00
hwchiu
f006155b66 Add the missing documents for some existing plugins 2018-10-18 02:20:52 +00:00
Lantao Liu
2955d63c95 Handle empty netns in DEL for loopback and host-device.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-10 10:49:06 -07:00
Casey Callendrello
68b4efb405 plugins/* stub-out GET functions so plugins build with v0.7 2018-06-15 15:28:53 +02:00
Dan Williams
1d973f59d2
Merge pull request #147 from databus23/host-device-fix
host-device: Ensure device is down before rename
2018-05-16 10:54:47 -05:00
Dan Williams
731298003c plugins/testutils: pass CNI_CONTAINERID to plugins in testcases
Recent CNI specification changes require the container ID on ADD/DEL,
which the testcases were not providing.  Fix that up so things work
when this repo gets CNI revendored.
2018-04-26 11:24:30 -05:00
Fabian Ruff
eb410208cb host-device: Ensure device is down before rename
If the device is in state up trying to set the name fails with "device or resource busy"
2018-04-25 20:39:23 +02:00
Casey Callendrello
aade7b93ee build: some small improvements; bump to go1.10
- bump to go 1.10
- Add a linker tag with the build version
- Remove fastbuild, go builds are cached now
- Use better ginkgo suite names
2018-04-12 16:59:51 +02:00
Casey Callendrello
a0eac8d7d9 pkg/ns: remove namespace creation (and move to testutils)
Namespace creation had an unergonomic interface and isn't used, except
for testing code. Remove it; downstream users should really be creating
their own namespaces
2018-04-03 18:56:25 +02:00
Dan Williams
ffc591e242 host-device: respect CNI_IFNAME/args.IfName
On ADD save the host device's name into its IFLA_ALIAS property and
rename the device to the requested CNI_IFNAME inside the container
to conform to the CNI specification.  On DEL rename the device to
the original name and move it back into the host namespace.
2018-01-17 14:30:22 -06:00
Casey Callendrello
5e830efb20 plugins/main/host-local: generate result, fix DEL, other cleanups
This plugin needed some cleaning up: it didn't generate output, and
didn't test DEL. Add those things, plus a README.
2017-11-15 16:00:32 +01:00
Casey Callendrello
d07d2aaf71 plugins/host_device: move to "main" folder 2017-11-13 18:50:20 +01:00