[ https://issues.apache.org/jira/browse/SCB-134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16304200#comment-16304200 ]
ASF GitHub Bot commented on SCB-134: ------------------------------------ little-cui closed pull request #229: SCB-134 Batch delete api can delete service center micro-service. URL: https://github.com/apache/incubator-servicecomb-service-center/pull/229 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/server/service/microservices.go b/server/service/microservices.go index 98114719..0f304a8f 100644 --- a/server/service/microservices.go +++ b/server/service/microservices.go @@ -210,6 +210,12 @@ func (s *MicroServiceService) DeleteServicePri(ctx context.Context, ServiceId st title = "force delete" } + if ServiceId == apt.Service.ServiceId { + err := fmt.Errorf("Not allow to delete service center") + util.Logger().Errorf(err, "%s microservice failed, serviceId is %s", title, ServiceId) + return pb.CreateResponse(scerr.ErrInvalidParams, err.Error()), err + } + service, err := serviceUtil.GetService(ctx, domainProject, ServiceId) if err != nil { util.Logger().Errorf(err, "%s microservice failed, serviceId is %s: get service failed.", title, ServiceId) @@ -327,7 +333,7 @@ func (s *MicroServiceService) DeleteServicePri(ctx context.Context, ServiceId st } func (s *MicroServiceService) Delete(ctx context.Context, in *pb.DeleteServiceRequest) (*pb.DeleteServiceResponse, error) { - if in == nil || len(in.ServiceId) == 0 || in.ServiceId == apt.Service.ServiceId { + if in == nil || len(in.ServiceId) == 0 { util.Logger().Errorf(nil, "delete microservice failed: service empty.") return &pb.DeleteServiceResponse{ Response: pb.CreateResponse(scerr.ErrInvalidParams, "Request format invalid."), ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Batch delete api can delete service center micro-service > -------------------------------------------------------- > > Key: SCB-134 > URL: https://issues.apache.org/jira/browse/SCB-134 > Project: Apache ServiceComb > Issue Type: Bug > Components: Service-Center > Reporter: little-cui > -- This message was sent by Atlassian JIRA (v6.4.14#64029)