-
Notifications
You must be signed in to change notification settings - Fork 389
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
Add Pod network status annotation to make Pod SecondaryNetwork IP visible #7069
base: main
Are you sure you want to change the base?
Conversation
fa52370
to
5177eef
Compare
if err := netdefutils.SetNetworkStatus(pc.kubeClient, pod, netStatus); err != nil { | ||
klog.ErrorS(err, "Update Pod annotation failed", "Pod", klog.KRef(pod.Namespace, pod.Name)) |
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.
The error is not logged in the caller?
If already logged in the caller, probably just append the extra context to the error and return.
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.
The error was ultimately returned to the syncPod function without being logged. The final call was made in processNextWorkItem
. I think a log for recording the error should be added in processNextWorkItem
, similar to how other controllers handle it.
https://github.com/antrea-io/antrea/blob/main/pkg/agent/secondarynetwork/podwatch/controller.go#L310
if err := pc.syncPod(key); err == nil {
pc.queue.Forget(key)
} else {
pc.queue.AddRateLimited(key)
}
if netStatus != nil { | ||
if err := netdefutils.SetNetworkStatus(pc.kubeClient, pod, netStatus); err != nil { | ||
klog.ErrorS(err, "Update Pod annotation failed", "Pod", klog.KRef(pod.Namespace, pod.Name)) | ||
return err |
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.
Will the error trigger a retry? But that will not really retry updating the status? If true, probably just log and do not return an 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.
Returning an error here will trigger a retry, it seems pointless since SetNetworkStatus
already has retry logic. Thanks for your advice. It's reasonable to just log the error without returning it.
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
Signed-off-by: Wenqi Qiu <wenqi.qiu@broadcom.com>
dea0950
to
a05aa0e
Compare
related #7048
Add Network Status Annotations for Pod to make Pod SecondaryNetwork IP visible. For example:
TestDone:
kubectl get pods sriov-pod1 -n testsriovnetwork-uu5azxvs -oyaml