Enable regular expression matching
This commit is contained in:
parent
dd2381174c
commit
8d718c4fc1
|
|
@ -3,6 +3,7 @@ package cluster
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
batchv1beta1 "k8s.io/api/batch/v1beta1"
|
batchv1beta1 "k8s.io/api/batch/v1beta1"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
|
|
@ -337,7 +338,8 @@ func (c *Cluster) syncStatefulSet() error {
|
||||||
if ToPropagateAnnotations != nil && PgCRDAnnotations != nil {
|
if ToPropagateAnnotations != nil && PgCRDAnnotations != nil {
|
||||||
for _, anno := range ToPropagateAnnotations {
|
for _, anno := range ToPropagateAnnotations {
|
||||||
for k, v := range PgCRDAnnotations {
|
for k, v := range PgCRDAnnotations {
|
||||||
if k == anno {
|
matched, err := regexp.MatchString(anno, k)
|
||||||
|
if err == nil && matched {
|
||||||
annotations[k] = v
|
annotations[k] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue