@@ -86,15 +86,33 @@ func TestZoneReconciler_reconcileZone(t *testing.T) {
86
86
87
87
zone .Spec .Prune = true
88
88
89
- _ = r .reconcileZone (context .TODO (), zone )
89
+ acmeRecord , err := cf .CreateDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zoneID ), cloudflare.CreateDNSRecordParams {
90
+ Name : "_acme-challenge.abc.containeroo-test.org" ,
91
+ Type : "TXT" ,
92
+ Content : "test" ,
93
+ })
94
+ g .Expect (err ).ToNot (HaveOccurred ())
95
+ dkimRecord , err := cf .CreateDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zoneID ), cloudflare.CreateDNSRecordParams {
96
+ Name : "cf2024-1._domainkey.containeroo-test.org" ,
97
+ Type : "TXT" ,
98
+ Content : "test" ,
99
+ })
100
+ g .Expect (err ).ToNot (HaveOccurred ())
90
101
91
- g .Expect (zone .Status .Conditions ).To (conditions .MatchConditions ([]metav1.Condition {
92
- * conditions .TrueCondition (cloudflareoperatoriov1 .ConditionTypeReady , cloudflareoperatoriov1 .ConditionReasonReady , "Zone is ready" ),
93
- }))
94
- g .Expect (zone .Status .ID ).To (Equal (zoneID ))
102
+ _ = r .reconcileZone (context .TODO (), zone )
95
103
96
- _ , err : = cf .GetDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zone .Status .ID ), testRecord .ID )
104
+ _ , err = cf .GetDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zone .Status .ID ), testRecord .ID )
97
105
g .Expect (err .Error ()).To (ContainSubstring ("Record does not exist" ))
106
+
107
+ _ , err = cf .GetDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zone .Status .ID ), acmeRecord .ID )
108
+ g .Expect (err ).ToNot (HaveOccurred ())
109
+ _ , err = cf .GetDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zone .Status .ID ), dkimRecord .ID )
110
+ g .Expect (err ).ToNot (HaveOccurred ())
111
+
112
+ err = cf .DeleteDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zoneID ), acmeRecord .ID )
113
+ g .Expect (err ).ToNot (HaveOccurred ())
114
+ err = cf .DeleteDNSRecord (context .TODO (), cloudflare .ZoneIdentifier (zoneID ), dkimRecord .ID )
115
+ g .Expect (err ).ToNot (HaveOccurred ())
98
116
})
99
117
100
118
t .Run ("reconcile zone error zone not found" , func (t * testing.T ) {
0 commit comments