Skip to content

Commit b42d0c1

Browse files
added notifications for plugins feature parsers in kong
1 parent f9ddda0 commit b42d0c1

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pkg/i2gw/providers/kong/header_matching.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func patchHTTPRouteHeaderMatching(httpRoute *gatewayv1.HTTPRoute, headerNames []
8383
}
8484
httpRoute.Spec.Rules[i].Matches = newMatches
8585
if len(newMatches) > 0 {
86-
notify(notifications.InfoNotification, fmt.Sprintf("parsed \"%v\" annotations of ingress and patched %v fields", kongAnnotation(headersKey), field.NewPath("httproute", "spec", "rules").Key("").Child("matches")), httpRoute)
86+
notify(notifications.InfoNotification, fmt.Sprintf("parsed \"%v\" annotation of ingress and patched %v fields", kongAnnotation(headersKey), field.NewPath("httproute", "spec", "rules").Key("").Child("matches")), httpRoute)
8787
}
8888
}
8989
}

pkg/i2gw/providers/kong/method_matching.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func patchHTTPRouteMethodMatching(httpRoute *gatewayv1.HTTPRoute, methods []gate
6969
}
7070
if len(matches) > 0 {
7171
httpRoute.Spec.Rules[i].Matches = matches
72-
notify(notifications.InfoNotification, fmt.Sprintf("parsed \"%v\" annotations of ingress and patched %v fields", kongAnnotation(methodsKey), field.NewPath("httproute", "spec", "rules").Key("").Child("matches").Key("").Child("method")), httpRoute)
72+
notify(notifications.InfoNotification, fmt.Sprintf("parsed \"%v\" annotation of ingress and patched %v fields", kongAnnotation(methodsKey), field.NewPath("httproute", "spec", "rules").Key("").Child("matches").Key("").Child("method")), httpRoute)
7373
}
7474
}
7575
}

pkg/i2gw/providers/kong/plugins.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ package kong
1818

1919
import (
2020
"errors"
21+
"fmt"
2122
"strings"
2223

2324
"github.com/kubernetes-sigs/ingress2gateway/pkg/i2gw"
25+
"github.com/kubernetes-sigs/ingress2gateway/pkg/i2gw/notifications"
2426
"github.com/kubernetes-sigs/ingress2gateway/pkg/i2gw/providers/common"
2527
networkingv1 "k8s.io/api/networking/v1"
2628
"k8s.io/apimachinery/pkg/types"
@@ -81,4 +83,7 @@ func patchHTTPRoutePlugins(httpRoute *gatewayv1.HTTPRoute, extensionRefs []gatew
8183
}
8284
httpRoute.Spec.Rules[i].Filters = append(httpRoute.Spec.Rules[i].Filters, extensionRefs...)
8385
}
86+
if len(extensionRefs) != 0 {
87+
notify(notifications.InfoNotification, fmt.Sprintf("parsed \"%v\" annotation of ingress and patched %v fields", kongAnnotation(pluginsKey), field.NewPath("httproute", "spec", "rules").Key("").Child("filters")), httpRoute)
88+
}
8489
}

0 commit comments

Comments
 (0)