Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/hetznercloud/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (p *provider) Destroy(ctx context.Context, instance *autoscaler.Instance) e
_, err = p.client.Server.Delete(ctx, &hcloud.Server{ID: id})

if err != nil {
if err.Error() == "hcloud: server responded with status code 404" {
if hcloud.IsError(err, hcloud.ErrorCodeNotFound) {
logger.WithError(err).
Debugln("instance does not exist")
return autoscaler.ErrInstanceNotFound
Expand Down
1 change: 1 addition & 0 deletions drivers/hetznercloud/destroy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestDestroyNotFound(t *testing.T) {
gock.New("https://api.hetzner.cloud").
Delete("/v1/servers/3164494").
Reply(404).
SetHeader("Content-Type", "application/json").
BodyString(destroyNotFoundResponse)

mockContext := context.TODO()
Expand Down