mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Update dnsprovider multi-type support test to test for an A-record and an AAAA-record.
Having an A-record and a CNAME-record in the tests led to a confusion that dns providers support such configurations. This change avoids that confusion by putting only compatible records for the same domain name in the tests.
This commit is contained in:
parent
1b0bc9421f
commit
b4ea59e65a
@ -22,6 +22,7 @@ type (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
A = RrsType("A")
|
A = RrsType("A")
|
||||||
|
AAAA = RrsType("AAAA")
|
||||||
CNAME = RrsType("CNAME")
|
CNAME = RrsType("CNAME")
|
||||||
// TODO: Add other types as required
|
// TODO: Add other types as required
|
||||||
)
|
)
|
||||||
|
@ -84,17 +84,17 @@ func CommonTestResourceRecordSetsDifferentTypes(t *testing.T, zone dnsprovider.Z
|
|||||||
defer sets.StartChangeset().Remove(rrset).Apply()
|
defer sets.StartChangeset().Remove(rrset).Apply()
|
||||||
t.Logf("Successfully added resource record set: %v", rrset)
|
t.Logf("Successfully added resource record set: %v", rrset)
|
||||||
|
|
||||||
cnameRrset := rrsets.New("alpha.test.com", []string{"cname.test.com"}, 80, rrstype.CNAME)
|
aaaaRrset := rrsets.New("alpha.test.com", []string{"2001:4860:4860::8888"}, 80, rrstype.AAAA)
|
||||||
|
|
||||||
// Add the resource with the same name but different type
|
// Add the resource with the same name but different type
|
||||||
err := sets.StartChangeset().Add(cnameRrset).Apply()
|
err := sets.StartChangeset().Add(aaaaRrset).Apply()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Failed to add resource record set %v: %v", cnameRrset, err)
|
t.Errorf("Failed to add resource record set %v: %v", aaaaRrset, err)
|
||||||
}
|
}
|
||||||
defer sets.StartChangeset().Remove(cnameRrset).Apply()
|
defer sets.StartChangeset().Remove(aaaaRrset).Apply()
|
||||||
|
|
||||||
// Check that both records exist
|
// Check that both records exist
|
||||||
assertHasRecord(t, sets, cnameRrset)
|
assertHasRecord(t, sets, aaaaRrset)
|
||||||
assertHasRecord(t, sets, rrset)
|
assertHasRecord(t, sets, rrset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user