tczekajlo / kube-consul-register

a tool to register Kubernetes PODs as Consul Services
Apache License 2.0
105 stars 50 forks source link

Disabled services don't get de-registered #16

Closed aleerizw-zz closed 6 years ago

aleerizw-zz commented 6 years ago

Creating a service and annotating it with consul.register/enabled=true registers the service. If the annotation is later removed the event shows up in the logs correctly:

controller.go:567] Service nginx in utility namespace is disabled by annotation. Value: false

But the service is not de-registered at all. Even if the service is deleted from kube it's status is not synced. The correct behavior should be to delete the service from consul if the annotation is disabled.

@tczekajlo I can try to fix the issue if you agree.

tczekajlo commented 6 years ago

@aleerizw Go ahead. Feel free to fix the issue :)

aleerizw-zz commented 6 years ago

@tczekajlo Can you please review: https://github.com/tczekajlo/kube-consul-register/pull/18