dotnet-kube-client icon indicating copy to clipboard operation
dotnet-kube-client copied to clipboard

Unable to add more than one config map

Open ugumba opened this issue 5 years ago • 9 comments

builder .AddKubeConfigMap(client, "config") .AddKubeConfigMap(client, "jaeger") ;

This results in the following trace - i.e. only the last ConfigMap is read, and it is read twice. (It doesn't exist in this test, but that's besides the point :-))

trce: KubeClient.Extensions.Configuration.ConfigMapConfigurationProvider[0] Attempting to load ConfigMap jaeger in namespace f... dbug: KubeClient.KubeApiClient.Http[100] Performing GET request to 'https://10.96.0.1/api/v1/namespaces/f/configmaps/jaeger'. dbug: KubeClient.KubeApiClient.Http[110] Completed GET request to 'https://10.96.0.1/api/v1/namespaces/f/configmaps/jaeger' (NotFound). trce: KubeClient.Extensions.Configuration.ConfigMapConfigurationProvider[0] ConfigMap jaeger was not found in namespace f (isReload: False). trce: KubeClient.Extensions.Configuration.ConfigMapConfigurationProvider[0] Attempting to load ConfigMap jaeger in namespace f... dbug: KubeClient.KubeApiClient.Http[100] Performing GET request to 'https://10.96.0.1/api/v1/namespaces/f/configmaps/jaeger'. dbug: KubeClient.KubeApiClient.Http[110] Completed GET request to 'https://10.96.0.1/api/v1/namespaces/f/configmaps/jaeger' (NotFound). trce: KubeClient.Extensions.Configuration.ConfigMapConfigurationProvider[0] ConfigMap jaeger was not found in namespace f (isReload: False).

ugumba avatar Sep 19 '19 22:09 ugumba

Yeah - I can see why that doesn’t work (to be honest I’ve never tried using more than one ConfigMap to source configuration from) but it’s a valid use case. I should be able to add support for multiple over the weekend (it’s because there’s only a single set of properties in the dictionary of provider settings and I was too lazy to create a class to model those settings - I’ll switch to storing a list of objects representing the provider settings).

tintoy avatar Sep 19 '19 23:09 tintoy

Thanks for the quick update - just wanted to let you know that it doesn't seem to fix my problem. I'm still seeing the last configmap being read twice in KubeClient's debug log - effectively ignoring the first one.

ugumba avatar Sep 23 '19 22:09 ugumba

This is with the code I just committed?

tintoy avatar Sep 23 '19 22:09 tintoy

(https://github.com/tintoy/dotnet-kube-client/commit/8da722708fc44449cae1a7848a8b31fdc9a5c18a ?)

tintoy avatar Sep 23 '19 22:09 tintoy

Sorry - I naively assumed this commit was present in 2.3.2.

ugumba avatar Sep 24 '19 05:09 ugumba

No problem - will get you a build you can try out :)

tintoy avatar Sep 24 '19 06:09 tintoy

There's a development package feed at https://www.myget.org/F/dotnet-kube-client/api/v3/index.json - are you able to try installing version 2.4.0-multiple-configm0012 of the KubeClient packages and see if it works for you?

tintoy avatar Sep 24 '19 11:09 tintoy

Tested it locally now, and both configmaps are now loaded and provide configuration. Thanks!
(Will also need #101 resolved, so don't rush releasing this fix for me. Using a workaround in the meantime.)

ugumba avatar Sep 24 '19 11:09 ugumba

Thanks for testing so quickly! I'll look into #101 sometime tomorrow (it's 10pm here and I have an early start).

tintoy avatar Sep 24 '19 11:09 tintoy