This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-swck.git
The following commit(s) were added to refs/heads/master by this push:
new 502610b Bump go and dependencies (#89)
502610b is described below
commit 502610b1cc71940cb36107ec335bd47aa829a781
Author: Gao Hongtao <[email protected]>
AuthorDate: Fri Jul 28 07:23:13 2023 +0800
Bump go and dependencies (#89)
* Bump go and dependencies
---------
Signed-off-by: Gao Hongtao <[email protected]>
---
.github/workflows/go.yml | 26 +++++++++++-----------
CHANGES.md | 4 ++--
README.md | 4 ++--
adapter/Dockerfile | 2 +-
.../config/namespaced/adapter/kustomization.yaml | 2 +-
adapter/dist/LICENSE | 4 ++--
adapter/go.mod | 6 ++---
adapter/go.sum | 8 ++++---
adapter/pkg/provider/provider.go | 2 +-
build/images/Dockerfile.release-bin | 1 +
golangci.yml | 4 ----
hack/build/module.mk | 4 ++--
operator/Dockerfile | 2 +-
.../apis/operator/v1alpha1/banyandb_webhook.go | 2 +-
operator/apis/operator/v1alpha1/fetcher_webhook.go | 2 +-
.../apis/operator/v1alpha1/javaagent_webhook.go | 2 +-
.../apis/operator/v1alpha1/oapserver_webhook.go | 2 +-
.../operator/v1alpha1/oapserverconfig_webhook.go | 2 +-
.../v1alpha1/oapserverdynamicconfig_webhook.go | 2 +-
.../apis/operator/v1alpha1/satellite_webhook.go | 2 +-
operator/apis/operator/v1alpha1/storage_webhook.go | 2 +-
operator/apis/operator/v1alpha1/swagent_webhook.go | 2 +-
operator/apis/operator/v1alpha1/ui_webhook.go | 2 +-
operator/config/manager/kustomization.yaml | 2 +-
.../operator/oapserverconfig_controller.go | 6 ++---
.../controllers/operator/swagent_controller.go | 2 +-
operator/dist/LICENSE | 4 ++--
operator/go.mod | 6 ++---
operator/go.sum | 8 ++++---
operator/pkg/operator/injector/injection.go | 4 ++--
operator/pkg/operator/injector/injector.go | 5 ++---
31 files changed, 63 insertions(+), 63 deletions(-)
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 7799180..ba9eab3 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -34,7 +34,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -49,7 +49,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Build
@@ -63,7 +63,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -78,7 +78,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -93,7 +93,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -108,7 +108,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -123,7 +123,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -144,7 +144,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -159,7 +159,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -174,7 +174,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -189,7 +189,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -204,7 +204,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
@@ -219,7 +219,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
- go-version: 1.19
+ go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
diff --git a/CHANGES.md b/CHANGES.md
index 7cf5fe7..7916439 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -12,8 +12,8 @@ Release Notes.
- Fix errors in banyandb e2e test.
#### Chores
-- Bump up golang to v1.19.
-- Bump up golangci-lint to v1.50.0.
+- Bump up golang to v1.20.
+- Bump up golangci-lint to v1.53.3.
- Bump up skywalking-java-agent to v8.16.0.
- Bump up kustomize to v4.5.6.
- Bump up SkyWalking OAP to 9.5.0.
diff --git a/README.md b/README.md
index e8d3bf3..df38cb9 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ For more details, please read [Java agent
injector](/docs/java-agent-injector.md
or
```
- kubectl apply -k
"github.com/apache/skywalking-swck/operator/config/default?ref=v0.7.0"
+ kubectl apply -k
"github.com/apache/skywalking-swck/operator/config/default?ref=v0.8.0"
```
For more details, please refer to [deploy operator](docs/operator.md)
@@ -78,7 +78,7 @@ For more details, please refer to [deploy
operator](docs/operator.md)
or
```
- kubectl apply -k "github.com/apache/skywalking-swck/adapter/config?ref=v0.7.0"
+ kubectl apply -k "github.com/apache/skywalking-swck/adapter/config?ref=v0.8.0"
```
For more details, please read [Custom metrics
adapter](docs/custom-metrics-adapter.md)
diff --git a/adapter/Dockerfile b/adapter/Dockerfile
index bf72aca..c5ade37 100644
--- a/adapter/Dockerfile
+++ b/adapter/Dockerfile
@@ -14,7 +14,7 @@
# limitations under the License.
# Build the manager binary
-FROM golang:1.19 as builder
+FROM golang:1.20 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
diff --git a/adapter/config/namespaced/adapter/kustomization.yaml
b/adapter/config/namespaced/adapter/kustomization.yaml
index e221ee9..37de8a9 100644
--- a/adapter/config/namespaced/adapter/kustomization.yaml
+++ b/adapter/config/namespaced/adapter/kustomization.yaml
@@ -22,4 +22,4 @@ kind: Kustomization
images:
- name: metrics-adapter
newName: apache/skywalking-swck
- newTag: v0.7.0
+ newTag: v0.8.0
diff --git a/adapter/dist/LICENSE b/adapter/dist/LICENSE
index d780701..dad5f59 100644
--- a/adapter/dist/LICENSE
+++ b/adapter/dist/LICENSE
@@ -95,7 +95,7 @@ BSD-3-Clause licenses
golang.org/x/net v0.7.0 BSD-3-Clause
golang.org/x/oauth2 v0.4.0 BSD-3-Clause
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 BSD-3-Clause
- golang.org/x/sys v0.5.0 BSD-3-Clause
+ golang.org/x/sys v0.10.0 BSD-3-Clause
golang.org/x/term v0.5.0 BSD-3-Clause
golang.org/x/text v0.7.0 BSD-3-Clause
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 BSD-3-Clause
@@ -122,7 +122,7 @@ MIT licenses
github.com/josharian/intern v1.0.0 MIT
github.com/json-iterator/go v1.1.12 MIT
github.com/mailru/easyjson v0.7.6 MIT
- github.com/sirupsen/logrus v1.8.1 MIT
+ github.com/sirupsen/logrus v1.9.3 MIT
github.com/urfave/cli v1.22.1 MIT
go.uber.org/atomic v1.7.0 MIT
go.uber.org/multierr v1.6.0 MIT
diff --git a/adapter/go.mod b/adapter/go.mod
index 386c07d..52d5289 100644
--- a/adapter/go.mod
+++ b/adapter/go.mod
@@ -1,6 +1,6 @@
module github.com/apache/skywalking-swck/adapter
-go 1.19
+go 1.20
require (
github.com/apache/skywalking-cli v0.0.0-20210209032327-04a0ce08990f
@@ -58,7 +58,7 @@ require (
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
- github.com/sirupsen/logrus v1.8.1 // indirect
+ github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.4.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.etcd.io/etcd/api/v3 v3.5.1 // indirect
@@ -82,7 +82,7 @@ require (
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
- golang.org/x/sys v0.5.0 // indirect
+ golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
diff --git a/adapter/go.sum b/adapter/go.sum
index 1d8249f..57446fd 100644
--- a/adapter/go.sum
+++ b/adapter/go.sum
@@ -580,8 +580,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod
h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod
h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod
h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod
h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.8.1
h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod
h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/sirupsen/logrus v1.9.3
h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
+github.com/sirupsen/logrus v1.9.3/go.mod
h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod
h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod
h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod
h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
@@ -927,8 +928,9 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod
h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
+golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod
h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod
h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
diff --git a/adapter/pkg/provider/provider.go b/adapter/pkg/provider/provider.go
index 198fbb3..97be60e 100644
--- a/adapter/pkg/provider/provider.go
+++ b/adapter/pkg/provider/provider.go
@@ -161,7 +161,7 @@ func bufferEntity(buff []string, index int, requirement
labels.Requirement, dec
return buff, nil
}
-func (p *externalMetricsProvider) GetExternalMetric(ctx context.Context,
namespace string, metricSelector labels.Selector,
+func (p *externalMetricsProvider) GetExternalMetric(_ context.Context,
namespace string, metricSelector labels.Selector,
info apiprovider.ExternalMetricInfo)
(*external_metrics.ExternalMetricValueList, error) {
var md *swctlapi.MetricDefinition
for _, m := range p.metricDefines {
diff --git a/build/images/Dockerfile.release-bin
b/build/images/Dockerfile.release-bin
index a13e1ea..45c0f09 100644
--- a/build/images/Dockerfile.release-bin
+++ b/build/images/Dockerfile.release-bin
@@ -14,6 +14,7 @@
# limitations under the License.
FROM gcr.io/distroless/static:nonroot
+WORKDIR /
COPY --chown=65532:65532 bin/manager-linux-amd64 /manager
COPY --chown=65532:65532 bin/adapter-linux-amd64 /adapter
USER 65532:65532
diff --git a/golangci.yml b/golangci.yml
index b6d89b1..b5975d8 100644
--- a/golangci.yml
+++ b/golangci.yml
@@ -15,16 +15,13 @@
linters:
enable:
- - deadcode
- errcheck
- goconst
- revive
- ineffassign
- lll
- misspell
- - structcheck
- unconvert
- - varcheck
- govet
- goimports
- prealloc
@@ -49,6 +46,5 @@ run:
- dist
issues:
exclude:
- # staticcheck
- 'SA1019: Package github.com/golang/protobuf/proto is deprecated: Use the
"google.golang.org/protobuf/proto" package instead.'
- 'SA1019: Package github.com/golang/protobuf/jsonpb is deprecated: Use
the "google.golang.org/protobuf/encoding/protojson" package instead.'
diff --git a/hack/build/module.mk b/hack/build/module.mk
index d1081c4..d30bfc3 100644
--- a/hack/build/module.mk
+++ b/hack/build/module.mk
@@ -25,7 +25,7 @@ include $(root_dir)/hack/build/base.mk
CONTROLLER_GEN_VERSION := v0.7.0
KUSTOMIZE_VERSION := v4.5.6
-GOLANGCI_LINT_VERSION := v1.50.0
+GOLANGCI_LINT_VERSION := v1.53.3
##@ Code quality and integrity
@@ -52,7 +52,7 @@ check: ## Check that the status
.PHONY: lint
lint: golangci-lint ## Lint codes
- $(GOLANGCILINT) run --config $(root_dir)/golangci.yml
+ $(GOLANGCILINT) -v run --config $(root_dir)/golangci.yml
CONTROLLER_GEN = $(tool_bin)/controller-gen
.PHONY: controller-gen
diff --git a/operator/Dockerfile b/operator/Dockerfile
index 65602f0..de4498e 100644
--- a/operator/Dockerfile
+++ b/operator/Dockerfile
@@ -14,7 +14,7 @@
# limitations under the License.
# Build the manager binary
-FROM golang:1.19 as builder
+FROM golang:1.20 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
diff --git a/operator/apis/operator/v1alpha1/banyandb_webhook.go
b/operator/apis/operator/v1alpha1/banyandb_webhook.go
index 4e1b370..6849329 100644
--- a/operator/apis/operator/v1alpha1/banyandb_webhook.go
+++ b/operator/apis/operator/v1alpha1/banyandb_webhook.go
@@ -67,7 +67,7 @@ func (r *BanyanDB) ValidateCreate() error {
return r.validate()
}
-func (r *BanyanDB) ValidateUpdate(old runtime.Object) error {
+func (r *BanyanDB) ValidateUpdate(_ runtime.Object) error {
banyandbLog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/fetcher_webhook.go
b/operator/apis/operator/v1alpha1/fetcher_webhook.go
index 92d9a52..366391f 100644
--- a/operator/apis/operator/v1alpha1/fetcher_webhook.go
+++ b/operator/apis/operator/v1alpha1/fetcher_webhook.go
@@ -60,7 +60,7 @@ func (r *Fetcher) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *Fetcher) ValidateUpdate(old runtime.Object) error {
+func (r *Fetcher) ValidateUpdate(_ runtime.Object) error {
fetcherlog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/javaagent_webhook.go
b/operator/apis/operator/v1alpha1/javaagent_webhook.go
index f5de779..1fa349b 100644
--- a/operator/apis/operator/v1alpha1/javaagent_webhook.go
+++ b/operator/apis/operator/v1alpha1/javaagent_webhook.go
@@ -78,7 +78,7 @@ func (r *JavaAgent) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *JavaAgent) ValidateUpdate(old runtime.Object) error {
+func (r *JavaAgent) ValidateUpdate(_ runtime.Object) error {
javaagentlog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/oapserver_webhook.go
b/operator/apis/operator/v1alpha1/oapserver_webhook.go
index 9dffe3a..aaaf137 100644
--- a/operator/apis/operator/v1alpha1/oapserver_webhook.go
+++ b/operator/apis/operator/v1alpha1/oapserver_webhook.go
@@ -72,7 +72,7 @@ func (r *OAPServer) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *OAPServer) ValidateUpdate(old runtime.Object) error {
+func (r *OAPServer) ValidateUpdate(_ runtime.Object) error {
oapserverlog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/oapserverconfig_webhook.go
b/operator/apis/operator/v1alpha1/oapserverconfig_webhook.go
index bd630f8..6950dce 100644
--- a/operator/apis/operator/v1alpha1/oapserverconfig_webhook.go
+++ b/operator/apis/operator/v1alpha1/oapserverconfig_webhook.go
@@ -62,7 +62,7 @@ func (r *OAPServerConfig) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *OAPServerConfig) ValidateUpdate(old runtime.Object) error {
+func (r *OAPServerConfig) ValidateUpdate(_ runtime.Object) error {
oapserverconfiglog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/oapserverdynamicconfig_webhook.go
b/operator/apis/operator/v1alpha1/oapserverdynamicconfig_webhook.go
index a8d376d..3ae24a3 100644
--- a/operator/apis/operator/v1alpha1/oapserverdynamicconfig_webhook.go
+++ b/operator/apis/operator/v1alpha1/oapserverdynamicconfig_webhook.go
@@ -67,7 +67,7 @@ func (r *OAPServerDynamicConfig) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *OAPServerDynamicConfig) ValidateUpdate(old runtime.Object) error {
+func (r *OAPServerDynamicConfig) ValidateUpdate(_ runtime.Object) error {
oapserverdynamicconfiglog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/satellite_webhook.go
b/operator/apis/operator/v1alpha1/satellite_webhook.go
index ef7768b..d280fa6 100644
--- a/operator/apis/operator/v1alpha1/satellite_webhook.go
+++ b/operator/apis/operator/v1alpha1/satellite_webhook.go
@@ -73,7 +73,7 @@ func (r *Satellite) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *Satellite) ValidateUpdate(old runtime.Object) error {
+func (r *Satellite) ValidateUpdate(_ runtime.Object) error {
satellitelog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/apis/operator/v1alpha1/storage_webhook.go
b/operator/apis/operator/v1alpha1/storage_webhook.go
index 1edd860..8cacf5f 100644
--- a/operator/apis/operator/v1alpha1/storage_webhook.go
+++ b/operator/apis/operator/v1alpha1/storage_webhook.go
@@ -66,7 +66,7 @@ func (r *Storage) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *Storage) ValidateUpdate(old runtime.Object) error {
+func (r *Storage) ValidateUpdate(_ runtime.Object) error {
storagelog.Info("validate update", "name", r.Name)
return r.valid()
}
diff --git a/operator/apis/operator/v1alpha1/swagent_webhook.go
b/operator/apis/operator/v1alpha1/swagent_webhook.go
index 90765aa..c23e82d 100644
--- a/operator/apis/operator/v1alpha1/swagent_webhook.go
+++ b/operator/apis/operator/v1alpha1/swagent_webhook.go
@@ -60,7 +60,7 @@ func (r *SwAgent) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *SwAgent) ValidateUpdate(old runtime.Object) error {
+func (r *SwAgent) ValidateUpdate(_ runtime.Object) error {
swagentlog.Info("validate update", "name", r.Name)
return nil
}
diff --git a/operator/apis/operator/v1alpha1/ui_webhook.go
b/operator/apis/operator/v1alpha1/ui_webhook.go
index d026f08..86c8c85 100644
--- a/operator/apis/operator/v1alpha1/ui_webhook.go
+++ b/operator/apis/operator/v1alpha1/ui_webhook.go
@@ -66,7 +66,7 @@ func (r *UI) ValidateCreate() error {
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered
for the type
-func (r *UI) ValidateUpdate(old runtime.Object) error {
+func (r *UI) ValidateUpdate(_ runtime.Object) error {
uilog.Info("validate update", "name", r.Name)
return r.validate()
}
diff --git a/operator/config/manager/kustomization.yaml
b/operator/config/manager/kustomization.yaml
index 15de25a..de47a84 100644
--- a/operator/config/manager/kustomization.yaml
+++ b/operator/config/manager/kustomization.yaml
@@ -30,4 +30,4 @@ kind: Kustomization
images:
- name: controller
newName: apache/skywalking-swck
- newTag: v0.7.0
+ newTag: v0.8.0
diff --git a/operator/controllers/operator/oapserverconfig_controller.go
b/operator/controllers/operator/oapserverconfig_controller.go
index 8984e07..e997b8b 100644
--- a/operator/controllers/operator/oapserverconfig_controller.go
+++ b/operator/controllers/operator/oapserverconfig_controller.go
@@ -102,7 +102,7 @@ func (r *OAPServerConfigReconciler) Reconcile(ctx
context.Context, req ctrl.Requ
return ctrl.Result{}, fmt.Errorf("failed to get
the deployment of OAPServer: %w", err)
}
// overlay the env configuration
- envChanged, err := r.OverlayEnv(ctx, log, &oapServer,
&oapServerConfig, &deployment)
+ envChanged, err := r.OverlayEnv(log, &oapServerConfig,
&deployment)
if err != nil {
log.Error(err, "failed to overlay the env
configuration")
}
@@ -128,8 +128,8 @@ func (r *OAPServerConfigReconciler) Reconcile(ctx
context.Context, req ctrl.Requ
return ctrl.Result{RequeueAfter: schedDuration}, nil
}
-func (r *OAPServerConfigReconciler) OverlayEnv(ctx context.Context, log
logr.Logger,
- oapServer *operatorv1alpha1.OAPServer, oapServerConfig
*operatorv1alpha1.OAPServerConfig, deployment *apps.Deployment) (bool, error) {
+func (r *OAPServerConfigReconciler) OverlayEnv(log logr.Logger,
+ oapServerConfig *operatorv1alpha1.OAPServerConfig, deployment
*apps.Deployment) (bool, error) {
changed := false
sort.Sort(SortByEnvName(oapServerConfig.Spec.Env))
diff --git a/operator/controllers/operator/swagent_controller.go
b/operator/controllers/operator/swagent_controller.go
index bfac353..b57c5ec 100644
--- a/operator/controllers/operator/swagent_controller.go
+++ b/operator/controllers/operator/swagent_controller.go
@@ -38,7 +38,7 @@ type SwAgentReconciler struct {
//+kubebuilder:rbac:groups=operator.skywalking.apache.org,resources=swagents/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.skywalking.apache.org,resources=swagents/finalizers,verbs=update
-func (r *SwAgentReconciler) Reconcile(ctx context.Context, req ctrl.Request)
(ctrl.Result, error) {
+func (r *SwAgentReconciler) Reconcile(ctx context.Context, _ ctrl.Request)
(ctrl.Result, error) {
log := runtimelog.FromContext(ctx)
log.Info("===================== SwAgent Reconcile (do nothing)
================================\n")
return ctrl.Result{}, nil
diff --git a/operator/dist/LICENSE b/operator/dist/LICENSE
index 9175845..3841cb3 100644
--- a/operator/dist/LICENSE
+++ b/operator/dist/LICENSE
@@ -245,7 +245,7 @@ BSD-3-Clause licenses
golang.org/x/crypto v0.6.0 BSD-3-Clause
golang.org/x/net v0.7.0 BSD-3-Clause
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 BSD-3-Clause
- golang.org/x/sys v0.5.0 BSD-3-Clause
+ golang.org/x/sys v0.10.0 BSD-3-Clause
golang.org/x/term v0.5.0 BSD-3-Clause
golang.org/x/text v0.7.0 BSD-3-Clause
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 BSD-3-Clause
@@ -275,7 +275,7 @@ MIT licenses
github.com/mailru/easyjson v0.7.6 MIT
github.com/mitchellh/copystructure v1.0.0 MIT
github.com/mitchellh/reflectwalk v1.0.0 MIT
- github.com/sirupsen/logrus v1.8.1 MIT
+ github.com/sirupsen/logrus v1.9.3 MIT
github.com/spf13/cast v1.3.1 MIT
go.uber.org/atomic v1.7.0 MIT
go.uber.org/multierr v1.6.0 MIT
diff --git a/operator/go.mod b/operator/go.mod
index d5ead8f..bbd7dc7 100644
--- a/operator/go.mod
+++ b/operator/go.mod
@@ -1,13 +1,13 @@
module github.com/apache/skywalking-swck/operator
-go 1.19
+go 1.20
require (
github.com/Masterminds/sprig/v3 v3.1.0
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/ghodss/yaml v1.0.0
github.com/go-logr/logr v1.2.0
- github.com/sirupsen/logrus v1.8.1
+ github.com/sirupsen/logrus v1.9.3
k8s.io/api v0.24.2
k8s.io/apimachinery v0.24.2
k8s.io/client-go v0.24.2
@@ -68,7 +68,7 @@ require (
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.5.0 // indirect
+ golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
diff --git a/operator/go.sum b/operator/go.sum
index 00fdfaa..b5a1349 100644
--- a/operator/go.sum
+++ b/operator/go.sum
@@ -438,8 +438,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod
h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod
h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod
h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod
h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.8.1
h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod
h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/sirupsen/logrus v1.9.3
h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
+github.com/sirupsen/logrus v1.9.3/go.mod
h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod
h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod
h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod
h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
@@ -714,8 +715,9 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod
h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
+golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod
h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod
h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod
h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
diff --git a/operator/pkg/operator/injector/injection.go
b/operator/pkg/operator/injector/injection.go
index e2e7666..996cc63 100644
--- a/operator/pkg/operator/injector/injection.go
+++ b/operator/pkg/operator/injector/injection.go
@@ -79,7 +79,7 @@ type GetStrategy struct {
// if don't need to inject, then return the original pod, otherwise go to the
next step
func (gs *GetStrategy) execute(ipd *InjectProcessData) admission.Response {
log.Info("=============== GetStrategy ================")
- ipd.injectFileds.GetInjectStrategy(*ipd.annotation,
&ipd.pod.ObjectMeta.Labels, &ipd.pod.ObjectMeta.Annotations)
+ ipd.injectFileds.GetInjectStrategy(&ipd.pod.ObjectMeta.Labels,
&ipd.pod.ObjectMeta.Annotations)
if !ipd.injectFileds.NeedInject {
log.Info("don't inject agent")
return admission.Allowed("ok")
@@ -99,7 +99,7 @@ type OverlaySwAgentCR struct {
// get configs from SwAgent CR
func (gs *OverlaySwAgentCR) execute(ipd *InjectProcessData) admission.Response
{
log.Info(fmt.Sprintf("=============== OverlaySwAgentCR(%d)
================ ", len(ipd.swAgentL.Items)))
- if !ipd.injectFileds.OverlaySwAgentCR(ipd.swAgentL, ipd.pod) {
+ if !ipd.injectFileds.OverlaySwAgentCR(ipd.swAgentL) {
log.Info("overlay SwAgent cr config error.")
return PatchReq(ipd.pod, ipd.req)
}
diff --git a/operator/pkg/operator/injector/injector.go
b/operator/pkg/operator/injector/injector.go
index b0ada85..be17c3f 100644
--- a/operator/pkg/operator/injector/injector.go
+++ b/operator/pkg/operator/injector/injector.go
@@ -143,8 +143,7 @@ func (s *SidecarInjectField) Inject(pod *corev1.Pod) {
}
// GetInjectStrategy gets user's injection strategy
-func (s *SidecarInjectField) GetInjectStrategy(a Annotations, labels,
- annotation *map[string]string) {
+func (s *SidecarInjectField) GetInjectStrategy(labels, annotation
*map[string]string) {
// set default value
s.NeedInject = false
@@ -237,7 +236,7 @@ func (s *SidecarInjectField) setValue(config *string, ao
*AnnotationOverlay, ann
return false
}
-func (s *SidecarInjectField) OverlaySwAgentCR(swAgentL *v1alpha1.SwAgentList,
pod *corev1.Pod) bool {
+func (s *SidecarInjectField) OverlaySwAgentCR(swAgentL *v1alpha1.SwAgentList)
bool {
// chose the last matched SwAgent
if len(swAgentL.Items) > 0 {
swAgent := swAgentL.Items[len(swAgentL.Items)-1]