[
https://issues.apache.org/jira/browse/SCB-981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16663814#comment-16663814
]
ASF GitHub Bot commented on SCB-981:
------------------------------------
asifdxtreme closed pull request #465: SCB-981 Can not remove the microservice
and instance properties
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/465
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/instance_test.go b/server/service/instance_test.go
index fb012d3b..dd5de495 100644
--- a/server/service/instance_test.go
+++ b/server/service/instance_test.go
@@ -745,13 +745,14 @@ var _ = Describe("'Instance' service", func() {
Expect(err).To(BeNil())
Expect(respUpdateProperties.Response.Code).To(Equal(scerr.ErrInvalidParams))
+
+ By("remove the properties")
respUpdateProperties, err =
instanceResource.UpdateInstanceProperties(getContext(),
&pb.UpdateInstancePropsRequest{
ServiceId: serviceId,
InstanceId: instanceId,
})
-
Expect(err).To(BeNil())
-
Expect(respUpdateProperties.Response.Code).To(Equal(scerr.ErrInvalidParams))
+
Expect(respUpdateProperties.Response.Code).To(Equal(pb.Response_SUCCESS))
By("service does not exist")
respUpdateProperties, err =
instanceResource.UpdateInstanceProperties(getContext(),
&pb.UpdateInstancePropsRequest{
diff --git a/server/service/instance_validator.go
b/server/service/instance_validator.go
index 369b8aa5..1777b402 100644
--- a/server/service/instance_validator.go
+++ b/server/service/instance_validator.go
@@ -81,7 +81,6 @@ func UpdateInstanceReqValidator() *validate.Validator {
func UpdateInstancePropsReqValidator() *validate.Validator {
return updateInstancePropsReqValidator.Init(func(v *validate.Validator)
{
v.AddRules(heartbeatReqValidator.GetRules())
- v.AddRule("Properties",
UpdateServicePropsReqValidator().GetRule("Properties"))
})
}
diff --git a/server/service/microservice_test.go
b/server/service/microservice_test.go
index f27c897f..b1c36b09 100644
--- a/server/service/microservice_test.go
+++ b/server/service/microservice_test.go
@@ -1079,15 +1079,15 @@ var _ = Describe("'Micro-service' service", func() {
})
})
- Context("when property is nil or empty", func() {
- It("should be failed", func() {
+ Context("when remove the properties", func() {
+ It("should be pass", func() {
r := &pb.UpdateServicePropsRequest{
ServiceId: serviceId,
Properties: nil,
}
resp, err :=
serviceResource.UpdateProperties(getContext(), r)
Expect(err).To(BeNil())
-
Expect(resp.Response.Code).ToNot(Equal(pb.Response_SUCCESS))
+
Expect(resp.Response.Code).To(Equal(pb.Response_SUCCESS))
r = &pb.UpdateServicePropsRequest{
ServiceId: "",
diff --git a/server/service/microservice_validator.go
b/server/service/microservice_validator.go
index d010ec52..b4eb4a73 100644
--- a/server/service/microservice_validator.go
+++ b/server/service/microservice_validator.go
@@ -108,6 +108,5 @@ func CreateServiceReqValidator() *validate.Validator {
func UpdateServicePropsReqValidator() *validate.Validator {
return updateServicePropsReqValidator.Init(func(v *validate.Validator) {
v.AddRule("ServiceId",
GetServiceReqValidator().GetRule("ServiceId"))
- v.AddRule("Properties", &validate.ValidateRule{Min: 1})
})
}
----------------------------------------------------------------
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:
[email protected]
> Can not remove the microservice and instance properties
> -------------------------------------------------------
>
> Key: SCB-981
> URL: https://issues.apache.org/jira/browse/SCB-981
> Project: Apache ServiceComb
> Issue Type: Bug
> Components: Service-Center
> Reporter: little-cui
> Assignee: little-cui
> Priority: Major
> Fix For: service-center-1.1.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)