This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch cve
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git
The following commit(s) were added to refs/heads/cve by this push:
new b7b9c15 Update go version in CI and fix lint
b7b9c15 is described below
commit b7b9c15b3943217fa8265f9c9b9d4a5fa410e9a3
Author: mrproliu <[email protected]>
AuthorDate: Thu Jul 11 15:59:52 2024 +0800
Update go version in CI and fix lint
---
.github/workflows/build-and-test.yaml | 2 +-
.github/workflows/e2e-istio.yaml | 4 ++--
.github/workflows/e2e-native.yaml | 2 +-
.golangci.yml | 8 --------
docs/en/guides/compile/How-to-compile.md | 2 +-
go.mod | 2 +-
go.sum | 8 ++++++++
internal/satellite/tools/catalog.go | 2 +-
internal/satellite/tools/generate_plugin_doc.go | 4 ++--
plugins/client/grpc/static_clients_test.go | 2 +-
plugins/receiver/grpc/common_test_help.go | 3 +--
plugins/server/grpc/server_connections.go | 1 -
test/e2e/base/satellite/Dockerfile | 2 +-
13 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/.github/workflows/build-and-test.yaml
b/.github/workflows/build-and-test.yaml
index 1d4ec4d..c22ef89 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -28,7 +28,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
- go-version: [ 1.19 ]
+ go-version: [ 1.21 ]
runner: [ ubuntu, windows ]
fail-fast: true
steps:
diff --git a/.github/workflows/e2e-istio.yaml b/.github/workflows/e2e-istio.yaml
index 75b29ab..0d50a7c 100644
--- a/.github/workflows/e2e-istio.yaml
+++ b/.github/workflows/e2e-istio.yaml
@@ -43,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: 1.19
+ go-version: 1.21
id: go
- uses: actions/checkout@v2
with:
@@ -69,7 +69,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: 1.19
+ go-version: 1.21
id: go
- uses: actions/checkout@v2
with:
diff --git a/.github/workflows/e2e-native.yaml
b/.github/workflows/e2e-native.yaml
index 2fbd174..ce471b5 100644
--- a/.github/workflows/e2e-native.yaml
+++ b/.github/workflows/e2e-native.yaml
@@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: 1.19
+ go-version: 1.21
id: go
- uses: actions/checkout@v2
with:
diff --git a/.golangci.yml b/.golangci.yml
index c14bd61..526594f 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -28,13 +28,6 @@ linters-settings:
goconst:
min-len: 2
min-occurrences: 2
- depguard:
- list-type: blacklist
- packages:
- -
- include-go-root: true
- packages-with-error-messages:
- fmt: "logging is allowed only by logutils.Log"
misspell:
locale: US
lll:
@@ -61,7 +54,6 @@ linters:
enable:
- bodyclose
- deadcode
- - depguard
- dogsled
- dupl
- errcheck
diff --git a/docs/en/guides/compile/How-to-compile.md
b/docs/en/guides/compile/How-to-compile.md
index 047e410..98ea473 100644
--- a/docs/en/guides/compile/How-to-compile.md
+++ b/docs/en/guides/compile/How-to-compile.md
@@ -2,7 +2,7 @@
## Go version
-Go version `1.19` is required for compilation.
+Go version `1.21` is required for compilation.
## Platform
Linux, MacOS and Windows are supported in SkyWalking Satellite. However, some
components don't fit the Windows platform, including:
diff --git a/go.mod b/go.mod
index 65bdda5..0e482af 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/apache/skywalking-satellite
-go 1.19
+go 1.21
require (
github.com/Shopify/sarama v1.27.2
diff --git a/go.sum b/go.sum
index 973bb36..7b3d109 100644
--- a/go.sum
+++ b/go.sum
@@ -103,6 +103,7 @@ github.com/envoyproxy/go-control-plane
v0.9.9-0.20210217033140-668b12f5399d/go.m
github.com/envoyproxy/go-control-plane
v0.9.9-0.20210512163311-63b5d3c536b0/go.mod
h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod
h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.12.0+incompatible
h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
+github.com/evanphx/json-patch v4.12.0+incompatible/go.mod
h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod
h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/flowstack/go-jsonschema v0.1.1/go.mod
h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0=
github.com/fortytw2/leaktest v1.3.0
h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
@@ -209,6 +210,7 @@ github.com/google/pprof
v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe
github.com/google/renameio v0.1.0/go.mod
h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod
h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod
h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod
h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod
h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/google-cloud-go-testing
v0.0.0-20200911160855-bcd43fbb19e8/go.mod
h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
@@ -318,7 +320,9 @@ github.com/mwitkow/go-conntrack
v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod
h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/ulid v1.3.1/go.mod
h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/ginkgo/v2 v2.4.0
h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs=
+github.com/onsi/ginkgo/v2 v2.4.0/go.mod
h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo=
github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys=
+github.com/onsi/gomega v1.23.0/go.mod
h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod
h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.2.0/go.mod
h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1
h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
@@ -334,6 +338,7 @@ github.com/pmezard/go-difflib v1.0.0
h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod
h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod
h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/prashantv/gostub v1.1.0
h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
+github.com/prashantv/gostub v1.1.0/go.mod
h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus/client_golang v0.9.1/go.mod
h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod
h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.14.0
h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
@@ -361,6 +366,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod
h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod
h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod
h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.9.0
h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
+github.com/rogpeppe/go-internal v1.9.0/go.mod
h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.0.1
h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod
h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod
h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
@@ -403,6 +409,7 @@ github.com/stretchr/testify v1.7.1/go.mod
h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod
h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod
h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2
h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod
h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/subosito/gotenv v1.2.0
h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod
h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tklauser/go-sysconf v0.3.9
h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo=
@@ -438,6 +445,7 @@ go.uber.org/atomic v1.4.0/go.mod
h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk=
go.uber.org/automaxprocs v1.5.1/go.mod
h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
+go.uber.org/goleak v1.2.1/go.mod
h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/multierr v1.1.0/go.mod
h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod
h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
diff --git a/internal/satellite/tools/catalog.go
b/internal/satellite/tools/catalog.go
index fecb137..43d3183 100644
--- a/internal/satellite/tools/catalog.go
+++ b/internal/satellite/tools/catalog.go
@@ -93,7 +93,7 @@ func (c *Catalog) Save(filename string) error {
return err
}
- if err := os.WriteFile(filename, append(content, marshal...),
os.ModePerm); err != nil {
+ if err := os.WriteFile(filename, append(content, marshal...), 0o600);
err != nil {
return fmt.Errorf("cannot write catalog: %v", err)
}
return nil
diff --git a/internal/satellite/tools/generate_plugin_doc.go
b/internal/satellite/tools/generate_plugin_doc.go
index ae929ff..a7d4bb3 100644
--- a/internal/satellite/tools/generate_plugin_doc.go
+++ b/internal/satellite/tools/generate_plugin_doc.go
@@ -301,7 +301,7 @@ func parsePluginConfigurationItem(field *ast.Field, pType
reflect.Type) (*plugin
return nil, nil
}
confName = mapStructureValue[:index]
- } else if len(mapStructureValue) > 0 {
+ } else if mapStructureValue != "" {
confName = mapStructureValue
} else {
confName = fieldName
@@ -379,7 +379,7 @@ func getPluginDocFileName(category reflect.Type, pluginName
string) string {
}
func writeDoc(docBytes []byte, docFileName string) error {
- if err := os.WriteFile(docFileName, docBytes, os.ModePerm); err != nil {
+ if err := os.WriteFile(docFileName, docBytes, 0o600); err != nil {
return fmt.Errorf("cannot init the plugin doc: %v", err)
}
return nil
diff --git a/plugins/client/grpc/static_clients_test.go
b/plugins/client/grpc/static_clients_test.go
index 7e0c1a8..dffd673 100644
--- a/plugins/client/grpc/static_clients_test.go
+++ b/plugins/client/grpc/static_clients_test.go
@@ -80,7 +80,7 @@ func TestStaticServer(t *testing.T) {
// send request
jvmClient :=
agent.NewJVMMetricReportServiceClient(c.GetConnectedClient().(*grpc.ClientConn))
- for inx := 0; inx < serverCount; inx++ {
+ for inx := 0; inx < serverCount*3; inx++ { // the lb connection will be
connected with async, so we need to send more request
if _, err := jvmClient.Collect(context.Background(),
&agent.JVMMetricCollection{}); err != nil {
t.Errorf("send request error: %v", err)
}
diff --git a/plugins/receiver/grpc/common_test_help.go
b/plugins/receiver/grpc/common_test_help.go
index 0285d81..b888914 100644
--- a/plugins/receiver/grpc/common_test_help.go
+++ b/plugins/receiver/grpc/common_test_help.go
@@ -139,8 +139,7 @@ func (s *syncInvoker) SyncInvoke(event *v1.SniffData)
(*v1.SniffData, error) {
}
func initConnection(grpcPort int, t *testing.T) *grpc.ClientConn {
- //nolint:staticcheck // just for test, fix later TODO: @mrproliu
- conn, err := grpc.NewClient(fmt.Sprintf("localhost:%d", grpcPort),
grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
+ conn, err := grpc.NewClient(fmt.Sprintf("localhost:%d", grpcPort),
grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatalf("cannot init the grpc client: %v", err)
}
diff --git a/plugins/server/grpc/server_connections.go
b/plugins/server/grpc/server_connections.go
index 5372bed..2576d2e 100644
--- a/plugins/server/grpc/server_connections.go
+++ b/plugins/server/grpc/server_connections.go
@@ -79,7 +79,6 @@ func (c *ConnectionWrapper) CloseNotify() {
}
type outOfLimit struct {
- error
}
func (o *outOfLimit) Temporary() bool {
diff --git a/test/e2e/base/satellite/Dockerfile
b/test/e2e/base/satellite/Dockerfile
index da636c2..a6f6737 100644
--- a/test/e2e/base/satellite/Dockerfile
+++ b/test/e2e/base/satellite/Dockerfile
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM golang:1.19
+FROM golang:1.21
ADD . /satellite_code
WORKDIR /satellite_code