MCPcopy Create free account
hub / github.com/cloudbase/garm / rotateRunners

Function rotateRunners

cmd/garm-cli/cmd/pool.go:534–549  ·  view source on GitHub ↗
(instances []params.Instance, forceRemove, bypassGH bool)

Source from the content-addressed store, hash-verified

532}
533
534func rotateRunners(instances []params.Instance, forceRemove, bypassGH bool) (removed, skipped int) {
535 for _, inst := range instances {
536 deleteReq := apiClientInstances.NewDeleteInstanceParams()
537 deleteReq.InstanceName = inst.Name
538 deleteReq.ForceRemove = &forceRemove
539 deleteReq.BypassGHUnauthorized = &bypassGH
540 if err := apiCli.Instances.DeleteInstance(deleteReq, authToken); err != nil {
541 fmt.Printf(" Warning: failed to remove %s: %v\n", inst.Name, err)
542 skipped++
543 continue
544 }
545 fmt.Printf(" Removed %s\n", inst.Name)
546 removed++
547 }
548 return
549}
550
551func init() {
552 poolListCmd.Flags().StringVarP(&poolRepository, "repo", "r", "", "List all pools within this repository.")

Callers 2

scalesets.goFile · 0.85
pool.goFile · 0.85

Calls 1

DeleteInstanceMethod · 0.65

Tested by

no test coverage detected