@@ -47,39 +47,35 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
47
47
_serializer . Serialize (
48
48
new KustomizationConfig
49
49
{
50
- Resources = new List < string >
51
- {
52
- $ "deployment.{ Format . ToString ( ) . ToLower ( ) } ",
53
- } ,
54
- CommonLabels = new Dictionary < string , string >
55
- {
56
- { "operator-element" , "operator-instance" } ,
57
- } ,
50
+ Resources = new List < string > { $ "deployment.{ Format . ToString ( ) . ToLower ( ) } ", } ,
51
+ CommonLabels = new Dictionary < string , string > { { "operator-element" , "operator-instance" } , } ,
58
52
ConfigMapGenerator = _hasWebhooks
59
53
? new List < KustomizationConfigMapGenerator >
60
54
{
55
+ new ( ) { Name = "webhook-ca" , Files = new List < string > { "ca.pem" , "ca-key.pem" , } , } ,
61
56
new ( )
62
57
{
63
- Name = "webhook-ca " ,
64
- Files = new List < string >
58
+ Name = "webhook-config " ,
59
+ Literals = new List < string >
65
60
{
66
- "ca.pem" ,
67
- "ca-key.pem" ,
61
+ $ "KESTREL__ENDPOINTS__HTTP__URL=http://0.0.0.0:{ _settings . HttpPort } ",
62
+ $ "KESTREL__ENDPOINTS__HTTPS__URL=https://0.0.0.0:{ _settings . HttpsPort } ",
63
+ "KESTREL__ENDPOINTS__HTTPS__CERTIFICATE__PATH=/certs/server.pem" ,
64
+ "KESTREL__ENDPOINTS__HTTPS__CERTIFICATE__KEYPATH=/certs/server-key.pem" ,
68
65
} ,
69
66
} ,
67
+ }
68
+ : new List < KustomizationConfigMapGenerator >
69
+ {
70
70
new ( )
71
71
{
72
72
Name = "webhook-config" ,
73
73
Literals = new List < string >
74
74
{
75
- "KESTREL__ENDPOINTS__HTTP__URL=http://0.0.0.0:80" ,
76
- "KESTREL__ENDPOINTS__HTTPS__URL=https://0.0.0.0:443" ,
77
- "KESTREL__ENDPOINTS__HTTPS__CERTIFICATE__PATH=/certs/server.pem" ,
78
- "KESTREL__ENDPOINTS__HTTPS__CERTIFICATE__KEYPATH=/certs/server-key.pem" ,
75
+ $ "KESTREL__ENDPOINTS__HTTP__URL=http://0.0.0.0:{ _settings . HttpPort } ",
79
76
} ,
80
77
} ,
81
- }
82
- : null ,
78
+ } ,
83
79
} ,
84
80
Format ) ) ;
85
81
@@ -109,11 +105,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
109
105
? null
110
106
: new List < V1Volume >
111
107
{
112
- new ( )
113
- {
114
- Name = "certificates" ,
115
- EmptyDir = new ( ) ,
116
- } ,
108
+ new ( ) { Name = "certificates" , EmptyDir = new ( ) , } ,
117
109
new ( )
118
110
{
119
111
Name = "ca-certificates" ,
@@ -128,11 +120,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
128
120
{
129
121
Image = "operator" ,
130
122
Name = "webhook-installer" ,
131
- Args = new [ ]
132
- {
133
- "webhooks" ,
134
- "install" ,
135
- } ,
123
+ Args = new [ ] { "webhooks" , "install" , } ,
136
124
Env = new List < V1EnvVar >
137
125
{
138
126
new ( )
@@ -149,11 +137,7 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
149
137
} ,
150
138
VolumeMounts = new List < V1VolumeMount >
151
139
{
152
- new ( )
153
- {
154
- Name = "certificates" ,
155
- MountPath = "/certs" ,
156
- } ,
140
+ new ( ) { Name = "certificates" , MountPath = "/certs" , } ,
157
141
new ( )
158
142
{
159
143
Name = "ca-certificates" ,
@@ -183,15 +167,10 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
183
167
} ,
184
168
} ,
185
169
} ,
186
- EnvFrom = ! _hasWebhooks
187
- ? null
188
- : new List < V1EnvFromSource >
189
- {
190
- new ( )
191
- {
192
- ConfigMapRef = new ( ) { Name = "webhook-config" } ,
193
- } ,
194
- } ,
170
+ EnvFrom = new List < V1EnvFromSource >
171
+ {
172
+ new ( ) { ConfigMapRef = new ( ) { Name = "webhook-config" } } ,
173
+ } ,
195
174
VolumeMounts = ! _hasWebhooks
196
175
? null
197
176
: new List < V1VolumeMount >
@@ -203,11 +182,13 @@ public async Task<int> OnExecuteAsync(CommandLineApplication app)
203
182
ReadOnlyProperty = true ,
204
183
} ,
205
184
} ,
206
- Ports = new List < V1ContainerPort >
207
- {
208
- new ( 80 , name : "http" ) ,
209
- new ( 443 , name : "https" ) ,
210
- } ,
185
+ Ports = _hasWebhooks
186
+ ? new List < V1ContainerPort >
187
+ {
188
+ new ( _settings . HttpPort , name : "http" ) ,
189
+ new ( _settings . HttpsPort , name : "https" ) ,
190
+ }
191
+ : new List < V1ContainerPort > { new ( _settings . HttpPort , name : "http" ) , } ,
211
192
LivenessProbe = new V1Probe (
212
193
timeoutSeconds : 1 ,
213
194
initialDelaySeconds : 30 ,
0 commit comments