Skip to content

Commit

Permalink
Adjust delete dangerous
Browse files Browse the repository at this point in the history
  • Loading branch information
asaha2 committed Oct 23, 2024
1 parent af9d657 commit 959a49f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion droplet_autoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (d *DropletAutoscaleServiceOp) Delete(ctx context.Context, id string) (*Res

// DeleteDangerous deletes an existing autoscale pool with all underlying resources
func (d *DropletAutoscaleServiceOp) DeleteDangerous(ctx context.Context, id string) (*Response, error) {
req, err := d.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, id), nil)
req, err := d.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf("%s/%s/dangerous", dropletAutoscaleBasePath, id), nil)
req.Header.Set("X-Dangerous", "true")
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion droplet_autoscale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ func TestDropletAutoscaler_DeleteDangerous(t *testing.T) {
defer teardown()

autoscalePoolID := "d50d8276-ad17-475d-8d2a-26b0acac756c"
mux.HandleFunc(fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, autoscalePoolID), func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc(fmt.Sprintf("%s/%s/dangerous", dropletAutoscaleBasePath, autoscalePoolID), func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodDelete)
if expectedHeader, err := strconv.ParseBool(r.Header.Get("X-Dangerous")); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 959a49f

Please sign in to comment.