File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
kubernetes/charts/weblogic-operator/templates Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,8 @@ spec:
192192{ {- end } }
193193---
194194 { { $chartVersion := .Chart.Version } }
195- { { $webhookExists := include " utils.verifyExistingWebhookDeployment" (list $chartVersion ) | trim } }
195+ { { $releaseNamespace := .Release.Namespace } }
196+ { { $webhookExists := include " utils.verifyExistingWebhookDeployment" (list $chartVersion $releaseNamespace ) | trim } }
196197 { {- if and (ne $webhookExists " true" ) (not .operatorOnly) } }
197198 # webhook does not exist or chart version is newer, create a new webhook
198199 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
498498*/}}
499499{{- define "utils.verifyExistingWebhookDeployment" -}}
500500{{- $chartVersion := index . 0 -}}
501+ {{- $releaseNamespace := index . 1 -}}
501502{{- range $deployment := (lookup "apps/v1" "Deployment" "" "").items }}
502503{{- if not $deployment.metadata.labels }}
503504{{- $ignore := set $deployment.metadata "labels" (dict) }}
504505{{- end }}
505506{{- if and (eq $deployment.metadata.name "weblogic-operator-webhook") (hasKey $deployment.metadata.labels "weblogic.webhookVersion") }}
506507{{ $webhookVersion := get $deployment.metadata.labels "weblogic.webhookVersion" }}
508+ {{- if (eq $deployment.metadata.namespace $releaseNamespace) }}
509+ {{- print "false" }}
510+ {{- end -}}
507511{{- if le $chartVersion $webhookVersion }}
508512{{- print "true" }}
509513{{- end -}}
You can’t perform that action at this time.
0 commit comments