fix DeletePipelineSchedule always returning an error due to EOF

Gitlab API returns 204 on DELETE endpoints. Trying to read out the pipeline schedule from the delete response will always fail. This changes the DeletePipelineSchedule function to behave similar as the DeletePipelineTrigger function
parent 8e773904
...@@ -216,25 +216,24 @@ func (s *PipelineSchedulesService) TakeOwnershipOfPipelineSchedule(pid interface ...@@ -216,25 +216,24 @@ func (s *PipelineSchedulesService) TakeOwnershipOfPipelineSchedule(pid interface
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/pipeline_schedules.html#delete-a-pipeline-schedule // https://docs.gitlab.com/ce/api/pipeline_schedules.html#delete-a-pipeline-schedule
func (s *PipelineSchedulesService) DeletePipelineSchedule(pid interface{}, schedule int, options ...OptionFunc) (*PipelineSchedule, *Response, error) { func (s *PipelineSchedulesService) DeletePipelineSchedule(pid interface{}, schedule int, options ...OptionFunc) (*Response, error) {
project, err := parseID(pid) project, err := parseID(pid)
if err != nil { if err != nil {
return nil, nil, err return nil, err
} }
u := fmt.Sprintf("projects/%s/pipeline_schedules/%d", url.QueryEscape(project), schedule) u := fmt.Sprintf("projects/%s/pipeline_schedules/%d", url.QueryEscape(project), schedule)
req, err := s.client.NewRequest("DELETE", u, nil, options) req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil { if err != nil {
return nil, nil, err return nil, err
} }
p := new(PipelineSchedule) req, err = s.client.NewRequest("DELETE", u, nil, options)
resp, err := s.client.Do(req, p)
if err != nil { if err != nil {
return nil, resp, err return nil, err
} }
return p, resp, err return s.client.Do(req, nil)
} }
// CreatePipelineScheduleVariableOptions represents the available // CreatePipelineScheduleVariableOptions represents the available
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment