Skip to content

Commit

Permalink
status/log issue?
Browse files Browse the repository at this point in the history
  • Loading branch information
bdevcich committed Nov 21, 2023
1 parent 588e8ed commit 7e51bc1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions daemons/compute/client-go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,15 @@ func main() {
if err != nil {
log.Fatalf("failed to get data movement status: %v", err)
}
status := statusResponse.GetStatus()
state := statusResponse.GetState()
log.Printf("Data movement status: %+v", statusResponse)

if statusResponse.GetStatus() == pb.DataMovementStatusResponse_FAILED {
if status == pb.DataMovementStatusResponse_FAILED || status == pb.DataMovementStatusResponse_INVALID {
log.Fatalf("data movement status failed: %+v", statusResponse)
}

log.Printf("Data movement status: %+v", statusResponse)
if statusResponse.GetState() == pb.DataMovementStatusResponse_COMPLETED {
if state == pb.DataMovementStatusResponse_COMPLETED {
break
}

Expand Down
7 changes: 7 additions & 0 deletions daemons/compute/server/servers/server_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import (
"time"

"go.openly.dev/pointy"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/protobuf/types/known/emptypb"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -49,6 +51,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/event"
zapcr "sigs.k8s.io/controller-runtime/pkg/log/zap"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/predicate"

Expand Down Expand Up @@ -195,6 +198,10 @@ func CreateDefaultServer(opts *ServerOptions) (*defaultServer, error) {
opts.nodeName = storageNode.Name
}

encoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
zaplogger := zapcr.New(zapcr.Encoder(encoder), zapcr.UseDevMode(true))
ctrl.SetLogger(zaplogger)

return &defaultServer{
config: config,
client: client,
Expand Down

0 comments on commit 7e51bc1

Please sign in to comment.