1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2026-06-03 16:35:37 +02:00

cspell lint go code (#3706)

This commit is contained in:
6543
2024-05-24 22:35:04 +02:00
committed by GitHub
parent 4628a97c93
commit 42f2734308
44 changed files with 214 additions and 161 deletions
+8 -8
View File
@@ -31,14 +31,14 @@ import (
"github.com/urfave/cli/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
grpccredentials "google.golang.org/grpc/credentials"
grpc_credentials "google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"go.woodpecker-ci.org/woodpecker/v2/agent"
agentRpc "go.woodpecker-ci.org/woodpecker/v2/agent/rpc"
agent_rpc "go.woodpecker-ci.org/woodpecker/v2/agent/rpc"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc"
@@ -67,7 +67,7 @@ func run(c *cli.Context, backends []types.Backend) error {
var transport grpc.DialOption
if c.Bool("grpc-secure") {
transport = grpc.WithTransportCredentials(grpccredentials.NewTLS(&tls.Config{InsecureSkipVerify: c.Bool("grpc-skip-insecure")}))
transport = grpc.WithTransportCredentials(grpc_credentials.NewTLS(&tls.Config{InsecureSkipVerify: c.Bool("grpc-skip-insecure")}))
} else {
transport = grpc.WithTransportCredentials(insecure.NewCredentials())
}
@@ -88,8 +88,8 @@ func run(c *cli.Context, backends []types.Backend) error {
agentConfig := readAgentConfig(agentConfigPath)
agentToken := c.String("grpc-token")
authClient := agentRpc.NewAuthGrpcClient(authConn, agentToken, agentConfig.AgentID)
authInterceptor, err := agentRpc.NewAuthInterceptor(authClient, 30*time.Minute) //nolint:mnd
authClient := agent_rpc.NewAuthGrpcClient(authConn, agentToken, agentConfig.AgentID)
authInterceptor, err := agent_rpc.NewAuthInterceptor(authClient, 30*time.Minute) //nolint:mnd
if err != nil {
return err
}
@@ -109,7 +109,7 @@ func run(c *cli.Context, backends []types.Backend) error {
}
defer conn.Close()
client := agentRpc.NewGrpcClient(conn)
client := agent_rpc.NewGrpcClient(conn)
sigterm := abool.New()
ctx := metadata.NewOutgoingContext(
@@ -138,12 +138,12 @@ func run(c *cli.Context, backends []types.Backend) error {
log.Error().Err(err).Msg("could not get grpc server version")
return err
}
if grpcServerVersion.GrpcVersion != agentRpc.ClientGrpcVersion {
if grpcServerVersion.GrpcVersion != agent_rpc.ClientGrpcVersion {
err := errors.New("GRPC version mismatch")
log.Error().Err(err).Msgf("server version %s does report grpc version %d but we only understand %d",
grpcServerVersion.ServerVersion,
grpcServerVersion.GrpcVersion,
agentRpc.ClientGrpcVersion)
agent_rpc.ClientGrpcVersion)
return err
}