Skip to content
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

Suppress status unset in cmdDel #1173

Merged

Conversation

s1061123
Copy link
Member

@s1061123 s1061123 commented Oct 4, 2023

This change stops to update status in CNI's DEL command. There are two reasons:

  1. cmd DEL is invoked at only pod deletion, hence k8s does not guarantee the pod and it may be already deleted. Hence this API may failed.

  2. In stateful set's pod recreation case, it may have race condition to update the status at cmd DEL case.
    In stateful set case, same pod name, i.e. stateful-0, is deleted and then created again. In this case, if old Pod's CNI DEL command is not finished before new Pod's creation, then SetStatus function is failed due to pod UID mismatch.

This change stops to update status in CNI's DEL command.
There are two reasons:

1. cmd DEL is invoked at only pod deletion, hence k8s does not
guarantee the pod and it may be already deleted. Hence this
API may failed.

2. In stateful set's pod recreation case, it may have race
condition to update the status at cmd DEL case.
In stateful set case, same pod name, i.e. stateful-0, is deleted
and then created again. In this case, if old Pod's CNI DEL command
is not finished before new Pod's creation, then SetStatus function
is failed due to pod UID mismatch.
@dougbtv dougbtv merged commit b710020 into k8snetworkplumbingwg:master Oct 4, 2023
24 checks passed
@s1061123 s1061123 deleted the remove-status-set-del branch October 7, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants