b1782e50d7
ipam/dhcp: Fix client id in renew/release
...
The client id was constructed differently in the acquire
function compared to the release and renew functions,
which caused the dhcp-server to consider it a different client.
This is now encapsulated in a common function.
Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com >
2022-03-09 17:47:10 +01:00
1324428a9a
Ran go fmt so tests would pass
...
Signed-off-by: Michael Wyrick <Michael.Wyrick@caci.com >
2021-12-28 10:43:52 -05:00
fd4c3350ae
Fixed DHCP problem that broke when fast retry was added.
...
Signed-off-by: Michael Wyrick <Michael.Wyrick@caci.com >
2021-12-27 13:48:44 -05:00
c9d0423023
dhcp ipam: adjust retry mechanism
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-11-28 06:41:53 +08:00
27fdec5cb9
dhcp ipam: fix client id
...
First byte of client ID is type, instead of value. See this from
RFC2132:
Code Len Type Client-Identifier
+-----+-----+-----+-----+-----+---
| 61 | n | t1 | i1 | i2 | ...
+-----+-----+-----+-----+-----+---
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-03 05:57:27 +08:00
a1051f3bf1
dhcp ipam: rename inconsistent options among files
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 23:49:59 +08:00
c627ea807c
dhcp ipam: add more options capable for sending
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 23:30:59 +08:00
4b216e9d9b
dhcp ipam: add fast retry
...
Almost every first retry of DHCP will fail due to interface is not up. Add a
fast retry to reduce unnecessary latency.
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 23:04:24 +08:00
2bebd89aa2
dhcp ipam: support customizing dhcp options
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 22:48:05 +08:00
be383cf30d
dhcp ipam: truncate client id to 254 bytes
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 22:41:05 +08:00
6d1f71e55a
dhcp ipam: print error correctly without format string
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 22:40:44 +08:00
24259e7d21
dhcp ipam: using full config to regular the code
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-10-02 22:40:19 +08:00
7cb3453c36
dhcp: remove implemented TODO
...
Signed-off-by: SilverBut <SilverBut@users.noreply.github.com >
2021-09-30 13:10:45 +00:00
8ab23366fb
static ipam: do not parse the CIDR twice
...
With this patch, when the IPs are provisioned via CNI args or via
`RuntimeConfig` the CIDR is only parsed once.
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com >
2021-08-24 13:19:37 +02:00
2052c30acd
static ipam: improve error msgs when provisioning invalid CIDR
...
This commit addresses the scenarios when the invalid CIDR is
provisioned via:
- CNI_ARGS
- RuntimeConfig
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com >
2021-08-24 13:05:44 +02:00
a786b12b68
static ipam: decide wrong cidr error msg
...
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com >
2021-06-25 11:24:56 +01:00
0db5882a12
static ipam: stop wrapping net.ParseCIDR errors
...
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com >
2021-06-25 11:24:56 +01:00
5a408187d4
static ipam: show confusing error msg
...
Signed-off-by: Miguel Duarte Barroso <mdbarroso@redhat.com >
2021-06-25 11:24:54 +01:00
af26bab500
host-local: support ip/prefix in env args and CNI args
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2021-05-17 21:12:45 +08:00
d917ab6b0c
Merge pull request #599 from mars1024/feat/hostlocal-ips
...
host-local: support custom IPs allocation through runtime configuraton
2021-05-05 11:33:27 -04:00
b41052c547
Merge pull request #593 from thetechnick/ipam-static-nil-check-fix
...
Fix nil-pointer check
2021-04-14 18:00:42 +02:00
8f32968f73
Fix nil-pointer check
...
Signed-off-by: Nico Schieder <nschieder@redhat.com >
2021-04-13 13:42:23 +02:00
028fc2f219
host-local: support custom IPs allocation through runtime configuration
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2021-04-13 17:53:43 +08:00
bc856372bb
go.mod: godbus/dbus/v5 v5.0.3, coreos/go-systemd v22.2.0
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2021-04-09 00:07:25 +02:00
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
b811967444
remove redundant startRange in RangeIter due to overlap check on multi ranges
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2021-03-04 11:50:54 +08:00
02cdaafe93
host-local: increase test coverage to 1.0.0 and older spec versions
...
Signed-off-by: Dan Williams <dcbw@redhat.com >
2021-02-12 14:56:24 -06:00
f534133ec7
static: increase test coverage to 1.0.0 and older spec versions
...
Signed-off-by: Dan Williams <dcbw@redhat.com >
2021-02-12 14:41:38 -06:00
932653fd3f
dhcp: increase test coverage to 1.0.0 and older spec versions
...
Signed-off-by: Dan Williams <dcbw@redhat.com >
2021-02-12 14:41:38 -06:00
dd3f6064f6
dhcp: add -resendmax option to limit lease acquisition time for testcases
...
The default lease acquisition timeout of 62 seconds is way too long when
running multiple testcases, overrunning the `go test` timeout of 10m. Let
testcases specify a shorter timeout.
Signed-off-by: Dan Williams <dcbw@redhat.com >
2021-02-12 14:41:38 -06:00
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
fa48f7515b
ipam/dhcp: Add broadcast flag
...
Signed-off-by: Micah Hausler <hausler.m@gmail.com >
2021-02-05 16:38:32 +01:00
a8d1f5cd1b
dhcp: default dhcp clien timeout is 10s
...
Consistent with ef524ad9cb/client.go (L39)
Signed-off-by: toby lorne <toby@toby.codes >
Co-authored-by: bruce ma <brucema19901024@gmail.com >
2021-01-13 19:24:41 +00:00
25fc741e37
dhcp: daemon dhcp client timeout is configurable
...
Fixes #470
Signed-off-by: toby lorne <toby@toby.codes >
2021-01-11 22:13:54 +00:00
3161bb52e0
dhcp: timeout value is set in DHCP daemon
...
Eventually the timeout value will become a CLI argument
The default timeout was nestled all the way in the lease constructor
This commit is the first step in making the timeout configurable by
moving it to the DHCPLease constructor
Signed-off-by: toby lorne <toby@toby.codes >
2021-01-11 22:13:54 +00:00
ebce6d0b9b
remove unused function
...
Signed-off-by: yuzhiquan <yuzhiquanlong@gmail.com >
2021-01-11 11:12:00 +08:00
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
50a3aa6536
Xdhcp: fix example configuration
...
The current cni config has an extra comma and cannot be parsed normally, the kubelet will report an error as follows:
"Error loading CNI config file: error parsing configuration: invalid character '}' looking for beginning of object key string"
Signed-off-by: xieyanker <xjsisnice@gmail.com >
2020-11-10 07:48:36 +00:00
d4775ecff5
Fix handling of delay in acquiring lease with stp turned on
...
Signed-off-by: Aneesh Puttur <aneeshputtur@gmail.com >
2020-06-29 13:15:00 -04:00
2290fc8d8a
static: prioritize the input sources for IPs
...
This change introduce priorities for IPs input among CNI_ARGS,
'args' and runtimeConfig. Fix #399 .
Signed-off-by: Tomofumi Hayashi <tohayash@redhat.com >
2019-10-17 13:36:49 +09:00
8ec6bd6a42
bugfix: defer after err check, or it may panic
...
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io >
2019-09-25 22:21:49 +08:00
a069a5f1a3
Support "args" in static and tuning
...
Support "args" field in JSON config to additional configuration
in static and tuning plugins.
2019-08-09 11:52:06 +09:00
e2984e7840
host-local: return error if duplicate allocation is requested for a given ID
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2019-07-06 10:05:18 +08:00
eb1ff18c4c
host-local: add some testcases for allocation idempotency
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2019-07-06 09:39:56 +08:00
e8771b36a2
host-local: make allocation idempotent to multiple requests with same id
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2019-07-06 09:39:56 +08:00
7f8ea631e5
host-local: make Store interface support to get ip list by id
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com >
2019-07-06 09:39:56 +08:00
660685a8af
Support ips capability in static and mac capability in tuning
...
This change introduces new capability flag to change MAC address
and to specify IP addresses by tuning and static.
2019-06-20 17:11:47 +09:00
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
fbd9accd14
Merge pull request #268 from s1061123/fix/dhcp_daemon_hostprefix
...
Fix -hostprefix option
2019-04-08 12:53:09 +02:00
8b53f80fa8
Incorporate with @bboreham comment
2019-04-05 03:38:20 +09:00