Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ExternalDNS to go 1.20 #3673

Merged
merged 5 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20'
id: go

- name: Check out code into the Go module directory
Expand All @@ -38,7 +38,7 @@ jobs:
apt update
apt install -y make gcc libc-dev git
if: github.actor == 'nektos/act'

- name: Test
run: make test

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install go version
uses: actions/setup-go@v3
with:
go-version: '^1.19'
go-version: '^1.20'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: ^1.19
go-version: '^1.20'

- run: |
pip install -r docs/scripts/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:

- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.2
make lint
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- depguard
- dogsled
- gofmt
- goimports
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# builder image
ARG ARCH
FROM golang:1.19 as builder
FROM golang:1.20 as builder
ARG ARCH

WORKDIR /sigs.k8s.io/external-dns
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.mini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.19 as builder
FROM golang:1.20 as builder

WORKDIR /sigs.k8s.io/external-dns

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Quick Start

- [Git](https://git-scm.com/downloads)
- [Go 1.19+](https://golang.org/dl/)
- [Go 1.20+](https://golang.org/dl/)
- [Go modules](https://github.com/golang/go/wiki/Modules)
- [golangci-lint](https://github.com/golangci/golangci-lint)
- [Docker](https://docs.docker.com/install/)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/external-dns

go 1.19
go 1.20

require (
cloud.google.com/go/compute/metadata v0.2.3
Expand Down
4 changes: 0 additions & 4 deletions provider/coredns/coredns.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ import (
"sigs.k8s.io/external-dns/provider"
)

func init() {
rand.Seed(time.Now().UnixNano())
}

const (
priority = 10 // default priority when nothing is set
etcdTimeout = 5 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion provider/rdns/rdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
)

func init() {
rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))
}

// RDNSClient is an interface to work with Rancher DNS(RDNS) records in etcdv3 backend.
Expand Down
2 changes: 0 additions & 2 deletions provider/tencentcloud/cloudapi/mockapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package cloudapi

import (
"math/rand"
"time"

"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
dnspod "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod/v20210323"
Expand All @@ -34,7 +33,6 @@ type mockAPIService struct {
}

func NewMockService(privateZones []*privatedns.PrivateZone, privateZoneRecords map[string][]*privatedns.PrivateZoneRecord, dnspodDomains []*dnspod.DomainListItem, dnspodRecords map[string][]*dnspod.RecordListItem) *mockAPIService {
rand.Seed(time.Now().Unix())
return &mockAPIService{
privateZones: privateZones,
privateZoneRecords: privateZoneRecords,
Expand Down
5 changes: 0 additions & 5 deletions source/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"fmt"
"math/rand"
"net"
"time"

"sigs.k8s.io/external-dns/endpoint"
)
Expand All @@ -40,10 +39,6 @@ const (
defaultFQDNTemplate = "example.com"
)

func init() {
rand.Seed(time.Now().UnixNano())
}

// NewFakeSource creates a new fakeSource with the given config.
func NewFakeSource(fqdnTemplate string) (Source, error) {
if fqdnTemplate == "" {
Expand Down