daemon, option: Fix vlan bpf bypass ids loading#20282
Conversation
7815a69 to
00b14d1
Compare
00b14d1 to
aac1500
Compare
|
/test |
sayboras
left a comment
There was a problem hiding this comment.
Couple of small comments as per below.
This is the only one we are using int slice, and unlikely we have int slice in future, so up to you if you want to add something similar to https://github.com/cilium/cilium/blob/master/contrib/scripts/check-viper-get-string-map-string.sh
kaworu
left a comment
There was a problem hiding this comment.
Thanks! Helm related changes LGTM 👍
Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to cilium#20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to #20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
|
/test |
|
/test-1.24-net-next Job 'Cilium-PR-K8s-GKE' failed: Click to show.Test NameFailure OutputIf it is a flake and a GitHub issue doesn't already exist to track it, comment |
rolinh
left a comment
There was a problem hiding this comment.
LGTM but given that this PR will be backported to v1.11, shouldn't the breaking change (--set bpf.vlan-bpf-bypass=4001,4002 => --set bpf.vlanBypass="{4001,4002}") be documented in the upgrade notes?
It's not a breaking change. The old syntax and Helm value just simply never worked, it was a complete no-op. |
[ upstream commit 98280fa ] Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to #20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com> Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 98280fa ] Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to #20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com> Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 98280fa ] Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to #20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com> Signed-off-by: Quentin Monnet <quentin@isovalent.com>
[ upstream commit 98280fa ] Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to cilium#20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com> Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
Through the ConfigMap, all config values are loaded as strings and then converted into the appropriate types. The conversion is carried out by Viper that does not report any kind of error if something goes wrong. To catch early any kind of conversion issue, we should use the same conversion APIs that Viper is using internally, so we check each option using the appropriate conversion function from the cast package. Related to cilium#20282 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
When installing cilium-agent via Helm, the configuration options are loaded reading files.
Each file represents an entry in the ConfigMap.
Doing so, all the values are loaded as strings and therefore must be converted to the specific option value type later.
This conversion is carried out by the spf13/viper package itself.
Internally, viper tries to load values from different sources:
When loading values from a config file, unlike the flag code path, the conversion from string to the requested value type is carried out by the spf13/cast package.
The cast package does not support the conversion from string to slice of ints and the viper.GetIntSlice(...) function does not report any error if the conversion goes wrong.
As a temporary workaround, the bpf.vlanBypass option value type has been changed to a slice of strings, so to leave the conversion to a slice of ints to be implemented manually.
To avoid this workaround, two things are needed:
validateConfigmapfunction to check option values using the cast package with the proper type conversion, instead of relying on pflagSetmethod.Fixes: #20173