Skip to content

Commit

Permalink
Fix vm not deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Tereius committed Aug 6, 2024
1 parent 625e5bd commit e22bb73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runner-autoscaler/pkg/srv.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ func (s *Autoscaler) handleDeleteVm(ctx *gin.Context) {

log.Info("Received delete-vm cloud task callback")
if data, _, err := s.verifySignature(ctx); err == nil {
vmSettings := VmSettings{}
json.Unmarshal(data, &vmSettings)
if err := s.DeleteInstance(ctx, vmSettings.Name); err != nil {
job := Job{}
json.Unmarshal(data, &job)
if err := s.DeleteInstance(ctx, job.RunnerName); err != nil {
ctx.AbortWithError(http.StatusInternalServerError, err)
} else {
ctx.Status(http.StatusOK)
Expand Down

0 comments on commit e22bb73

Please sign in to comment.