Files
csharp/examples/simple/PodList.cs
Boshi Lian ae79be6665 Clean up warnings in examples (#1628)
* Refactor examples to streamline code structure and improve readability

* Update LangVersion to 13.0 for improved compatibility
2025-04-29 16:55:55 -07:00

18 lines
377 B
C#
Executable File

using k8s;
using System;
var config = KubernetesClientConfiguration.BuildDefaultConfig();
IKubernetes client = new Kubernetes(config);
Console.WriteLine("Starting Request!");
var list = client.CoreV1.ListNamespacedPod("default");
foreach (var item in list.Items)
{
Console.WriteLine(item.Metadata.Name);
}
if (list.Items.Count == 0)
{
Console.WriteLine("Empty!");
}