(ctx context.Context, runnerScaleSetID int)
| 204 | } |
| 205 | |
| 206 | func (s *ScaleSetClient) DeleteRunnerScaleSet(ctx context.Context, runnerScaleSetID int) (err error) { |
| 207 | s.recordOperation("DeleteRunnerScaleSet") |
| 208 | defer func() { |
| 209 | if err != nil { |
| 210 | s.recordFailedOperation("DeleteRunnerScaleSet") |
| 211 | } |
| 212 | }() |
| 213 | |
| 214 | path := fmt.Sprintf("%s/%d", scaleSetEndpoint, runnerScaleSetID) |
| 215 | req, err := s.newActionsRequest(ctx, http.MethodDelete, path, nil) |
| 216 | if err != nil { |
| 217 | return err |
| 218 | } |
| 219 | |
| 220 | client := &http.Client{} |
| 221 | resp, err := client.Do(req) //nolint:gosec // G704 - URL is constructed from GitHub API endpoints |
| 222 | if err != nil { |
| 223 | return err |
| 224 | } |
| 225 | defer resp.Body.Close() |
| 226 | |
| 227 | if resp.StatusCode != http.StatusNoContent { |
| 228 | return fmt.Errorf("failed to delete scale set with code %d", resp.StatusCode) |
| 229 | } |
| 230 | |
| 231 | return nil |
| 232 | } |
| 233 | |
| 234 | func (s *ScaleSetClient) GetRunnerGroupByName(ctx context.Context, runnerGroup string) (_ params.RunnerGroup, err error) { |
| 235 | s.recordOperation("GetRunnerGroupByName") |
no test coverage detected