Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Remove the Prometheus socket post-run, some format cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
twelho committed Jul 8, 2019
1 parent edff414 commit ef49edd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/ignite-spawn/ignite-spawn.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func StartVM(co *options) error {
// Remove the port mappings post-run
defer co.vm.ClearPortMappings()

// Remove the Prometheus socket post-run
defer os.Remove(metricsSocket)

// Execute Firecracker
if err := container.ExecuteFirecracker(co.vm, dhcpIfaces); err != nil {
return fmt.Errorf("runtime error for VM %q: %v", co.vm.GetUID(), err)
Expand Down
1 change: 1 addition & 0 deletions cmd/ignite/run/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ func Stop(so *stopOptions) error {
return err
}
}

return nil
}
2 changes: 2 additions & 0 deletions pkg/operations/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func RemoveVMContainer(vm meta.Object) error {
// StopVM stops or kills a (potentially running) VM
func StopVM(vm meta.Object, kill, silent bool) error {
dockerArgs := stopArgs

// Change to kill arguments if requested
if kill {
dockerArgs = killArgs
Expand All @@ -77,5 +78,6 @@ func StopVM(vm meta.Object, kill, silent bool) error {
} else {
log.Printf("Stopped %s with name %q and ID %q", vm.GetKind(), vm.GetName(), vm.GetUID())
}

return nil
}

0 comments on commit ef49edd

Please sign in to comment.