Skip to content

Commit

Permalink
Upgrade to Go 1.20 and Dependencies (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunussandikci authored Jul 14, 2023
1 parent 431159e commit 721e2c5
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 487 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ permissions:
contents: read

env:
GO_VERSION: "1.19"
GOLANGCI_LINT_VERSION: "V1.50.1"
GO_VERSION: "1.20"
GOLANGCI_LINT_VERSION: "v1.53.3"

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
IMAGE: "nccloud/mayfly"
REGISTRY: "ghcr.io"
GO_VERSION: "1.19"
GO_VERSION: "1.20"
TAG: ${{ github.event.release.tag_name }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

env:
GO_VERSION: "1.19"
GO_VERSION: "1.20"
GOPRIVATE: "github:com/NCCloud/*"

jobs:
Expand Down
4 changes: 3 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ linters:
- gochecknoinits # Disallows to use init functions
- ireturn # Disallows to return Interfaces
- gci # Disable gci import ordering checker since its buggy
- depguard # Disallows to use non-listed packages
- tagalign # Disallows to use non-aligned tags
issues:
exclude-rules:
- path: .*/metrics.go
linters:
- gochecknoglobals
run:
go: '1.19'
go: '1.20'
tests: false
skip-dirs:
- cmd/benchmark
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19 as builder
FROM golang:1.20 as builder

WORKDIR /workspace
COPY go.mod go.mod
Expand Down
7 changes: 4 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"github.com/NCCloud/mayfly/pkg"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

const (
port = 9443
metricPort = 8082
healthPort = 8083
)
Expand All @@ -24,14 +24,15 @@ func main() {
logger.Info("Configuration", "config", config)

manager, managerErr := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Port: port,
Scheme: scheme,
Logger: logger,
MetricsBindAddress: fmt.Sprintf(":%d", metricPort),
HealthProbeBindAddress: fmt.Sprintf(":%d", healthPort),
SyncPeriod: config.SyncPeriod,
LeaderElection: config.EnableLeaderElection,
LeaderElectionID: "mayfly-leader.cloud.namecheap.com",
Cache: cache.Options{
SyncPeriod: config.SyncPeriod,
},
})
if managerErr != nil {
panic(managerErr)
Expand Down
2 changes: 1 addition & 1 deletion make.sh → devops.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

export GOLANGCI_LINT_VERSION="v1.50.1"
export GOLANGCI_LINT_VERSION="v1.53.3"

prerequisites() {
if ! command -v golangci-lint &>/dev/null; then
Expand Down
75 changes: 37 additions & 38 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,74 +1,73 @@
module github.com/NCCloud/mayfly

go 1.19
go 1.20

require (
github.com/caarlos0/env/v6 v6.10.1
github.com/go-co-op/gocron v1.18.0
github.com/go-echarts/go-echarts/v2 v2.2.4
github.com/caarlos0/env/v9 v9.0.0
github.com/go-co-op/gocron v1.30.1
github.com/go-echarts/go-echarts/v2 v2.2.6
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/prometheus/client_golang v1.14.0
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
k8s.io/client-go v0.26.0
sigs.k8s.io/controller-runtime v0.14.1
github.com/prometheus/client_golang v1.16.0
k8s.io/api v0.27.3
k8s.io/apimachinery v0.27.3
k8s.io/client-go v0.27.3
sigs.k8s.io/controller-runtime v0.15.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.0 // indirect
k8s.io/component-base v0.26.0 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/component-base v0.27.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 721e2c5

Please sign in to comment.