From c9469f21258e71b314704d583ccc696e99150870 Mon Sep 17 00:00:00 2001 From: Eddie Date: Fri, 19 Apr 2024 03:31:31 -0400 Subject: [PATCH] feat(kubernetes client): expose original Kubernetes API Client (#749) --- src/KubeOps.KubernetesClient/IKubernetesClient.cs | 6 ++++++ src/KubeOps.KubernetesClient/KubernetesClient.cs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/KubeOps.KubernetesClient/IKubernetesClient.cs b/src/KubeOps.KubernetesClient/IKubernetesClient.cs index 24400d4b..93c9680f 100644 --- a/src/KubeOps.KubernetesClient/IKubernetesClient.cs +++ b/src/KubeOps.KubernetesClient/IKubernetesClient.cs @@ -13,6 +13,12 @@ namespace KubeOps.KubernetesClient; /// public interface IKubernetesClient : IDisposable { + /// + /// Represents the "original" kubernetes client from the + /// "KubernetesClient" package. + /// + IKubernetes ApiClient { get; } + /// /// Return the base URI of the currently used KubernetesClient. /// diff --git a/src/KubeOps.KubernetesClient/KubernetesClient.cs b/src/KubeOps.KubernetesClient/KubernetesClient.cs index 18ddf946..ce8c3880 100644 --- a/src/KubeOps.KubernetesClient/KubernetesClient.cs +++ b/src/KubeOps.KubernetesClient/KubernetesClient.cs @@ -56,6 +56,9 @@ public KubernetesClient(KubernetesClientConfiguration clientConfig, IKubernetes _client = client; } + /// + public IKubernetes ApiClient => _client; + /// public Uri BaseUri => _client.BaseUri; @@ -324,6 +327,7 @@ public async Task DeleteAsync( case not null: await client.DeleteNamespacedAsync(@namespace, name, cancellationToken); break; + default: await client.DeleteAsync(name, cancellationToken); break;