|
2 | 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
|
3 | 3 |
|
4 | 4 | {{- define "operator.operatorDeployment" }}
|
| 5 | + |
5 | 6 | ---
|
6 | 7 | {{- if not .webhookOnly }}
|
7 | 8 | apiVersion: "apps/v1"
|
|
91 | 92 | value: {{ .javaLoggingFileCount | default 10 | quote }}
|
92 | 93 | - name: "JVM_OPTIONS"
|
93 | 94 | value: {{ .jvmOptions | default "-XshowSettings:vm -XX:MaxRAMPercentage=70" | quote }}
|
| 95 | + {{- if and .operatorLogDir .operatorLogMount }} |
| 96 | + {{- if not (hasPrefix (toString .operatorLogMount) (toString .operatorLogDir)) }} |
| 97 | + {{- fail (printf "Error: Invalid Configuration: operatorLogDir %s must start with operatorlogMount %s" .operatorLogDir .operatorLogMount) }} |
| 98 | + {{- end }} |
| 99 | + - name: "OPERATOR_LOGDIR" |
| 100 | + value: {{ .operatorLogDir | quote }} |
| 101 | + {{- end }} |
94 | 102 | {{- if .remoteDebugNodePortEnabled }}
|
95 | 103 | - name: "REMOTE_DEBUG_PORT"
|
96 | 104 | value: {{ .internalDebugHttpPort | quote }}
|
@@ -133,10 +141,16 @@ spec:
|
133 | 141 | - name: "weblogic-operator-secrets-volume"
|
134 | 142 | mountPath: "/deployment/secrets"
|
135 | 143 | readOnly: true
|
136 |
| - {{- if .elkIntegrationEnabled }} |
| 144 | + {{- if and .elkIntegrationEnabled .operatorLogPVC }} |
| 145 | + {{- fail "Error: elkIntegrationEnabled and opeatorLogPVC cannot be set at the same time."}} |
| 146 | + {{- else if .elkIntegrationEnabled }} |
137 | 147 | - mountPath: "/logs"
|
138 | 148 | name: "log-dir"
|
139 | 149 | readOnly: false
|
| 150 | + {{- else if .operatorLogPVC }} |
| 151 | + - mountPath: {{ .operatorLogMount | quote }} |
| 152 | + name: "log-dir" |
| 153 | + readOnly: false |
140 | 154 | {{- end }}
|
141 | 155 | {{- if not .remoteDebugNodePortEnabled }}
|
142 | 156 | livenessProbe:
|
@@ -207,6 +221,13 @@ spec:
|
207 | 221 | secret:
|
208 | 222 | secretName: "logstash-certs-secret"
|
209 | 223 | optional: true
|
| 224 | + {{- else if .operatorLogPVC }} |
| 225 | + {{- if not (and .operatorLogMount .operatorLogDir) }} |
| 226 | + {{- fail "Must provide operatorLogMount and operatorLogDir when using operatorLogPVC" }} |
| 227 | + {{- end }} |
| 228 | + - name: "log-dir" |
| 229 | + persistentVolumeClaim: |
| 230 | + claimName: {{ .operatorLogPVC }} |
210 | 231 | {{- end }}
|
211 | 232 | {{- end }}
|
212 | 233 | ---
|
@@ -318,6 +339,13 @@ spec:
|
318 | 339 | value: {{ int64 .javaLoggingFileSizeLimit | default 20000000 | quote }}
|
319 | 340 | - name: "JAVA_LOGGING_COUNT"
|
320 | 341 | value: {{ .javaLoggingFileCount | default 10 | quote }}
|
| 342 | + {{- if and .operatorLogDir .operatorLogMount }} |
| 343 | + {{- if not (hasPrefix (toString .operatorLogMount) (toString .operatorLogDir)) }} |
| 344 | + {{- fail (printf "Error: Invalid Configuration: operatorLogDir %s must start with operatorlogMount %s" .operatorLogDir .operatorLogMount) }} |
| 345 | + {{- end }} |
| 346 | + - name: "OPERATOR_LOGDIR" |
| 347 | + value: {{ .operatorLogDir | quote }} |
| 348 | + {{- end }} |
321 | 349 | {{- if .remoteDebugNodePortEnabled }}
|
322 | 350 | - name: "REMOTE_DEBUG_PORT"
|
323 | 351 | value: {{ .webhookDebugHttpPort | quote }}
|
@@ -354,10 +382,16 @@ spec:
|
354 | 382 | - name: "weblogic-webhook-secrets-volume"
|
355 | 383 | mountPath: "/deployment/secrets"
|
356 | 384 | readOnly: true
|
357 |
| - {{- if .elkIntegrationEnabled }} |
| 385 | + {{- if and .elkIntegrationEnabled .operatorLogPVC }} |
| 386 | + {{- fail "Error: elkIntegrationEnabled and opeatorLogPVC cannot be set at the same time."}} |
| 387 | + {{- else if .elkIntegrationEnabled }} |
358 | 388 | - mountPath: "/logs"
|
359 | 389 | name: "log-dir"
|
360 | 390 | readOnly: false
|
| 391 | + {{- else if .operatorLogPVC }} |
| 392 | + - mountPath: {{ .operatorLogMount | quote }} |
| 393 | + name: "log-dir" |
| 394 | + readOnly: false |
361 | 395 | {{- end }}
|
362 | 396 | {{- if not .remoteDebugNodePortEnabled }}
|
363 | 397 | livenessProbe:
|
@@ -423,6 +457,13 @@ spec:
|
423 | 457 | secret:
|
424 | 458 | secretName: "logstash-certs-secret"
|
425 | 459 | optional: true
|
| 460 | + {{- else if .operatorLogPVC }} |
| 461 | + {{- if not (and .operatorLogMount .operatorLogDir) }} |
| 462 | + {{- fail "Must provide operatorLogMount and operatorLogDir when using operatorLogPVC" }} |
| 463 | + {{- end }} |
| 464 | + - name: "log-dir" |
| 465 | + persistentVolumeClaim: |
| 466 | + claimName: {{ .operatorLogPVC }} |
426 | 467 | {{- end }}
|
427 | 468 | {{- end }}
|
428 | 469 | {{- end }}
|
|
0 commit comments