Skip to content

Commit

Permalink
op is nil panic if error DeleteInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
whywaita committed Mar 6, 2024
1 parent 127a8a0 commit 98949bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/pkg/api/server_add_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (s *ShoesLXDMultiServer) AddInstance(ctx context.Context, req *pb.AddInstan
op, err := client.DeleteInstance(instanceName)
if err != nil {
l.Warn("failed to delete instance", "err", err.Error())
return nil, status.Errorf(codes.Internal, "failed to wait starting instance: %+v", err)
}
if err := op.Wait(); err != nil {
l.Warn("failed to wait deleting instance", "err", err.Error())
Expand All @@ -97,6 +98,7 @@ func (s *ShoesLXDMultiServer) AddInstance(ctx context.Context, req *pb.AddInstan
op, err := client.DeleteInstance(instanceName)
if err != nil {
l.Warn("failed to delete instance", "err", err.Error())
return nil, status.Errorf(codes.Internal, "failed to wait starting instance: %+v", err)
}
if err := op.Wait(); err != nil {
l.Warn("failed to wait deleting instance", "err", err.Error())
Expand Down

0 comments on commit 98949bf

Please sign in to comment.