mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 09:36:58 +02:00
chore(ci): fix failing test, upgrade to go 1.23.5 and linter to v1.63
This commit is contained in:
parent
36478f1fc5
commit
cc546820dc
2
.github/workflows/lint.yaml
vendored
2
.github/workflows/lint.yaml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
uses: golangci/golangci-lint-action@v6
|
uses: golangci/golangci-lint-action@v6
|
||||||
with:
|
with:
|
||||||
args: --timeout=30m
|
args: --timeout=30m
|
||||||
version: v1.60
|
version: v1.63
|
||||||
|
|
||||||
# Run Spectral
|
# Run Spectral
|
||||||
- name: Lint OpenAPI spec
|
- name: Lint OpenAPI spec
|
||||||
|
2
Makefile
2
Makefile
@ -41,7 +41,7 @@ CONTROLLER_GEN=$(shell which controller-gen)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
golangci-lint:
|
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.60.3
|
@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.63.4
|
||||||
|
|
||||||
# Run the golangci-lint tool
|
# Run the golangci-lint tool
|
||||||
.PHONY: go-lint
|
.PHONY: go-lint
|
||||||
|
@ -321,7 +321,7 @@ var domainFilterTests = []domainFilterTest{
|
|||||||
|
|
||||||
var regexDomainFilterTests = []regexDomainFilterTest{
|
var regexDomainFilterTests = []regexDomainFilterTest{
|
||||||
{
|
{
|
||||||
regexp.MustCompile("\\.org$"),
|
regexp.MustCompile(`\.org$`),
|
||||||
regexp.MustCompile(""),
|
regexp.MustCompile(""),
|
||||||
[]string{"foo.org", "bar.org", "foo.bar.org"},
|
[]string{"foo.org", "bar.org", "foo.bar.org"},
|
||||||
true,
|
true,
|
||||||
@ -330,7 +330,7 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
regexp.MustCompile("\\.bar\\.org$"),
|
regexp.MustCompile(`\.bar\.org$`),
|
||||||
regexp.MustCompile(""),
|
regexp.MustCompile(""),
|
||||||
[]string{"foo.org", "bar.org", "example.com"},
|
[]string{"foo.org", "bar.org", "example.com"},
|
||||||
false,
|
false,
|
||||||
@ -339,7 +339,7 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||||
regexp.MustCompile(""),
|
regexp.MustCompile(""),
|
||||||
[]string{"foo.org", "bar.org", "example.foo.org", "example.bar.org", "a.example.foo.org", "a.example.bar.org"},
|
[]string{"foo.org", "bar.org", "example.foo.org", "example.bar.org", "a.example.foo.org", "a.example.bar.org"},
|
||||||
true,
|
true,
|
||||||
@ -348,18 +348,18 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||||
regexp.MustCompile("^example\\.(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`^example\.(?:foo|bar)\.org$`),
|
||||||
[]string{"foo.org", "bar.org", "a.example.foo.org", "a.example.bar.org"},
|
[]string{"foo.org", "bar.org", "a.example.foo.org", "a.example.bar.org"},
|
||||||
true,
|
true,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"regexInclude": "(?:foo|bar)\\.org$",
|
"regexInclude": `(?:foo|bar)\.org$`,
|
||||||
"regexExclude": "^example\\.(?:foo|bar)\\.org$",
|
"regexExclude": `^example\.(?:foo|bar)\.org$`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||||
regexp.MustCompile("^example\\.(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`^example\.(?:foo|bar)\.org$`),
|
||||||
[]string{"example.foo.org", "example.bar.org"},
|
[]string{"example.foo.org", "example.bar.org"},
|
||||||
false,
|
false,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
@ -368,8 +368,8 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||||
regexp.MustCompile("^example\\.(?:foo|bar)\\.org$"),
|
regexp.MustCompile(`^example\.(?:foo|bar)\.org$`),
|
||||||
[]string{"foo.org", "bar.org", "a.example.foo.org", "a.example.bar.org"},
|
[]string{"foo.org", "bar.org", "a.example.foo.org", "a.example.bar.org"},
|
||||||
true,
|
true,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
|
@ -66,6 +66,14 @@ func NewTargets(target ...string) Targets {
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewTargetsFromAddr(targets []netip.Addr) Targets {
|
||||||
|
t := make(Targets, 0, len(targets))
|
||||||
|
for _, target := range targets {
|
||||||
|
t = append(t, target.String())
|
||||||
|
}
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
func (t Targets) String() string {
|
func (t Targets) String() string {
|
||||||
return strings.Join(t, ";")
|
return strings.Join(t, ";")
|
||||||
}
|
}
|
||||||
|
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
|||||||
module sigs.k8s.io/external-dns
|
module sigs.k8s.io/external-dns
|
||||||
|
|
||||||
go 1.23.3
|
go 1.23.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute/metadata v0.6.0
|
cloud.google.com/go/compute/metadata v0.6.0
|
||||||
|
@ -45,7 +45,7 @@ func (s *nat64Source) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pPrefix.Bits() != 96 {
|
if pPrefix.Bits() != 96 {
|
||||||
return nil, fmt.Errorf("NAT64 prefixes need to be /96 prefixes.")
|
return nil, fmt.Errorf("NAT64 prefixes need to be /96 prefixes")
|
||||||
}
|
}
|
||||||
parsedNAT64Prefixes = append(parsedNAT64Prefixes, pPrefix)
|
parsedNAT64Prefixes = append(parsedNAT64Prefixes, pPrefix)
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ func (s *nat64Source) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, erro
|
|||||||
|
|
||||||
v4Addr, isOk := netip.AddrFromSlice(v4AddrBytes)
|
v4Addr, isOk := netip.AddrFromSlice(v4AddrBytes)
|
||||||
if !isOk {
|
if !isOk {
|
||||||
return nil, fmt.Errorf("Could not parse %v to IPv4 address", v4AddrBytes)
|
return nil, fmt.Errorf("could not parse %v to IPv4 address", v4AddrBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
v4Targets = append(v4Targets, v4Addr.String())
|
v4Targets = append(v4Targets, v4Addr.String())
|
||||||
|
@ -411,8 +411,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
|||||||
serviceTypesFilter: []string{},
|
serviceTypesFilter: []string{},
|
||||||
resolveLoadBalancerHostname: true,
|
resolveLoadBalancerHostname: true,
|
||||||
expected: []*endpoint.Endpoint{
|
expected: []*endpoint.Endpoint{
|
||||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{exampleDotComIP4[0].String()}},
|
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.NewTargetsFromAddr(exampleDotComIP4)},
|
||||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{exampleDotComIP6[0].String()}},
|
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.NewTargetsFromAddr(exampleDotComIP6)},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user