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 {
196196func CopyAnnotations (in map [string ]string ) map [string ]string {
197197 out := make (map [string ]string , len (in ))
198198 for name , value := range in {
199- split := strings .SplitN (name , "/" , 2 )
200- out [split [len (split )- 1 ]] = value
199+ out [cleanAnnotation (name )] = value
201200 }
202201 return out
203202}
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