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

chore: upgrade ExternalDNS to go 1.23 #4698

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
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@v5
with:
go-version: '1.22.4'
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
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@v5
with:
go-version: '^1.22.4'
go-version-file: go.mod

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
cache: "pip"
cache-dependency-path: "./docs/scripts/requirements.txt"

- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'

- run: |
pip install -r docs/scripts/requirements.txt

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1
make lint
2 changes: 1 addition & 1 deletion .github/workflows/staging-image-tester.yaml
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@v5
with:
go-version: '1.22.4'
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CONTROLLER_GEN=$(shell which controller-gen)
endif

golangci-lint:
@command -v golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
@command -v golangci-lint > /dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1

# Run the golangci-lint tool
.PHONY: go-lint
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ options:
substitution_option: ALLOW_LOOSE
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'docker.io/library/golang:1.22.4-bookworm'
- name: 'docker.io/library/golang:1.23-bookworm'
entrypoint: make
env:
- VERSION=$_GIT_TAG
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.22+](https://golang.org/dl/)
- [Go 1.23+](https://golang.org/dl/)
- [Go modules](https://github.com/golang/go/wiki/Modules)
- [golangci-lint](https://github.com/golangci/golangci-lint)
- [ko](https://ko.build/)
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.22.4
go 1.23

require (
cloud.google.com/go/compute/metadata v0.5.0
Expand Down
2 changes: 1 addition & 1 deletion provider/tencentcloud/cloudapi/mockapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (api *mockAPIService) DeletePrivateZoneRecord(request *privatedns.DeletePri
}
for _, privateZoneRecord := range api.privateZoneRecords[*request.ZoneId] {
deleteflag := false
if request.RecordIdSet != nil && len(request.RecordIdSet) != 0 {
if len(request.RecordIdSet) != 0 {
mloiseleur marked this conversation as resolved.
Show resolved Hide resolved
for _, recordId := range request.RecordIdSet {
if *privateZoneRecord.RecordId == *recordId {
deleteflag = true
Expand Down
6 changes: 3 additions & 3 deletions provider/tencentcloud/cloudapi/tencentapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,16 @@ func dealWithError(action Action, request string, err error) bool {
}

func APIErrorRecord(apiAction Action, request string, response string, err error) {
log.Infof(fmt.Sprintf("APIError API: %s/%s Request: %s, Response: %s, Error: %s", apiAction.Service, apiAction.Name, request, response, err.Error()))
log.Infof("APIError API: %s/%s Request: %s, Response: %s, Error: %s", apiAction.Service, apiAction.Name, request, response, err.Error())
mloiseleur marked this conversation as resolved.
Show resolved Hide resolved
}

func APIRecord(apiAction Action, request string, response string) {
message := fmt.Sprintf("APIRecord API: %s/%s Request: %s, Response: %s", apiAction.Service, apiAction.Name, request, response)

if apiAction.ReadOnly {
// log.Infof(message)
// log.Info(message)
} else {
log.Infof(message)
log.Info(message)
}
}

Expand Down
4 changes: 2 additions & 2 deletions provider/tencentcloud/dnspod.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (p *TencentCloudProvider) getDomainList() ([]*dnspod.DomainListItem, error)
if err != nil {
return nil, err
}
if response.Response.DomainList != nil && len(response.Response.DomainList) > 0 {
if len(response.Response.DomainList) > 0 {
if !p.domainFilter.IsConfigured() {
domainList = append(domainList, response.Response.DomainList...)
} else {
Expand Down Expand Up @@ -119,7 +119,7 @@ func (p *TencentCloudProvider) getDomainRecordList(domain string) ([]*dnspod.Rec
if err != nil {
return nil, err
}
if response.Response.RecordList != nil && len(response.Response.RecordList) > 0 {
if len(response.Response.RecordList) > 0 {
for _, record := range response.Response.RecordList {
if *record.Name == "@" && *record.Type == "NS" { // Special Record, Skip it.
continue
Expand Down
4 changes: 2 additions & 2 deletions provider/tencentcloud/privatedns.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (p *TencentCloudProvider) getPrivateZones() ([]*privatedns.PrivateZone, err
if err != nil {
return nil, err
}
if response.Response.PrivateZoneSet != nil && len(response.Response.PrivateZoneSet) > 0 {
if len(response.Response.PrivateZoneSet) > 0 {
privateZones = append(privateZones, response.Response.PrivateZoneSet...)
}
totalCount = *response.Response.TotalCount
Expand Down Expand Up @@ -140,7 +140,7 @@ func (p *TencentCloudProvider) getPrivateZoneRecords(zoneId string) ([]*privated
if err != nil {
return nil, err
}
if response.Response.RecordSet != nil && len(response.Response.RecordSet) > 0 {
if len(response.Response.RecordSet) > 0 {
privateZoneRecords = append(privateZoneRecords, response.Response.RecordSet...)
}
totalCount = *response.Response.TotalCount
Expand Down
4 changes: 2 additions & 2 deletions provider/vinyldns/vinyldns.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (p *vinyldnsProvider) Records(ctx context.Context) (endpoints []*endpoint.E
continue
}

log.Infof(fmt.Sprintf("Zone: [%s:%s]", zone.ID, zone.Name))
log.Infof("Zone: [%s:%s]", zone.ID, zone.Name)
records, err := p.client.RecordSets(zone.ID)
if err != nil {
return nil, err
Expand All @@ -101,7 +101,7 @@ func (p *vinyldnsProvider) Records(ctx context.Context) (endpoints []*endpoint.E
for _, r := range records {
if provider.SupportedRecordType(r.Type) {
recordsCount := len(r.Records)
log.Debugf(fmt.Sprintf("%s.%s.%d.%s", r.Name, r.Type, recordsCount, zone.Name))
log.Debugf("%s.%s.%d.%s", r.Name, r.Type, recordsCount, zone.Name)

// TODO: AAAA Records
if len(r.Records) > 0 {
Expand Down
Loading