Skip to content

Commit

Permalink
remove finalizer on deletion for hard ignored entry
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeindel committed Dec 12, 2024
1 parent 078d369 commit d5409d9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pkg/dns/provider/state_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,18 @@ func (this *state) HandleUpdateEntry(logger logger.LogContext, op string, object
}

if ignored, annotation := ignoredByAnnotation(object); ignored {
_, err := object.ModifyStatus(func(data resources.ObjectData) (bool, error) {
status := &data.(*api.DNSEntry).Status
mod := utils.ModificationState{}
mod.AssureStringValue(&status.State, api.STATE_IGNORED)
mod.AssureStringPtrPtr(&status.Message, ptr.To(fmt.Sprintf("entry is ignored as annotated with %s", annotation)))
return mod.IsModified(), nil
})
var err error
if !object.IsDeleting() {
_, err = object.ModifyStatus(func(data resources.ObjectData) (bool, error) {
status := &data.(*api.DNSEntry).Status
mod := utils.ModificationState{}
mod.AssureStringValue(&status.State, api.STATE_IGNORED)
mod.AssureStringPtrPtr(&status.Message, ptr.To(fmt.Sprintf("entry is ignored as annotated with %s", annotation)))
return mod.IsModified(), nil
})
} else {
err = this.RemoveFinalizer(object)
}
if err != nil {
return reconcile.Delay(logger, err)
}
Expand Down

0 comments on commit d5409d9

Please sign in to comment.