-
Notifications
You must be signed in to change notification settings - Fork 93
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
Make use of global variables instead of bpf config map #1263
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
PR Overview
This PR implements an enhancement by replacing the use of a BPF config map with global variables for several configuration parameters. The changes involve removing the obsolete km_configmap and associated Kmesh*KmeshConfig structs across multiple files while adding new variable specifications for BpfLogLevel, EnableMonitoring, NodeIp, and PodGateway.
Reviewed Changes
File | Description |
---|---|
bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go | Removed km_configmap references and KmeshSockopsWorkloadKmeshConfig; added variable specs for global configuration. |
bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go | Removed km_configmap references and KmeshSockopsWorkloadKmeshConfig; added global variables for configuration. |
bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go | Removed km_configmap from maps and KmeshSockopsWorkloadCompatKmeshConfig as part of the config map removal. |
bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go | Removed km_configmap and updated variable specs accordingly. |
bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go | Removed km_configmap from maps and KmeshCgroupSockWorkloadCompatKmeshConfig. |
bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go | Removed km_configmap and updated variable specs accordingly. |
bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go | Removed km_configmap and KmeshCgroupSockWorkloadKmeshConfig in favor of global variables. |
bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go | Removed km_configmap and updated the close logic to match the new configuration style. |
bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go | Removed km_configmap and updated variable specs for authentication configuration. |
bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go | Removed km_configmap from maps and updated variable specs accordingly. |
bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go | Removed km_configmap and updated variable specs for consistency. |
bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go | Removed km_configmap from maps and updated variable specs accordingly. |
bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go | Removed km_configmap from maps and updated close logic accordingly. |
bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go | Removed km_configmap from maps and updated close logic accordingly. |
bpf/kmesh/bpf2go/general/kmeshtcmarkdecrypt_bpfel.go | Removed km_configmap from maps and KmeshTcMarkDecryptKmeshConfig in favor of global variables. |
bpf/kmesh/bpf2go/general/kmeshtcmarkdecrypt_bpfeb.go | Removed km_configmap from maps and updated configuration accordingly. |
bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go | Removed km_configmap from maps and KmeshSendmsgKmeshConfig in favor of global variables. |
bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go | Removed km_configmap from maps and updated close logic accordingly. |
Copilot reviewed 44 out of 44 changed files in this pull request and generated no comments.
Let me fix the TestServerAccesslogHandler panic |
var BpfLogLevel uint32 | ||
if err := l.BpfLogLevel.Get(&BpfLogLevel); err != nil { | ||
log.Errorf("get BpfLogLevel failed %v", err) | ||
return 0 |
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.
Is it necessary to distinguish between disable
and error
?
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.
In theory, Variable.Get will not fail.
Whatever, will propagate the error back in a following pr
var AuthzOffload uint32 | ||
if err := l.AuthzOffload.Get(&AuthzOffload); err != nil { | ||
log.Errorf("get AuthzOffload failed %v", err) | ||
return 0 |
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.
ditto
ae22756
to
f6e47c4
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (40.66%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: Zhonghu Xu <[email protected]>
Signed-off-by: Zhonghu Xu <[email protected]>
Signed-off-by: Zhonghu Xu <[email protected]>
Signed-off-by: Zhonghu Xu <[email protected]>
47bad96
to
65bd807
Compare
What type of PR is this?
/kind enhancement
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: