Skip to content

Commit ff97712

Browse files
authored
Merge pull request #24 from datum-cloud/fix/contactgroupmembership-condition
feat: update `go.miloapis.com/milo` dependency and fix wrong status condition
2 parents 98f4bae + f8f7988 commit ff97712

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
sigs.k8s.io/controller-runtime v0.21.0
1111
)
1212

13-
require go.miloapis.com/milo v0.14.3-0.20260105133739-4ac940dbe3e2
13+
require go.miloapis.com/milo v0.16.2
1414

1515
require github.com/svix/svix-webhooks v1.74.1
1616

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
139139
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
140140
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
141141
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
142-
go.miloapis.com/milo v0.14.3-0.20260105133739-4ac940dbe3e2 h1:RtvsxMFHIJ9QCL+PuYBbXeX48s/T1PqPr8vl9wSUr5Q=
143-
go.miloapis.com/milo v0.14.3-0.20260105133739-4ac940dbe3e2/go.mod h1:xOFYvUsvSZV3z6eow5YdB5C/qRQf2s/5/arcfJs5XPg=
142+
go.miloapis.com/milo v0.16.2 h1:MqrBQvTYWIWBlniJXqBe3ycO/sZxgkL2tYems4s1+LY=
143+
go.miloapis.com/milo v0.16.2/go.mod h1:xOFYvUsvSZV3z6eow5YdB5C/qRQf2s/5/arcfJs5XPg=
144144
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
145145
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
146146
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU=

internal/controller/contactgroupmembership_controller.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ func (r *ContactGroupMembershipController) Reconcile(ctx context.Context, req ct
167167
}
168168

169169
oldStatus := contactGroupMembership.Status.DeepCopy()
170-
existingCond := meta.FindStatusCondition(contactGroupMembership.Status.Conditions, notificationmiloapiscomv1alpha1.ContactGroupMembershipReadyCondition)
170+
readyCond := meta.FindStatusCondition(contactGroupMembership.Status.Conditions, ResendContactGroupMembershipReadyCondition)
171171
updatedCond := meta.FindStatusCondition(contactGroupMembership.Status.Conditions, notificationmiloapiscomv1alpha1.ContactGroupMembershipUpdatedCondition)
172172

173173
switch {
174-
case existingCond == nil:
174+
case readyCond == nil:
175175
log.Info("ContactGroupMembership first creation")
176176
// First creation – condition not present yet
177177
// Create ContactGroupMembership on email provider
@@ -190,6 +190,13 @@ func (r *ContactGroupMembershipController) Reconcile(ctx context.Context, req ct
190190
ObservedGeneration: contactGroupMembership.GetGeneration(),
191191
})
192192

193+
contactGroupMembership.Status.Providers = []notificationmiloapiscomv1alpha1.ContactProviderStatus{
194+
{
195+
Name: "Resend",
196+
ID: emailProviderContactGroupMembership.ContactGroupMembershipID,
197+
},
198+
}
199+
193200
// Update requested – Updated condition is False with the specific reason
194201
case updatedCond != nil && updatedCond.Status == metav1.ConditionFalse && updatedCond.Reason == notificationmiloapiscomv1alpha1.ContactGroupMembershipUpdateRequestedReason:
195202
log.Info("ContactGroupMembership update requested")

0 commit comments

Comments
 (0)