Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Nov 30, 2024
1 parent 9fad69d commit 74fd8b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions client/v1/examples/get-states/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"errors"
"fmt"
"time"

client_v1 "github.com/leptonai/gpud/client/v1"
Expand All @@ -29,7 +28,7 @@ func main() {

for _, ss := range states {
for _, s := range ss.States {
fmt.Printf("state: %q, healthy: %v, extra info: %q\n", s.Name, s.Healthy, s.ExtraInfo)
log.Logger.Infof("state: %q, healthy: %v, extra info: %q\n", s.Name, s.Healthy, s.ExtraInfo)
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions cmd/gpud/command/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ func checkDiskComponent() error {
defer cancel()
states, err := client.GetStates(ctx, baseURL, client.WithComponent(componentName))
if err != nil {
if errors.Is(err, errdefs.ErrNotFound) {
log.Logger.Warnw("component not found", "component", componentName)
return nil
}
// assume disk component is enabled for all platforms
return err
}
if len(states) == 0 {
Expand All @@ -110,7 +107,7 @@ func checkDiskComponent() error {

for _, ss := range states {
for _, s := range ss.States {
fmt.Printf("state: %q, healthy: %v, extra info: %q\n", s.Name, s.Healthy, s.ExtraInfo)
log.Logger.Infof("state: %q, healthy: %v, extra info: %q\n", s.Name, s.Healthy, s.ExtraInfo)
}
}

Expand Down Expand Up @@ -138,7 +135,7 @@ func checkNvidiaInfoComponent() error {

for _, ss := range states {
for _, s := range ss.States {
fmt.Printf("state: %q, healthy: %v, extra info: %q\n", s.Name, s.Healthy, s.ExtraInfo)
log.Logger.Infof("state: %q, healthy: %v, extra info: %q\n", s.Name, s.Healthy, s.ExtraInfo)
}
}

Expand Down

0 comments on commit 74fd8b4

Please sign in to comment.