diff --git a/chart/templates/authservice/namespace.yaml b/chart/templates/authservice/namespace.yaml
index 603721cdd05f04a34516204b97ef161a9cb5d21e..6760d1366838944dc77ff12ecea11dabdd2613b4 100644
--- a/chart/templates/authservice/namespace.yaml
+++ b/chart/templates/authservice/namespace.yaml
@@ -8,7 +8,7 @@ metadata:
     istio-injection: enabled
   {{- end }}
 
-{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
+{{- if ( include "imagePullSecret" . ) }}
 ---
 apiVersion: v1
 kind: Secret