99
1010namespace KubeOps . Cli . Generators ;
1111
12- internal class DeploymentGenerator ( OutputFormat format ) : IConfigGenerator
12+ internal sealed class DeploymentGenerator ( OutputFormat format ) : IConfigGenerator
1313{
1414 public void Generate ( ResultOutput output )
1515 {
16- var deployment = new V1Deployment ( metadata : new V1ObjectMeta (
17- labels : new Dictionary < string , string > { { "operator-deployment" , "kubernetes-operator" } } ,
18- name : "operator" ) ) . Initialize ( ) ;
19- deployment . Spec = new V1DeploymentSpec
16+ var deployment = new V1Deployment
17+ {
18+ Metadata = new ( )
19+ {
20+ Name = "operator" ,
21+ Labels = new Dictionary < string , string > { { "operator-deployment" , "kubernetes-operator" } } ,
22+ } ,
23+ } . Initialize ( ) ;
24+ deployment . Spec = new ( )
2025 {
2126 Replicas = 1 ,
2227 RevisionHistoryLimit = 0 ,
23- Selector = new V1LabelSelector (
24- matchLabels : new Dictionary < string , string > { { "operator-deployment" , "kubernetes-operator" } } ) ,
25- Template = new V1PodTemplateSpec
28+ Selector = new ( )
2629 {
27- Metadata = new V1ObjectMeta (
28- labels : new Dictionary < string , string > { { "operator-deployment" , "kubernetes-operator" } } ) ,
29- Spec = new V1PodSpec
30+ MatchLabels = new Dictionary < string , string > { { "operator-deployment" , "kubernetes-operator" } } ,
31+ } ,
32+ Template = new ( )
33+ {
34+ Metadata = new ( )
35+ {
36+ Labels = new Dictionary < string , string > { { "operator-deployment" , "kubernetes-operator" } } ,
37+ } ,
38+ Spec = new ( )
3039 {
3140 TerminationGracePeriodSeconds = 10 ,
3241 Containers = new List < V1Container >
@@ -41,26 +50,26 @@ public void Generate(ResultOutput output)
4150 {
4251 Name = "POD_NAMESPACE" ,
4352 ValueFrom =
44- new V1EnvVarSource
53+ new ( )
4554 {
46- FieldRef = new V1ObjectFieldSelector
55+ FieldRef = new ( )
4756 {
4857 FieldPath = "metadata.namespace" ,
4958 } ,
5059 } ,
5160 } ,
5261 } ,
53- Resources = new V1ResourceRequirements
62+ Resources = new ( )
5463 {
5564 Requests = new Dictionary < string , ResourceQuantity >
5665 {
57- { "cpu" , new ResourceQuantity ( "100m" ) } ,
58- { "memory" , new ResourceQuantity ( "64Mi" ) } ,
66+ { "cpu" , new ( "100m" ) } ,
67+ { "memory" , new ( "64Mi" ) } ,
5968 } ,
6069 Limits = new Dictionary < string , ResourceQuantity >
6170 {
62- { "cpu" , new ResourceQuantity ( "100m" ) } ,
63- { "memory" , new ResourceQuantity ( "128Mi" ) } ,
71+ { "cpu" , new ( "100m" ) } ,
72+ { "memory" , new ( "128Mi" ) } ,
6473 } ,
6574 } ,
6675 } ,
0 commit comments