Skip to content

Commit 36314b4

Browse files
committed
Merge branch 'main' into release/4.0
2 parents f0aa619 + 990dbb7 commit 36314b4

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed
51 Bytes
Binary file not shown.

kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

kubernetes/charts/weblogic-operator/templates/_utils.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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 -}}

0 commit comments

Comments
 (0)