tintoy / dotnet-kube-client

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

Unable to add more than one config map #96

Open ugumba opened 5 years ago

ugumba commented 5 years ago

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).

tintoy commented 5 years ago

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).

ugumba commented 5 years ago

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.

tintoy commented 5 years ago

This is with the code I just committed?

tintoy commented 5 years ago

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

ugumba commented 5 years ago

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

tintoy commented 5 years ago

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

tintoy commented 5 years ago

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?

ugumba commented 5 years ago

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.)

tintoy commented 5 years ago

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