Skip to content

Event emission doesn't work with webhook provider #6359

@tommasopozzetti

Description

@tommasopozzetti

What happened: Events are not getting emitted on external-dns when using a webhook provider with the following debug statement

{"level":"debug","msg":"skipping event for resources as the name is not generated yet"}

What you expected to happen: Events are correctly emitted for the supported sources

How to reproduce it (as minimally and precisely as possible):

  • install external-dns v0.21.0 with flags --events-emit=RecordReady --events-emit=RecordDeleted --events-emit=RecordError and using a webhook provider
  • observe that events are not emitted for supported sources like services even if they are deleted and recreated and the corresponding DNS entries correctly deleted and recreated

Anything else we need to know?:

I believe that the issue lies in the serialization and deserialization of the Endpoint object when using the webhook provider. The event emission logic uses refObject in the Endpoint to emit the event correctly, however that field is dropped during serialization to the webhook and back https://github.com/kubernetes-sigs/external-dns/blob/v0.21.0/endpoint/endpoint.go#L271, leaving that field to being null after deserializing the response from the webhook and calling the event emission logic.

Environment: Kubernetes 1.33

  • External-DNS version (use external-dns --version): 0.21.0
  • DNS provider: custom

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions