mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 10:49:05 +02:00
Enable regular expression matching
This commit is contained in:
+3
-1
@@ -3,6 +3,7 @@ package cluster
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"regexp"
|
||||
|
||||
batchv1beta1 "k8s.io/api/batch/v1beta1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
@@ -337,7 +338,8 @@ func (c *Cluster) syncStatefulSet() error {
|
||||
if ToPropagateAnnotations != nil && PgCRDAnnotations != nil {
|
||||
for _, anno := range ToPropagateAnnotations {
|
||||
for k, v := range PgCRDAnnotations {
|
||||
if k == anno {
|
||||
matched, err := regexp.MatchString(anno, k)
|
||||
if err == nil && matched {
|
||||
annotations[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user