Skip to content

Commit

Permalink
Rename "workers" to "hosts" (#3491)
Browse files Browse the repository at this point in the history
* Rename "workers" to "hosts"

* Upgrade to fly-go v0.1.7; switch to `HostStatus` field
  • Loading branch information
matttpt committed Apr 26, 2024
1 parent 285c6bc commit 996f7e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/superfly/fly-go v0.1.6
github.com/superfly/fly-go v0.1.7
github.com/superfly/graphql v0.2.4
github.com/superfly/lfsc-go v0.1.1
github.com/superfly/macaroon v0.2.13
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/superfly/fly-go v0.1.6 h1:l+kZD32m0NyJuVpRz36bF2J6RspDIpxcEkkPKiijVkQ=
github.com/superfly/fly-go v0.1.6/go.mod h1:0wgmVsqPPDgPSTsZA0L0zI5uajxx86KfuBoPQT87B1E=
github.com/superfly/fly-go v0.1.7 h1:nZHw+pvuNN/wTnQZ3dqYN73QuR5DEgjPwpjMjkrAFEM=
github.com/superfly/fly-go v0.1.7/go.mod h1:0wgmVsqPPDgPSTsZA0L0zI5uajxx86KfuBoPQT87B1E=
github.com/superfly/graphql v0.2.4 h1:Av8hSk4x8WvKJ6MTnEwrLknSVSGPc7DWpgT3z/kt3PU=
github.com/superfly/graphql v0.2.4/go.mod h1:CVfDl31srm8HnJ9udwLu6hFNUW/P6GUM2dKcG1YQ8jc=
github.com/superfly/lfsc-go v0.1.1 h1:dGjLgt81D09cG+aR9lJZIdmonjZSR5zYCi7s54+ZU2Q=
Expand Down
4 changes: 2 additions & 2 deletions internal/command/machine/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func runMachineList(ctx context.Context) (err error) {
}

note := ""
unreachable := machine.WorkerStatus == "unreachable"
unreachable := machine.HostStatus == "unreachable"
if unreachable {
unreachableMachines = true
note = "*"
Expand All @@ -144,7 +144,7 @@ func runMachineList(ctx context.Context) (err error) {

_ = render.Table(io.Out, appName, rows, "ID", "Name", "State", "Region", "Image", "IP Address", "Volume", "Created", "Last Updated", "App Platform", "Process Group", "Size")
if unreachableMachines {
fmt.Fprintln(io.Out, "* The workers hosting these Machines could not be reached.")
fmt.Fprintln(io.Out, "* These Machines' hosts could not be reached.")
}
}
return nil
Expand Down
8 changes: 4 additions & 4 deletions internal/command/volumes/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func countVolumesMatchingName(ctx context.Context, volumeName string) (int32, er
return matches, nil
}

func renderTable(ctx context.Context, volumes []fly.Volume, app *fly.AppBasic, out io.Writer, showWorkerStatus bool) error {
func renderTable(ctx context.Context, volumes []fly.Volume, app *fly.AppBasic, out io.Writer, showHostStatus bool) error {
rows := make([][]string, 0, len(volumes))
unreachableVolumes := false
for _, volume := range volumes {
Expand All @@ -103,7 +103,7 @@ func renderTable(ctx context.Context, volumes []fly.Volume, app *fly.AppBasic, o
}

note := ""
if showWorkerStatus && volume.WorkerStatus == "unreachable" {
if showHostStatus && volume.HostStatus == "unreachable" {
unreachableVolumes = true
note = "*"
}
Expand All @@ -124,8 +124,8 @@ func renderTable(ctx context.Context, volumes []fly.Volume, app *fly.AppBasic, o
if err := render.Table(out, "", rows, "ID", "State", "Name", "Size", "Region", "Zone", "Encrypted", "Attached VM", "Created At"); err != nil {
return err
}
if showWorkerStatus && unreachableVolumes {
fmt.Fprintln(out, "* The workers hosting these volumes could not be reached.")
if showHostStatus && unreachableVolumes {
fmt.Fprintln(out, "* These volumes' hosts could not be reached.")
}
return nil
}
Expand Down

0 comments on commit 996f7e1

Please sign in to comment.