fixed : 37,102 lines

This commit is contained in:
Hanna Bledai 2020-09-21 15:56:30 +03:00
parent 9d6c66ea94
commit fe9be3d5d8
1 changed files with 2 additions and 2 deletions

View File

@ -53,15 +53,15 @@ type pvcMetadata struct {
annotations map[string]string
}
var pattern = regexp.MustCompile(`{pvc\.((labels|annotations)\.(.*?)|.*?)}`)
func (meta *pvcMetadata) stringParser(str string) string {
pattern := regexp.MustCompile(`{pvc\.((labels|annotations)\.(.*?)|.*?)}`)
result := pattern.FindAllStringSubmatch(str, -1)
for _, r := range result {
switch r[2] {
case "labels":
str = strings.Replace(str, r[0], meta.labels[r[3]], -1)
case "annotations":
fmt.Println(r[0], r[3], meta.annotations[r[3]])
str = strings.Replace(str, r[0], meta.annotations[r[3]], -1)
default:
str = strings.Replace(str, r[0], meta.data[r[1]], -1)