File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -196,8 +196,22 @@ func getIgClass(className *string) string {
196
196
func CopyAnnotations (in map [string ]string ) map [string ]string {
197
197
out := make (map [string ]string , len (in ))
198
198
for name , value := range in {
199
- split := strings .SplitN (name , "/" , 2 )
200
- out [split [len (split )- 1 ]] = value
199
+ out [cleanAnnotation (name )] = value
201
200
}
202
201
return out
203
202
}
203
+
204
+ var annotationsPrefixes = []string {
205
+ "haproxy.org/" ,
206
+ "ingress.kubernetes.io/" ,
207
+ "haproxy.com/" ,
208
+ }
209
+
210
+ func cleanAnnotation (annotation string ) string {
211
+ for _ , prefix := range annotationsPrefixes {
212
+ if strings .HasPrefix (annotation , prefix ) {
213
+ return strings .TrimPrefix (annotation , prefix )
214
+ }
215
+ }
216
+ return annotation
217
+ }
You can’t perform that action at this time.
0 commit comments