Skip to content

Commit 95ec197

Browse files
authored
fix(Kubernetes Client): Re-Export the original API Client (#516)
see #515
1 parent ec5f44d commit 95ec197

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/KubeOps.KubernetesClient/IKubernetesClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ namespace KubeOps.KubernetesClient;
99
/// </summary>
1010
public interface IKubernetesClient
1111
{
12+
/// <summary>
13+
/// Represents the "original" kubernetes client from the
14+
/// "KubernetesClient" package.
15+
/// </summary>
16+
IKubernetes ApiClient { get; }
17+
1218
/// <summary>
1319
/// Return the base URI of the currently used KubernetesClient.
1420
/// </summary>

src/KubeOps.KubernetesClient/KubernetesClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ public KubernetesClient(KubernetesClientConfiguration clientConfig, IKubernetes
3131
_client = client;
3232
}
3333

34+
/// <inheritdoc />
35+
public IKubernetes ApiClient => _client;
36+
37+
/// <inheritdoc />
3438
public Uri BaseUri => _client.BaseUri;
3539

3640
/// <inheritdoc />

src/KubeOps.Testing/MockKubernetesClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ namespace KubeOps.Testing;
1616
Justification = "This is the mock implementation which basically does nothing.")]
1717
public class MockKubernetesClient : IKubernetesClient
1818
{
19+
/// <summary>
20+
/// Instance of the default client.
21+
/// </summary>
22+
public IKubernetes ApiClient { get; } = new Kubernetes(KubernetesClientConfiguration.BuildDefaultConfig());
23+
1924
/// <summary>
2025
/// Mocked result for the <see cref="Get{TEntity}"/> call.
2126
/// If null, then null is returned.

0 commit comments

Comments
 (0)