From 2fe5f1ceb15bf980ffa75954212135ae81445aa8 Mon Sep 17 00:00:00 2001 From: Jeff Rescignano Date: Wed, 11 Dec 2024 13:01:29 -0500 Subject: [PATCH] allow hyphens in database name --- pkg/cluster/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 1a8d6f762..926d62bc0 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -42,7 +42,7 @@ import ( var ( alphaNumericRegexp = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9]*$") - databaseNameRegexp = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") + databaseNameRegexp = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_-]*$") userRegexp = regexp.MustCompile(`^[a-z0-9]([-_a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-_a-z0-9]*[a-z0-9])?)*$`) patroniObjectSuffixes = []string{"leader", "config", "sync", "failover"} finalizerName = "postgres-operator.acid.zalan.do"