diff --git a/Directory.Build.targets b/Directory.Build.targets
index 0c7844991..b9fbd9494 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -8,4 +8,8 @@
All
+
+
+
+
diff --git a/examples/attach/Attach.cs b/examples/attach/Attach.cs
index e37e211b6..dafefe3d4 100755
--- a/examples/attach/Attach.cs
+++ b/examples/attach/Attach.cs
@@ -23,7 +23,9 @@ private static async Task Main(string[] args)
private async static Task AttachToPod(IKubernetes client, V1Pod pod)
{
- var webSocket = await client.WebSocketNamespacedPodAttachAsync(pod.Metadata.Name, "default", pod.Spec.Containers[0].Name);
+ var webSocket =
+ await client.WebSocketNamespacedPodAttachAsync(pod.Metadata.Name, "default",
+ pod.Spec.Containers[0].Name);
var demux = new StreamDemuxer(webSocket);
demux.Start();
diff --git a/examples/exec/Exec.cs b/examples/exec/Exec.cs
index 66e490454..b0355892d 100755
--- a/examples/exec/Exec.cs
+++ b/examples/exec/Exec.cs
@@ -20,7 +20,9 @@ private static async Task Main(string[] args)
private async static Task ExecInPod(IKubernetes client, V1Pod pod)
{
- var webSocket = await client.WebSocketNamespacedPodExecAsync(pod.Metadata.Name, "default", "ls", pod.Spec.Containers[0].Name);
+ var webSocket =
+ await client.WebSocketNamespacedPodExecAsync(pod.Metadata.Name, "default", "ls",
+ pod.Spec.Containers[0].Name);
var demux = new StreamDemuxer(webSocket);
demux.Start();
diff --git a/examples/httpClientFactory/PodListHostedService.cs b/examples/httpClientFactory/PodListHostedService.cs
index 3b2c94214..66f61e8bd 100644
--- a/examples/httpClientFactory/PodListHostedService.cs
+++ b/examples/httpClientFactory/PodListHostedService.cs
@@ -28,6 +28,7 @@ public async Task StartAsync(CancellationToken cancellationToken)
{
_logger.LogInformation(item.Metadata.Name);
}
+
if (list.Items.Count == 0)
{
_logger.LogInformation("Empty!");
diff --git a/examples/httpClientFactory/Program.cs b/examples/httpClientFactory/Program.cs
index db34e6bac..48477f808 100644
--- a/examples/httpClientFactory/Program.cs
+++ b/examples/httpClientFactory/Program.cs
@@ -12,10 +12,7 @@ public static async Task Main(string[] args)
{
// Learn more about generic hosts at https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host
using (var host = new HostBuilder()
- .ConfigureLogging((logging) =>
- {
- logging.AddConsole();
- })
+ .ConfigureLogging((logging) => { logging.AddConsole(); })
.ConfigureServices((hostBuilderContext, services) =>
{
// Ideally this config would be read from the .net core config constructs,
diff --git a/examples/labels/PodList.cs b/examples/labels/PodList.cs
index 3fbc89997..89d701ff0 100755
--- a/examples/labels/PodList.cs
+++ b/examples/labels/PodList.cs
@@ -21,11 +21,13 @@ private static void Main(string[] args)
{
continue;
}
+
var labels = new List();
foreach (var key in item.Spec.Selector)
{
labels.Add(key.Key + "=" + key.Value);
}
+
var labelStr = string.Join(",", labels.ToArray());
Console.WriteLine(labelStr);
var podList = client.ListNamespacedPod("default", labelSelector: labelStr);
@@ -33,10 +35,12 @@ private static void Main(string[] args)
{
Console.WriteLine(pod.Metadata.Name);
}
+
if (podList.Items.Count == 0)
{
Console.WriteLine("Empty!");
}
+
Console.WriteLine();
}
}
diff --git a/examples/logs/Logs.cs b/examples/logs/Logs.cs
index c8f5a22c6..d21dbb734 100755
--- a/examples/logs/Logs.cs
+++ b/examples/logs/Logs.cs
@@ -19,9 +19,11 @@ private static async Task Main(string[] args)
Console.WriteLine("No pods!");
return;
}
+
var pod = list.Items[0];
- var response = await client.ReadNamespacedPodLogWithHttpMessagesAsync(pod.Metadata.Name, pod.Metadata.NamespaceProperty, follow: true);
+ var response = await client.ReadNamespacedPodLogWithHttpMessagesAsync(pod.Metadata.Name,
+ pod.Metadata.NamespaceProperty, follow: true);
var stream = response.Body;
stream.CopyTo(Console.OpenStandardOutput());
}
diff --git a/examples/namespace/Namespace.cs b/examples/namespace/Namespace.cs
index c5094180a..a7db12e2c 100644
--- a/examples/namespace/Namespace.cs
+++ b/examples/namespace/Namespace.cs
@@ -15,6 +15,7 @@ static void ListNamespaces(IKubernetes client)
{
Console.WriteLine(item.Metadata.Name);
}
+
if (list.Items.Count == 0)
{
Console.WriteLine("Empty!");
@@ -41,6 +42,7 @@ static async Task DeleteAsync(IKubernetes client, string name, int delayMillis)
{
return;
}
+
throw ex;
}
}
@@ -51,6 +53,7 @@ static async Task DeleteAsync(IKubernetes client, string name, int delayMillis)
{
return;
}
+
throw ex;
}
}
@@ -68,13 +71,7 @@ private static void Main(string[] args)
ListNamespaces(client);
- var ns = new V1Namespace
- {
- Metadata = new V1ObjectMeta
- {
- Name = "test"
- }
- };
+ var ns = new V1Namespace { Metadata = new V1ObjectMeta { Name = "test" } };
var result = client.CreateNamespace(ns);
Console.WriteLine(result);
diff --git a/examples/patch/Program.cs b/examples/patch/Program.cs
index 5a80cd2e0..2298538cc 100644
--- a/examples/patch/Program.cs
+++ b/examples/patch/Program.cs
@@ -20,10 +20,7 @@ private static void Main(string[] args)
var name = pod.Metadata.Name;
PrintLabels(pod);
- var newlabels = new Dictionary(pod.Metadata.Labels)
- {
- ["test"] = "test"
- };
+ var newlabels = new Dictionary(pod.Metadata.Labels) { ["test"] = "test" };
var patch = new JsonPatchDocument();
patch.Replace(e => e.Metadata.Labels, newlabels);
client.PatchNamespacedPod(new V1Patch(patch), name, "default");
@@ -38,6 +35,7 @@ private static void PrintLabels(V1Pod pod)
{
Console.WriteLine($"{k} : {v}");
}
+
Console.WriteLine("=-=-=-=-=-=-=-=-=-=-=");
}
}
diff --git a/examples/simple/PodList.cs b/examples/simple/PodList.cs
index 557c0b778..54f36e91d 100755
--- a/examples/simple/PodList.cs
+++ b/examples/simple/PodList.cs
@@ -16,6 +16,7 @@ private static void Main(string[] args)
{
Console.WriteLine(item.Metadata.Name);
}
+
if (list.Items.Count == 0)
{
Console.WriteLine("Empty!");
diff --git a/gen/KubernetesWatchGenerator/Program.cs b/gen/KubernetesWatchGenerator/Program.cs
index 18b8f5acb..ac7114792 100644
--- a/gen/KubernetesWatchGenerator/Program.cs
+++ b/gen/KubernetesWatchGenerator/Program.cs
@@ -49,10 +49,16 @@ static async Task Main(string[] args)
swagger = await SwaggerDocument.FromFileAsync(Path.Combine(args[1], "swagger.json.unprocessed"));
_schemaToNameMap = swagger.Definitions.ToDictionary(x => x.Value, x => x.Key);
_schemaDefinitionsInMultipleGroups = _schemaToNameMap.Values.Select(x =>
- {
- var parts = x.Split(".");
- return new { FullName = x, Name = parts[parts.Length - 1], Version = parts[parts.Length - 2], Group = parts[parts.Length - 3] };
- })
+ {
+ var parts = x.Split(".");
+ return new
+ {
+ FullName = x,
+ Name = parts[parts.Length - 1],
+ Version = parts[parts.Length - 2],
+ Group = parts[parts.Length - 3],
+ };
+ })
.GroupBy(x => new { x.Name, x.Version })
.Where(x => x.Count() > 1)
.SelectMany(x => x)
@@ -61,7 +67,15 @@ static async Task Main(string[] args)
_classNameToPluralMap = swagger.Operations
.Where(x => x.Operation.OperationId.StartsWith("list"))
- .Select(x => { return new { PluralName = x.Path.Split("/").Last(), ClassName = GetClassNameForSchemaDefinition(x.Operation.Responses["200"].ActualResponseSchema) }; })
+ .Select(x =>
+ {
+ return new
+ {
+ PluralName = x.Path.Split("/").Last(),
+ ClassName = GetClassNameForSchemaDefinition(x.Operation.Responses["200"]
+ .ActualResponseSchema),
+ };
+ })
.Distinct()
.ToDictionary(x => x.ClassName, x => x.PluralName);
@@ -75,7 +89,6 @@ static async Task Main(string[] args)
.ToDictionary(x => x.Key, x => x.Value);
-
// Register helpers used in the templating.
Helpers.Register(nameof(ToXmlDoc), ToXmlDoc);
Helpers.Register(nameof(GetClassName), GetClassName);
@@ -92,30 +105,27 @@ static async Task Main(string[] args)
// Generate the Watcher operations
// We skip operations where the name of the class in the C# client could not be determined correctly.
// That's usually because there are different version of the same object (e.g. for deployments).
- var blacklistedOperations = new HashSet()
- {
- };
+ var blacklistedOperations = new HashSet() { };
var watchOperations = swagger.Operations.Where(
o => o.Path.Contains("/watch/")
- && o.Operation.ActualParameters.Any(p => p.Name == "name")
- && !blacklistedOperations.Contains(o.Operation.OperationId)).ToArray();
+ && o.Operation.ActualParameters.Any(p => p.Name == "name")
+ && !blacklistedOperations.Contains(o.Operation.OperationId)).ToArray();
// Render.
- Render.FileToFile("IKubernetes.Watch.cs.template", watchOperations, Path.Combine(outputDirectory, "IKubernetes.Watch.cs"));
- Render.FileToFile("Kubernetes.Watch.cs.template", watchOperations, Path.Combine(outputDirectory, "Kubernetes.Watch.cs"));
+ Render.FileToFile("IKubernetes.Watch.cs.template", watchOperations,
+ Path.Combine(outputDirectory, "IKubernetes.Watch.cs"));
+ Render.FileToFile("Kubernetes.Watch.cs.template", watchOperations,
+ Path.Combine(outputDirectory, "Kubernetes.Watch.cs"));
// Generate the interface declarations
- var skippedTypes = new HashSet()
- {
- "V1WatchEvent",
- };
+ var skippedTypes = new HashSet() { "V1WatchEvent", };
var definitions = swagger.Definitions.Values
.Where(
d => d.ExtensionData != null
- && d.ExtensionData.ContainsKey("x-kubernetes-group-version-kind")
- && !skippedTypes.Contains(GetClassName(d)));
+ && d.ExtensionData.ContainsKey("x-kubernetes-group-version-kind")
+ && !skippedTypes.Contains(GetClassName(d)));
var modelsDir = Path.Combine(outputDirectory, "Models");
_classesWithValidation = Directory.EnumerateFiles(modelsDir)
@@ -124,10 +134,12 @@ static async Task Main(string[] args)
.Select(x => x.Class)
.ToHashSet();
- Render.FileToFile("ModelExtensions.cs.template", definitions, Path.Combine(outputDirectory, "ModelExtensions.cs"));
+ Render.FileToFile("ModelExtensions.cs.template", definitions,
+ Path.Combine(outputDirectory, "ModelExtensions.cs"));
}
- static void ToXmlDoc(RenderContext context, IList