From c5463e4543a38493913ee5ac5f9db87733afad81 Mon Sep 17 00:00:00 2001
From: Andri Joos <andri@joos.io>
Date: Sun, 3 Nov 2024 22:37:57 +0100
Subject: [PATCH] use fullname instead of .Release.Name for AllowedHosts name

---
 allowed-hosts/templates/constraint.yaml | 2 +-
 allowed-hosts/values.yaml               | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/allowed-hosts/templates/constraint.yaml b/allowed-hosts/templates/constraint.yaml
index d2b97b6..33bc80d 100644
--- a/allowed-hosts/templates/constraint.yaml
+++ b/allowed-hosts/templates/constraint.yaml
@@ -1,7 +1,7 @@
 apiVersion: constraints.gatekeeper.sh/v1beta1
 kind: AllowedHosts
 metadata:
-  name: {{ .Release.Name }}
+  name: {{ include "allowed-hosts.fullname" . }}
   labels:
     {{- include "allowed-hosts.labels" . | nindent 4 }}
 spec:
diff --git a/allowed-hosts/values.yaml b/allowed-hosts/values.yaml
index a181202..661c0e4 100644
--- a/allowed-hosts/values.yaml
+++ b/allowed-hosts/values.yaml
@@ -1,3 +1,6 @@
+nameOverride: ''
+fullnameOverride: ''
+
 allowedDomains: []
 # - "*.example.com"
 # - "example.com"
-- 
GitLab