From 93c50b494869660e454503d1a1d9d091c2e623f2 Mon Sep 17 00:00:00 2001 From: stan-sz <37585349+stan-sz@users.noreply.github.com> Date: Tue, 29 Mar 2022 22:01:38 +0200 Subject: [PATCH] Reuse const strings and expose PluralName (#811) * Reuse const strings and expose PluralName Both in ModelExtensions.cs * Remove quotes --- .../templates/ModelExtensions.cs.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LibKubernetesGenerator/templates/ModelExtensions.cs.template b/src/LibKubernetesGenerator/templates/ModelExtensions.cs.template index 08f2589..af381e8 100644 --- a/src/LibKubernetesGenerator/templates/ModelExtensions.cs.template +++ b/src/LibKubernetesGenerator/templates/ModelExtensions.cs.template @@ -1,17 +1,17 @@ // // Code generated by https://github.com/kubernetes-client/csharp/tree/master/gen/KubernetesGenerator -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. // namespace k8s.Models { {{#.}} - [KubernetesEntity(Group="{{GetGroup . }}", Kind="{{GetKind . }}", ApiVersion="{{GetApiVersion . }}", PluralName={{GetPlural .}})] + [KubernetesEntity(Group=KubeGroup, Kind=KubeKind, ApiVersion=KubeApiVersion, PluralName=KubePluralName)] public partial class {{GetClassName . }} : {{GetInterfaceName . }} { public const string KubeApiVersion = "{{GetApiVersion . }}"; public const string KubeKind = "{{GetKind . }}"; public const string KubeGroup = "{{GetGroup . }}"; + public const string KubePluralName = {{GetPlural . }}; } {{/.}}