Skip to content

Commit 5c3f9a4

Browse files
committed
Enhance documentation for ClientSet and ResourceClient classes
1 parent 56f63e5 commit 5c3f9a4

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
namespace k8s.ClientSets;
2-
3-
public partial class ClientSet
1+
namespace k8s.ClientSets
42
{
3+
/// <summary>
4+
/// Represents a base class for clients that interact with Kubernetes resources.
5+
/// Provides shared functionality for derived resource-specific clients.
6+
/// </summary>
7+
public partial class ClientSet
8+
{
9+
}
510
}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
namespace k8s.ClientSets;
2-
3-
public abstract class ResourceClient
1+
namespace k8s.ClientSets
42
{
5-
protected Kubernetes Client { get; }
6-
public ResourceClient(Kubernetes kubernetes)
3+
/// <summary>
4+
/// Represents a set of Kubernetes clients for interacting with the Kubernetes API.
5+
/// This class provides access to various client implementations for managing Kubernetes resources.
6+
/// </summary>
7+
public abstract class ResourceClient
78
{
8-
Client = kubernetes;
9+
protected Kubernetes Client { get; }
10+
11+
public ResourceClient(Kubernetes kubernetes)
12+
{
13+
Client = kubernetes;
14+
}
915
}
1016
}

tests/E2E.Tests/MinikubeTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ await genericPods.CreateNamespacedAsync(
589589
public async Task ClientSetTest()
590590
{
591591
var namespaceParameter = "default";
592-
var podName = "k8scsharp-e2e-clinetset-pod";
592+
var podName = "k8scsharp-e2e-clientset-pod";
593593

594594
using var kubernetes = CreateClient();
595595

@@ -639,7 +639,7 @@ await clientSet.CoreV1.Pods.PostAsync(
639639
var pod = await clientSet.CoreV1.Pods.GetAsync(podName, namespaceParameter).ConfigureAwait(false);
640640
var old = JsonSerializer.SerializeToDocument(pod);
641641

642-
var newLabels = new Dictionary<string, string>(pod.Metadata.Labels) { ["test"] = "clinetset-test-jsonpatch" };
642+
var newLabels = new Dictionary<string, string>(pod.Metadata.Labels) { ["test"] = "clientset-test-jsonpatch" };
643643
pod.Metadata.Labels = newLabels;
644644

645645
var expected = JsonSerializer.SerializeToDocument(pod);
@@ -649,7 +649,7 @@ await clientSet.CoreV1.Pods
649649
.PatchAsync(new V1Patch(patch, V1Patch.PatchType.JsonPatch), podName, namespaceParameter)
650650
.ConfigureAwait(false);
651651
var pods = await clientSet.CoreV1.Pods.ListAsync(namespaceParameter).ConfigureAwait(false);
652-
Assert.Contains(pods.Items, p => p.Labels().Contains(new KeyValuePair<string, string>("test", "clinetset-test-jsonpatch")));
652+
Assert.Contains(pods.Items, p => p.Labels().Contains(new KeyValuePair<string, string>("test", "clientset-test-jsonpatch")));
653653
}
654654

655655
// replace + get

0 commit comments

Comments
 (0)