Skip to content

Commit ff20e45

Browse files
authored
fix: IKubernetesClient.Get<> not retrieving namespaced resources due to parameter swap (#511)
While using the latest version of KubeOps,KubernetesClient, I've noticed that retrieval of kubernetes resources (ConfigMaps and a Deployment) was not working when passing a namespace. After further investigation, I've noticed that the underlying `GenericClient<>.ReadNamespacedAsync()` function had swapped parameters which was causing retrieval of resources to fail.
1 parent f52f00c commit ff20e45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/KubeOps.KubernetesClient/KubernetesClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public Task<string> GetCurrentNamespace(string downwardApiEnvName = "POD_NAMESPA
7272

7373
return await (string.IsNullOrWhiteSpace(@namespace)
7474
? client.ReadAsync<TResource>(name)
75-
: client.ReadNamespacedAsync<TResource>(name, @namespace));
75+
: client.ReadNamespacedAsync<TResource>(@namespace, name));
7676
}
7777
catch (HttpOperationException e) when (e.Response.StatusCode == HttpStatusCode.NotFound)
7878
{

0 commit comments

Comments
 (0)