Skip to content

Commit

Permalink
fix: failed to upload codecov
Browse files Browse the repository at this point in the history
Signed-off-by: tao.yang <tao.yang@daocloud.io>
  • Loading branch information
ty-dc committed Aug 21, 2024
1 parent 21d8e1a commit 401f41a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/codespell-ignorewords
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NotIn
2 changes: 1 addition & 1 deletion .github/workflows/lint-golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
# ============= upload coverage report
- name: Upload to Codecov
if: ${{ steps.unitest.outcome != 'failure' }}
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v4
with:
directory: './'
files: '${{ env.COVERAGE_REPORT_PATH }}'
Expand Down
10 changes: 5 additions & 5 deletions pkg/grpcManager/server_implement.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ package grpcManager
import (
"context"
"fmt"
"io"
"time"

"github.com/kdoctor-io/kdoctor/api/v1/agentGrpc"
"github.com/kdoctor-io/kdoctor/pkg/utils"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"io"
"time"
)

// ------ implement
Expand Down Expand Up @@ -82,9 +83,8 @@ func (s *myGrpcServer) ExecRemoteCmd(stream agentGrpc.CmdService_ExecRemoteCmdSe
}

if e := stream.Send(re); e != nil {
c := fmt.Sprintf("grpc server failed to send msg: %v", err)
logger.Error(c)
finalError = fmt.Errorf(c)
finalError := fmt.Errorf("grpc server failed to send msg: %v", e)
logger.Error(finalError.Error())
break
}
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/pluginManager/netreach/agentExecuteTask.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package netreach

import (
"context"
"errors"
"fmt"
"sync"

"github.com/kdoctor-io/kdoctor/pkg/resource"
"github.com/kdoctor-io/kdoctor/pkg/runningTask"
networkingv1 "k8s.io/api/networking/v1"
"sync"

"go.uber.org/zap"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -85,7 +87,7 @@ func (s *PluginNetReach) AgentExecuteTask(logger *zap.Logger, ctx context.Contex
if !ok {
msg := "failed to get instance"
logger.Error(msg)
err = fmt.Errorf(msg)
err = errors.New(msg)
return
}

Expand Down
15 changes: 8 additions & 7 deletions pkg/reportManager/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ package reportManager
import (
"context"
"fmt"
"net"
"path"
"strings"
"time"

"github.com/kdoctor-io/kdoctor/pkg/grpcManager"
k8sObjManager "github.com/kdoctor-io/kdoctor/pkg/k8ObjManager"
"github.com/kdoctor-io/kdoctor/pkg/scheduler"
"github.com/kdoctor-io/kdoctor/pkg/types"
"github.com/kdoctor-io/kdoctor/pkg/utils"
"go.uber.org/zap"
"net"
"path"
"strings"
"time"
)

func GetMissRemoteReport(remoteFileList []string, localFileList []string) []string {
Expand Down Expand Up @@ -116,10 +117,10 @@ func (s *reportManager) runControllerAggregateReportOnce(ctx context.Context, lo
podIP, err = k8sObjManager.GetK8sObjManager().ListDeploymentPodIPs(context.Background(), task.RuntimeName, types.ControllerConfig.PodNamespace)
}
if err != nil {
m := fmt.Sprintf("failed to get kind %s name %s agent ip, error=%v", task.RuntimeKind, task.RuntimeName, err)
logger.Error(m)
m := fmt.Errorf("failed to get kind %s name %s agent ip, error=%v", task.RuntimeKind, task.RuntimeName, err)
logger.Error(m.Error())

Check warning on line 121 in pkg/reportManager/worker.go

View check run for this annotation

Codecov / codecov/patch

pkg/reportManager/worker.go#L120-L121

Added lines #L120 - L121 were not covered by tests
// retry
return fmt.Errorf(m)
return m

Check warning on line 123 in pkg/reportManager/worker.go

View check run for this annotation

Codecov / codecov/patch

pkg/reportManager/worker.go#L123

Added line #L123 was not covered by tests
}
logger.Sugar().Debugf("podIP : %v", podIP)

Expand Down

0 comments on commit 401f41a

Please sign in to comment.