Currently, the order in which k8s_api is registered is important in relation to other plugins. However, that order is not predictable, since CoreDNS iterates through a map to load them.
Two possible fixes:
- Change CoreDNS to initialize the plugins in order (the order established in
plugin.cfg). This is a simple and harmless fix, but it has been proposed and rejected before in CoreDNS.
- Change
k8s_api to defer looking for plugins that implement APIWatcher until after all plugins are registered (OnStartup). This makes the code a bit tougher to follow, and requires that k8s_api actually sit in the plugin packet serving path even though it has no functional need to process packets. But this doesn't require any change to CoreDNS.
Currently, the order in which
k8s_apiis registered is important in relation to other plugins. However, that order is not predictable, since CoreDNS iterates through a map to load them.Two possible fixes:
plugin.cfg). This is a simple and harmless fix, but it has been proposed and rejected before in CoreDNS.k8s_apito defer looking for plugins that implementAPIWatcheruntil after all plugins are registered (OnStartup). This makes the code a bit tougher to follow, and requires thatk8s_apiactually sit in the plugin packet serving path even though it has no functional need to process packets. But this doesn't require any change to CoreDNS.