k3s/pkg/agent
Richard Hansen 925726c84d flannel: Use custom type for network mode (IPv4, IPv6, dual-stack)
Move the `ipv4` and `ipv6` constants to their own constant
declaration.  This ensures that the `iota` expression for the `ipv4`
constant evaluates to 0, not some arbitrary value.  (`iota` evaluates
to N for the Nth constant in the constant declaration; see
<https://go.dev/ref/spec#Iota>.)  This is also more idiomatic, which
improves readability.

Also switch from incremental integers to bit flags, and use bitwise
operators for checking.  This is more idiomatic (the integer is
treated like a set of booleans), it avoids some code duplication, and
it is necessary to avoid ambiguity.  Consider the following:

    const (
    	ipv4 = iota
    	ipv6
    )

In the above, `ipv4` would have the value 0 and `ipv6` would have the
value 1.  This would make it impossible to distinguish an IPv6-only
stack from a dual-stack configuration because `ipv6` would equal
`ipv4 + ipv6`.  With bit flags this problem doesn't exist.

And put the integer holding the bit flags in a custom type with
convenience methods to improve readability.

Signed-off-by: Richard Hansen <rhansen@rhansen.org>
2025-05-09 12:51:48 -07:00
..
config Migrate to UrfaveCLI v2 (#11831) 2025-03-12 09:02:45 -07:00
containerd Add support for conditional image tarball imports 2025-05-07 15:06:14 -07:00
cri Fix windows socket prefix 2025-04-09 09:25:43 -07:00
cridockerd Fix issue caused by default authorization-mode apiserver arg 2025-03-31 17:09:43 -07:00
flannel flannel: Use custom type for network mode (IPv4, IPv6, dual-stack) 2025-05-09 12:51:48 -07:00
https Fix handler panic when bootstrapper returned empty peer list 2025-04-18 10:20:15 -07:00
loadbalancer Avoid use of github.com/pkg/errors functions that capture stack 2025-03-05 00:41:38 -08:00
netpol Avoid use of github.com/pkg/errors functions that capture stack 2025-03-05 00:41:38 -08:00
proxy Avoid use of github.com/pkg/errors functions that capture stack 2025-03-05 00:41:38 -08:00
syssetup Load kernel modules for nft in agent setup (#11524) 2025-01-07 03:01:02 +02:00
templates Fix missing migration for containerd registry.configs plugin namespace 2025-02-20 16:46:58 -08:00
tunnel Move container runtime ready channel into executor 2025-03-24 12:42:29 -07:00
util Avoid use of github.com/pkg/errors functions that capture stack 2025-03-05 00:41:38 -08:00
run.go Fix issue caused by default authorization-mode apiserver arg 2025-03-31 17:09:43 -07:00
run_linux.go Added runtime classes for crun/wasm/nvidia 2023-12-08 15:49:28 -03:00
run_test.go Update to v1.31.0 2024-08-22 14:23:34 -07:00
run_windows.go Add --image-service-endpoint flag (#8279) 2023-09-27 13:20:50 -07:00