Skip to content

Commit

Permalink
Merge pull request #4698 from mloiseleur/chore/go1.23
Browse files Browse the repository at this point in the history
chore: upgrade ExternalDNS to go 1.23
  • Loading branch information
k8s-ci-robot authored Aug 26, 2024
2 parents 5b58ebc + 0ec66ee commit cb89c0e
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-latest
steps:

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

- 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: Install CI
run: |
go get -v -t -d ./...
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
17 changes: 9 additions & 8 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
contents: read # to fetch code (actions/checkout)
checks: write

jobs:

Expand All @@ -20,16 +21,16 @@ jobs:
runs-on: ubuntu-latest
steps:

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

- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: '1.22.4'
id: go

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

- 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
make lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=30m
version: v1.60
8 changes: 4 additions & 4 deletions .github/workflows/staging-image-tester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-latest
steps:

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

- 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: Install CI
run: |
go get -v -t -d ./...
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.3

# 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 {
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())
}

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

0 comments on commit cb89c0e

Please sign in to comment.