tintoy / dotnet-kube-client

A Kubernetes API client for .NET Standard / .NET Core
MIT License
192 stars 33 forks source link

configmap change is not fired with "reloadOnChange: true" #78

Closed smartpcr closed 5 years ago

smartpcr commented 5 years ago

in sample "ConfigFromConfigMap", change callback is never fired.

tintoy commented 5 years ago

Hi - thanks for reporting! Will take a look at this tomorrow :)

tintoy commented 5 years ago

Turns out this is due to a combination of factors. The main problem was that change tokens are single-use; once the change callback is invoked, you have to request a new token and re-register your callback.

I've updated the sample, and added logging for the config provider to improve the diagnostic experience :)

Will publish a new build shortly.

tintoy commented 5 years ago

Published v0.2.12.

tintoy commented 5 years ago

Can you try out the new version and let me know if it works for you?

tintoy commented 5 years ago

Published v0.2.13. Turns out I misunderstood how config reloads are supposed to work. I have verified that the updated config is now correct.

Note that, regardless of the config key case used when creating the ConfigMap, K8s transforms the config key names to lower-case for some reason (but the dictionary is case-insensitive so things still work correctly).

tintoy commented 5 years ago

Closing #82 (feel free to reopen if you still have this problem).