-
Notifications
You must be signed in to change notification settings - Fork 3.2k
daemon, option: Fix vlan bpf bypass ids loading #20282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daemon, option: Fix vlan bpf bypass ids loading #20282
Conversation
7815a69
to
00b14d1
Compare
00b14d1
to
aac1500
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs change LGTM
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, one minor nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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 <[email protected]>
/test |
/test-1.24-net-next Job 'Cilium-PR-K8s-GKE' failed: Click to show.Test Name
Failure Output
If it is a flake and a GitHub issue doesn't already exist to track it, comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Signed-off-by: Quentin Monnet <[email protected]>
[ 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 <[email protected]> Signed-off-by: Quentin Monnet <[email protected]>
[ 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 <[email protected]> Signed-off-by: Quentin Monnet <[email protected]>
[ 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 <[email protected]> Signed-off-by: Quentin Monnet <[email protected]> Signed-off-by: Michi Mutsuzaki <[email protected]>
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 <[email protected]>
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:
validateConfigmap
function to check option values using the cast package with the proper type conversion, instead of relying on pflagSet
method.Fixes: #20173