mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-05 17:16:59 +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
|
||||
with:
|
||||
args: --timeout=30m
|
||||
version: v1.60
|
||||
version: v1.63
|
||||
|
||||
# Run Spectral
|
||||
- name: Lint OpenAPI spec
|
||||
|
2
Makefile
2
Makefile
@ -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.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
|
||||
.PHONY: go-lint
|
||||
|
@ -321,7 +321,7 @@ var domainFilterTests = []domainFilterTest{
|
||||
|
||||
var regexDomainFilterTests = []regexDomainFilterTest{
|
||||
{
|
||||
regexp.MustCompile("\\.org$"),
|
||||
regexp.MustCompile(`\.org$`),
|
||||
regexp.MustCompile(""),
|
||||
[]string{"foo.org", "bar.org", "foo.bar.org"},
|
||||
true,
|
||||
@ -330,7 +330,7 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
||||
},
|
||||
},
|
||||
{
|
||||
regexp.MustCompile("\\.bar\\.org$"),
|
||||
regexp.MustCompile(`\.bar\.org$`),
|
||||
regexp.MustCompile(""),
|
||||
[]string{"foo.org", "bar.org", "example.com"},
|
||||
false,
|
||||
@ -339,7 +339,7 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
||||
},
|
||||
},
|
||||
{
|
||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||
regexp.MustCompile(""),
|
||||
[]string{"foo.org", "bar.org", "example.foo.org", "example.bar.org", "a.example.foo.org", "a.example.bar.org"},
|
||||
true,
|
||||
@ -348,18 +348,18 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
||||
},
|
||||
},
|
||||
{
|
||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile("^example\\.(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||
regexp.MustCompile(`^example\.(?:foo|bar)\.org$`),
|
||||
[]string{"foo.org", "bar.org", "a.example.foo.org", "a.example.bar.org"},
|
||||
true,
|
||||
map[string]string{
|
||||
"regexInclude": "(?:foo|bar)\\.org$",
|
||||
"regexExclude": "^example\\.(?:foo|bar)\\.org$",
|
||||
"regexInclude": `(?:foo|bar)\.org$`,
|
||||
"regexExclude": `^example\.(?:foo|bar)\.org$`,
|
||||
},
|
||||
},
|
||||
{
|
||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile("^example\\.(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||
regexp.MustCompile(`^example\.(?:foo|bar)\.org$`),
|
||||
[]string{"example.foo.org", "example.bar.org"},
|
||||
false,
|
||||
map[string]string{
|
||||
@ -368,8 +368,8 @@ var regexDomainFilterTests = []regexDomainFilterTest{
|
||||
},
|
||||
},
|
||||
{
|
||||
regexp.MustCompile("(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile("^example\\.(?:foo|bar)\\.org$"),
|
||||
regexp.MustCompile(`(?:foo|bar)\.org$`),
|
||||
regexp.MustCompile(`^example\.(?:foo|bar)\.org$`),
|
||||
[]string{"foo.org", "bar.org", "a.example.foo.org", "a.example.bar.org"},
|
||||
true,
|
||||
map[string]string{
|
||||
|
@ -66,6 +66,14 @@ func NewTargets(target ...string) Targets {
|
||||
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 {
|
||||
return strings.Join(t, ";")
|
||||
}
|
||||
|
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
||||
module sigs.k8s.io/external-dns
|
||||
|
||||
go 1.23.3
|
||||
go 1.23.5
|
||||
|
||||
require (
|
||||
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 {
|
||||
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)
|
||||
}
|
||||
@ -88,7 +88,7 @@ func (s *nat64Source) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, erro
|
||||
|
||||
v4Addr, isOk := netip.AddrFromSlice(v4AddrBytes)
|
||||
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())
|
||||
|
@ -411,8 +411,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
serviceTypesFilter: []string{},
|
||||
resolveLoadBalancerHostname: true,
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{exampleDotComIP4[0].String()}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{exampleDotComIP6[0].String()}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.NewTargetsFromAddr(exampleDotComIP4)},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.NewTargetsFromAddr(exampleDotComIP6)},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user