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

Not returning error when unassign called on pod without IP #740

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ipamd/rpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ func (s *server) DelNetwork(ctx context.Context, in *pb.DelNetworkRequest) (*pb.
ip, deviceNumber, err = s.ipamContext.dataStore.UnassignPodIPv4Address(&k8sapi.K8SPodInfo{
Name: in.K8S_POD_NAME,
Namespace: in.K8S_POD_NAMESPACE})

// if a pod gets scheduled to a node when the aws cni is restarting,
// kubelet would kill and recreate pod. When kubelet tries to kill
// the container initially, this block would make sure the ipamD agent would
// make sure we dont return an error.
if err == datastore.ErrUnknownPod {
err = nil
}
Comment on lines +105 to +107
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you were basing this change on tests done on v1.5.3 or earlier? This kind of change was the main cause of issues in v1.5.4. It looks innocent, but had other effects because of the cleanup that got triggered in the CNI binary. See #641 for some details.

Also, #688 should fix this issue to stop returning an error to Kubelet when we try to delete a pod that failed to get an IP. That change should be in the v1.6.0-rc4 release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mogren. That makes sense.

}
log.Infof("Send DelNetworkReply: IPv4Addr %s, DeviceNumber: %d, err: %v", ip, deviceNumber, err)

Expand Down