Skip to content

Commit

Permalink
Upgrade to Go 1.21 and Dependencies (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunussandikci authored Aug 25, 2023
1 parent 721e2c5 commit 6e9efbf
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 147 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.20"
GOLANGCI_LINT_VERSION: "v1.53.3"
GO_VERSION: "1.21"
GOLANGCI_LINT_VERSION: "v1.54.2"

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.20"
GO_VERSION: "1.21"
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.20"
GO_VERSION: "1.21"
GOPRIVATE: "github:com/NCCloud/*"

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ issues:
linters:
- gochecknoglobals
run:
go: '1.20'
go: '1.21'
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.20 as builder
FROM golang:1.21 as builder

WORKDIR /workspace
COPY go.mod go.mod
Expand Down
10 changes: 7 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main
import (
"fmt"

"sigs.k8s.io/controller-runtime/pkg/metrics/server"

"github.com/NCCloud/mayfly/pkg"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
Expand All @@ -24,9 +26,11 @@ func main() {
logger.Info("Configuration", "config", config)

manager, managerErr := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Logger: logger,
MetricsBindAddress: fmt.Sprintf(":%d", metricPort),
Scheme: scheme,
Logger: logger,
Metrics: server.Options{
BindAddress: fmt.Sprintf(":%d", metricPort),
},
HealthProbeBindAddress: fmt.Sprintf(":%d", healthPort),
LeaderElection: config.EnableLeaderElection,
LeaderElectionID: "mayfly-leader.cloud.namecheap.com",
Expand Down
2 changes: 1 addition & 1 deletion 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.53.3"
export GOLANGCI_LINT_VERSION="v1.54.2"

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

go 1.20
go 1.21

require (
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/go-co-op/gocron v1.32.1
github.com/go-echarts/go-echarts/v2 v2.2.7
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
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
k8s.io/api v0.28.0
k8s.io/apimachinery v0.28.0
k8s.io/client-go v0.28.0
sigs.k8s.io/controller-runtime v0.16.0
)

require (
Expand All @@ -24,14 +24,14 @@ require (
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/jsonreference v0.20.2 // 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.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // 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
Expand All @@ -43,30 +43,31 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/common v0.44.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.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.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
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // 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.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
k8s.io/apiextensions-apiserver v0.28.0 // indirect
k8s.io/component-base v0.28.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // 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
Expand Down
Loading

0 comments on commit 6e9efbf

Please sign in to comment.