File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
kubernetes/charts/weblogic-operator/templates Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,8 @@ spec:
192
192
{ {- end } }
193
193
---
194
194
{ { $chartVersion := .Chart.Version } }
195
- { { $webhookExists := include " utils.verifyExistingWebhookDeployment" (list $chartVersion ) | trim } }
195
+ { { $releaseNamespace := .Release.Namespace } }
196
+ { { $webhookExists := include " utils.verifyExistingWebhookDeployment" (list $chartVersion $releaseNamespace ) | trim } }
196
197
{ {- if and (ne $webhookExists " true" ) (not .operatorOnly) } }
197
198
# webhook does not exist or chart version is newer, create a new webhook
198
199
apiVersion: "v1"
Original file line number Diff line number Diff line change @@ -498,12 +498,16 @@ Return true if there's an existing webhook deployment and chart version is less
498
498
*/}}
499
499
{{- define "utils.verifyExistingWebhookDeployment" -}}
500
500
{{- $chartVersion := index . 0 -}}
501
+ {{- $releaseNamespace := index . 1 -}}
501
502
{{- range $deployment := (lookup "apps/v1" "Deployment" "" "").items }}
502
503
{{- if not $deployment.metadata.labels }}
503
504
{{- $ignore := set $deployment.metadata "labels" (dict) }}
504
505
{{- end }}
505
506
{{- if and (eq $deployment.metadata.name "weblogic-operator-webhook") (hasKey $deployment.metadata.labels "weblogic.webhookVersion") }}
506
507
{{ $webhookVersion := get $deployment.metadata.labels "weblogic.webhookVersion" }}
508
+ {{- if (eq $deployment.metadata.namespace $releaseNamespace) }}
509
+ {{- print "false" }}
510
+ {{- end -}}
507
511
{{- if le $chartVersion $webhookVersion }}
508
512
{{- print "true" }}
509
513
{{- end -}}
You can’t perform that action at this time.
0 commit comments