Skip to content

Commit ce1bf5f

Browse files
committed
backport 5506 5546 5789
Signed-off-by: Jan Jansen <[email protected]>
1 parent a5fc4da commit ce1bf5f

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

.github/workflows/ci-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
- uses: actions/setup-go@v6
1515
with:
1616
go-version: '^1.24.7' # The Go version to download (if necessary) and use.
17-
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v8
19-
with:
20-
version: v2.4
17+
#- name: golangci-lint
18+
# uses: golangci/golangci-lint-action@v8
19+
# with:
20+
# version: v2.4
2121
- run: go build ./...
2222
- run: go test

coredns.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const (
5050

5151
type CoreDNSConfig struct {
5252
coreDNSPrefix string
53-
domainFilter endpoint.DomainFilter
53+
domainFilter *endpoint.DomainFilter
5454
ownerID string
5555
preFilterExternalOwnedRecords bool
5656
}
@@ -323,8 +323,8 @@ func (p coreDNSProvider) groupEndpoints(changes *plan.Changes) map[string][]*end
323323
grouped[ep.DNSName] = append(grouped[ep.DNSName], ep)
324324
}
325325
for i, ep := range changes.UpdateNew {
326+
log.Debugf("Updating labels (%s) with old labels (%s)", ep.Labels, changes.UpdateOld[i].Labels)
326327
ep.Labels = changes.UpdateOld[i].Labels
327-
log.Debugf("Updating labels (%s) with old labels(%s)", ep.Labels, changes.UpdateOld[i].Labels)
328328
grouped[ep.DNSName] = append(grouped[ep.DNSName], ep)
329329
}
330330
return grouped

coredns_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,7 @@ func TestCoreDNSApplyChanges_DomainDoNotMatch(t *testing.T) {
522522
client: client,
523523
CoreDNSConfig: CoreDNSConfig{
524524
coreDNSPrefix: defaultCoreDNSPrefix,
525-
domainFilter: endpoint.DomainFilter{
526-
Filters: []string{"example.local"},
527-
},
525+
domainFilter: endpoint.NewDomainFilter([]string{"example.local"}),
528526
},
529527
}
530528

@@ -636,7 +634,8 @@ func TestGetServices_Duplicate(t *testing.T) {
636634
}
637635

638636
svc := Service{Host: "example.com", Port: 80, Priority: 1, Weight: 10, Text: "hello"}
639-
value, _ := json.Marshal(svc)
637+
value, err := json.Marshal(svc)
638+
require.NoError(t, err)
640639

641640
mockKV.On("Get", mock.Anything, "/prefix").Return(&etcdcv3.GetResponse{
642641
Kvs: []*mvccpb.KeyValue{
@@ -863,7 +862,7 @@ func TestNewCoreDNSProvider(t *testing.T) {
863862
testutils.TestHelperEnvSetter(t, tt.envs)
864863

865864
provider, err := NewCoreDNSProvider(CoreDNSConfig{
866-
domainFilter: endpoint.DomainFilter{},
865+
domainFilter: &endpoint.DomainFilter{},
867866
coreDNSPrefix: "/prefix/",
868867
}, false)
869868
if tt.wantErr {

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func main() {
8888
// instantiate the config
8989
cfg := Config{
9090
CoreDNSConfig: CoreDNSConfig{
91-
domainFilter: endpoint.DomainFilter{},
91+
domainFilter: &endpoint.DomainFilter{},
9292
},
9393
}
9494
if err := cfg.ParseFlags(os.Args[1:]); err != nil {

0 commit comments

Comments
 (0)