Skip to content

Commit

Permalink
Add tests for filtering peering zones
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Chinnadorai authored and itspngu committed Jun 19, 2023
1 parent b1084be commit a7884f1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions provider/google/google_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,17 @@ func TestGoogleZonesVisibilityFilterPrivate(t *testing.T) {
})
}

func TestGoogleZonesVisibilityFilterPrivatePeering(t *testing.T) {
provider := newGoogleProviderZoneOverlap(t, endpoint.NewDomainFilter([]string{"svc.local."}), provider.NewZoneIDFilter([]string{""}), provider.NewZoneTypeFilter("private"), false, []*endpoint.Endpoint{})

zones, err := provider.Zones(context.Background())
require.NoError(t, err)

validateZones(t, zones, map[string]*dns.ManagedZone{
"svc-local": {Name: "svc-local", DnsName: "svc.local.", Id: 1005, Visibility: "private"},
})
}

func TestGoogleZones(t *testing.T) {
provider := newGoogleProvider(t, endpoint.NewDomainFilter([]string{"ext-dns-test-2.gcp.zalan.do."}), provider.NewZoneIDFilter([]string{""}), false, []*endpoint.Endpoint{})

Expand Down Expand Up @@ -744,6 +755,22 @@ func newGoogleProviderZoneOverlap(t *testing.T, domainFilter endpoint.DomainFilt
Visibility: "private",
})


createZone(t, provider, &dns.ManagedZone{
Name: "svc-local",
DnsName: "svc.local.",
Id: 10005,
Visibility: "private",
})

createZone(t, provider, &dns.ManagedZone{
Name: "svc-local-peer",
DnsName: "svc.local.",
Id: 10006,
Visibility: "private",
PeeringConfig: &dns.ManagedZonePeeringConfig{TargetNetwork: nil},
})

provider.dryRun = dryRun

return provider
Expand Down

0 comments on commit a7884f1

Please sign in to comment.