Skip to content

Commit

Permalink
Return delete success for pods that never got scheduled
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes Mogren authored and mogren committed Sep 25, 2019
1 parent 36c108d commit b0b2fc1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ipamd/rpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ func (s *server) DelNetwork(ctx context.Context, in *pb.DelNetworkRequest) (*pb.
}
log.Infof("Send DelNetworkReply: IPv4Addr %s, DeviceNumber: %d, err: %v", ip, deviceNumber, err)

return &pb.DelNetworkReply{Success: err == nil, IPv4Addr: ip, DeviceNumber: int32(deviceNumber)}, nil
// Plugins should generally complete a DEL action without error even if some resources are missing. For example,
// an IPAM plugin should generally release an IP allocation and return success even if the container network
// namespace no longer exists, unless that network namespace is critical for IPAM management
success := true
if err != nil && err != datastore.ErrUnknownPod {
success = false
}
return &pb.DelNetworkReply{Success: success, IPv4Addr: ip, DeviceNumber: int32(deviceNumber)}, nil
}

// RunRPCHandler handles request from gRPC
Expand Down

0 comments on commit b0b2fc1

Please sign in to comment.