@@ -29,13 +29,13 @@ import (
2929)
3030
3131const (
32- kubernetesAnnotationMatch = ".*kubernetes\\ .io/.*"
33- arangoAnnotationMatch = ".*arangodb\\ .com/.*"
32+ kubernetesIOMatch = ".*kubernetes\\ .io/.*"
33+ arangoDBMatch = ".*arangodb\\ .com/.*"
3434)
3535
3636var (
37- kubernetesAnnotationRegex * regexp.Regexp
38- arangoAnnotationRegex * regexp.Regexp
37+ kubernetesIORegex * regexp.Regexp
38+ arangoDBRegex * regexp.Regexp
3939
4040 reservedLabels = RestrictedList {
4141 k8sutil .LabelKeyArangoDeployment ,
@@ -124,19 +124,19 @@ func (r RestrictedList) Filter(m map[string]string) map[string]string {
124124}
125125
126126func init () {
127- r , err := regexp .Compile (kubernetesAnnotationMatch )
127+ r , err := regexp .Compile (kubernetesIOMatch )
128128 if err != nil {
129129 panic (err )
130130 }
131131
132- kubernetesAnnotationRegex = r
132+ kubernetesIORegex = r
133133
134- r , err = regexp .Compile (arangoAnnotationMatch )
134+ r , err = regexp .Compile (arangoDBMatch )
135135 if err != nil {
136136 panic (err )
137137 }
138138
139- arangoAnnotationRegex = r
139+ arangoDBRegex = r
140140}
141141
142142func LabelsPatch (mode api.LabelsMode , expected map [string ]string , actual map [string ]string , ignored ... string ) patch.Patch {
@@ -145,6 +145,14 @@ func LabelsPatch(mode api.LabelsMode, expected map[string]string, actual map[str
145145 return true
146146 }
147147
148+ if arangoDBRegex .MatchString (k ) {
149+ return true
150+ }
151+
152+ if kubernetesIORegex .MatchString (k ) {
153+ return true
154+ }
155+
148156 if NewRestrictedList (ignored ... ).IsRestricted (k ) {
149157 return true
150158 }
@@ -155,11 +163,11 @@ func LabelsPatch(mode api.LabelsMode, expected map[string]string, actual map[str
155163
156164func AnnotationsPatch (mode api.LabelsMode , expected map [string ]string , actual map [string ]string , ignored ... string ) patch.Patch {
157165 return getFieldPatch (mode , "annotations" , expected , actual , func (k , v string ) bool {
158- if kubernetesAnnotationRegex .MatchString (k ) {
166+ if kubernetesIORegex .MatchString (k ) {
159167 return true
160168 }
161169
162- if arangoAnnotationRegex .MatchString (k ) {
170+ if arangoDBRegex .MatchString (k ) {
163171 return true
164172 }
165173
0 commit comments