Commit fe9be3d5 by Hanna Bledai

fixed : 37,102 lines

parent 9d6c66ea
...@@ -53,15 +53,15 @@ type pvcMetadata struct { ...@@ -53,15 +53,15 @@ type pvcMetadata struct {
annotations map[string]string annotations map[string]string
} }
var pattern = regexp.MustCompile(`{pvc\.((labels|annotations)\.(.*?)|.*?)}`)
func (meta *pvcMetadata) stringParser(str string) string { func (meta *pvcMetadata) stringParser(str string) string {
pattern := regexp.MustCompile(`{pvc\.((labels|annotations)\.(.*?)|.*?)}`)
result := pattern.FindAllStringSubmatch(str, -1) result := pattern.FindAllStringSubmatch(str, -1)
for _, r := range result { for _, r := range result {
switch r[2] { switch r[2] {
case "labels": case "labels":
str = strings.Replace(str, r[0], meta.labels[r[3]], -1) str = strings.Replace(str, r[0], meta.labels[r[3]], -1)
case "annotations": case "annotations":
fmt.Println(r[0], r[3], meta.annotations[r[3]])
str = strings.Replace(str, r[0], meta.annotations[r[3]], -1) str = strings.Replace(str, r[0], meta.annotations[r[3]], -1)
default: default:
str = strings.Replace(str, r[0], meta.data[r[1]], -1) str = strings.Replace(str, r[0], meta.data[r[1]], -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment