@@ -147,7 +147,7 @@ func validateContainerSpec(taskSpec api.TaskSpec) error {
147147 LogDriver : taskSpec .LogDriver ,
148148 })
149149 if err != nil {
150- return status .Errorf (codes .InvalidArgument , err .Error ())
150+ return status .Error (codes .InvalidArgument , err .Error ())
151151 }
152152
153153 if err := validateImage (container .Image ); err != nil {
@@ -526,7 +526,7 @@ func validateJob(spec *api.ServiceSpec) error {
526526
527527func validateServiceSpec (spec * api.ServiceSpec ) error {
528528 if spec == nil {
529- return status .Errorf (codes .InvalidArgument , errInvalidArgument .Error ())
529+ return status .Error (codes .InvalidArgument , errInvalidArgument .Error ())
530530 }
531531 if err := validateAnnotations (spec .Annotations ); err != nil {
532532 return err
@@ -789,7 +789,7 @@ func (s *Server) CreateService(_ context.Context, request *api.CreateServiceRequ
789789// - Returns `NotFound` if the Service is not found.
790790func (s * Server ) GetService (_ context.Context , request * api.GetServiceRequest ) (* api.GetServiceResponse , error ) {
791791 if request .ServiceID == "" {
792- return nil , status .Errorf (codes .InvalidArgument , errInvalidArgument .Error ())
792+ return nil , status .Error (codes .InvalidArgument , errInvalidArgument .Error ())
793793 }
794794
795795 var service * api.Service
@@ -816,7 +816,7 @@ func (s *Server) GetService(_ context.Context, request *api.GetServiceRequest) (
816816// - Returns an error if the update fails.
817817func (s * Server ) UpdateService (_ context.Context , request * api.UpdateServiceRequest ) (* api.UpdateServiceResponse , error ) {
818818 if request .ServiceID == "" || request .ServiceVersion == nil {
819- return nil , status .Errorf (codes .InvalidArgument , errInvalidArgument .Error ())
819+ return nil , status .Error (codes .InvalidArgument , errInvalidArgument .Error ())
820820 }
821821 if err := validateServiceSpec (request .Spec ); err != nil {
822822 return nil , err
@@ -853,7 +853,7 @@ func (s *Server) UpdateService(_ context.Context, request *api.UpdateServiceRequ
853853 if (len (request .Spec .Networks ) != 0 || len (service .Spec .Networks ) != 0 ) &&
854854 ! reflect .DeepEqual (request .Spec .Networks , service .Spec .Networks ) &&
855855 reflect .DeepEqual (request .Spec .Task .Networks , service .Spec .Task .Networks ) {
856- return status .Errorf (codes .Unimplemented , errNetworkUpdateNotSupported .Error ())
856+ return status .Error (codes .Unimplemented , errNetworkUpdateNotSupported .Error ())
857857 }
858858
859859 // Check to see if all the secrets being added exist as objects
@@ -872,11 +872,11 @@ func (s *Server) UpdateService(_ context.Context, request *api.UpdateServiceRequ
872872 // with service mode change (comparing current config with previous config).
873873 // proper way to change service mode is to delete and re-add.
874874 if reflect .TypeOf (service .Spec .Mode ) != reflect .TypeOf (request .Spec .Mode ) {
875- return status .Errorf (codes .Unimplemented , errModeChangeNotAllowed .Error ())
875+ return status .Error (codes .Unimplemented , errModeChangeNotAllowed .Error ())
876876 }
877877
878878 if service .Spec .Annotations .Name != request .Spec .Annotations .Name {
879- return status .Errorf (codes .Unimplemented , errRenameNotSupported .Error ())
879+ return status .Error (codes .Unimplemented , errRenameNotSupported .Error ())
880880 }
881881
882882 service .Meta .Version = * request .ServiceVersion
@@ -942,7 +942,7 @@ func (s *Server) UpdateService(_ context.Context, request *api.UpdateServiceRequ
942942// - Returns an error if the deletion fails.
943943func (s * Server ) RemoveService (_ context.Context , request * api.RemoveServiceRequest ) (* api.RemoveServiceResponse , error ) {
944944 if request .ServiceID == "" {
945- return nil , status .Errorf (codes .InvalidArgument , errInvalidArgument .Error ())
945+ return nil , status .Error (codes .InvalidArgument , errInvalidArgument .Error ())
946946 }
947947
948948 err := s .store .Update (func (tx store.Tx ) error {
@@ -1000,7 +1000,7 @@ func (s *Server) ListServices(_ context.Context, request *api.ListServicesReques
10001000 if err != nil {
10011001 switch err {
10021002 case store .ErrInvalidFindBy :
1003- return nil , status .Errorf (codes .InvalidArgument , err .Error ())
1003+ return nil , status .Error (codes .InvalidArgument , err .Error ())
10041004 default :
10051005 return nil , err
10061006 }
0 commit comments