From a87092e0783c5d942c4112a7cb8cf44b5c582206 Mon Sep 17 00:00:00 2001 From: Friedrich Wilken Date: Wed, 27 Dec 2023 10:30:34 +0100 Subject: [PATCH] bump api-gateway Bump github.com/kyma-project/api-gatway. Due to API changes also adopt the usage of the module. --- go.mod | 4 ++-- go.sum | 8 ++++---- pkg/object/apirule.go | 4 ++-- pkg/object/apirule_test.go | 7 +++++-- pkg/object/equality_test.go | 8 +++++--- testing/test_helpers.go | 6 +++--- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 5f91eb21..51e7ea9c 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/go-logr/zapr v1.3.0 github.com/google/uuid v1.5.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/api-gateway v0.0.0-20231219125807-3eb98237c138 + github.com/kyma-project/api-gateway v0.0.0-20231222161810-7e09cec0147d github.com/kyma-project/kyma/common/logging v0.0.0-20231220133808-e2c22b79a28b github.com/kyma-project/nats-manager v1.0.3-0.20231219150808-13159cfea47c github.com/mitchellh/hashstructure/v2 v2.0.2 @@ -107,7 +107,7 @@ require ( google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index 8a08d595..602dac2f 100644 --- a/go.sum +++ b/go.sum @@ -216,8 +216,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/api-gateway v0.0.0-20231219125807-3eb98237c138 h1:D+Id5H4vn7+e9aqCO56+IQ0cXw2J9FlocfZoZaJXjnY= -github.com/kyma-project/api-gateway v0.0.0-20231219125807-3eb98237c138/go.mod h1:yZEy93fAph+0UOhkfCa4QVkh+R2IvPWWKdCmbIu3/rY= +github.com/kyma-project/api-gateway v0.0.0-20231222161810-7e09cec0147d h1:e/n/Yz21rtlYH4+BFGHPJ3JEzCmgoG/hQoxPdCC7yP4= +github.com/kyma-project/api-gateway v0.0.0-20231222161810-7e09cec0147d/go.mod h1:mzEmmizP+fyI3QK+qFZhyfSXJbAj+d2AbiXVSmo4fMk= github.com/kyma-project/kyma/common/logging v0.0.0-20231220133808-e2c22b79a28b h1:mYJvj9IKQyQMwHsyO+7tXd/PYLk4WZKnlbxnmTiDHqQ= github.com/kyma-project/kyma/common/logging v0.0.0-20231220133808-e2c22b79a28b/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q= github.com/kyma-project/nats-manager v1.0.3-0.20231219150808-13159cfea47c h1:LTWJ2YZBh0DVkFl4eKqR0ZSzlGRHVkiLt6hOxTNV3nc= @@ -680,8 +680,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/pkg/object/apirule.go b/pkg/object/apirule.go index d1440b1f..656adf9b 100644 --- a/pkg/object/apirule.go +++ b/pkg/object/apirule.go @@ -121,7 +121,7 @@ func WithOwnerReference(subs []eventingv1alpha2.Subscription) Option { // WithRules sets the rules of an APIRule for all Subscriptions for a subscriber. func WithRules(certsURL string, subs []eventingv1alpha2.Subscription, svc apigatewayv1beta1.Service, - methods ...string, + methods ...apigatewayv1beta1.HttpMethod, ) Option { return func(r *apigatewayv1beta1.APIRule) { var handler apigatewayv1beta1.Handler @@ -144,7 +144,7 @@ func WithRules(certsURL string, subs []eventingv1alpha2.Subscription, svc apigat for _, sub := range subs { hostURL, err := url.ParseRequestURI(sub.Spec.Sink) if err != nil { - // It's ok as the relevant subscription will have a valid cluster local URL in the same namespace + // It's ok as the relevant subscription will have a valid cluster local URL in the same namespace. continue } if hostURL.Path == "" { diff --git a/pkg/object/apirule_test.go b/pkg/object/apirule_test.go index e2435ec4..0cbd95a0 100644 --- a/pkg/object/apirule_test.go +++ b/pkg/object/apirule_test.go @@ -2,6 +2,7 @@ package object import ( "fmt" + "net/http" "reflect" "testing" @@ -579,14 +580,16 @@ func TestWithRules(t *testing.T) { Spec: eventingv1alpha2.SubscriptionSpec{Sink: sink1}, } - methods = []string{"some.method"} + methods = []apigatewayv1beta1.HttpMethod{ + apigatewayv1beta1.HttpMethod(http.MethodGet), + } ) type args struct { givenCertsURL string givenSubs []eventingv1alpha2.Subscription givenSvc apigatewayv1beta1.Service - givenMethods []string + givenMethods []apigatewayv1beta1.HttpMethod givenObject *apigatewayv1beta1.APIRule } tests := []struct { diff --git a/pkg/object/equality_test.go b/pkg/object/equality_test.go index c2a7411b..2926486b 100644 --- a/pkg/object/equality_test.go +++ b/pkg/object/equality_test.go @@ -32,8 +32,8 @@ func TestApiRuleEqual(t *testing.T) { } rule := apigatewayv1beta1.Rule{ Path: "path", - Methods: []string{ - http.MethodPost, + Methods: []apigatewayv1beta1.HttpMethod{ + apigatewayv1beta1.HttpMethod(http.MethodPost), }, AccessStrategies: []*apigatewayv1beta1.Authenticator{ { @@ -130,7 +130,9 @@ func TestApiRuleEqual(t *testing.T) { prep: func() *apigatewayv1beta1.APIRule { apiRuleCopy := apiRule.DeepCopy() newRule := rule.DeepCopy() - newRule.Methods = []string{http.MethodOptions} + newRule.Methods = []apigatewayv1beta1.HttpMethod{ + apigatewayv1beta1.HttpMethod(http.MethodOptions), + } apiRuleCopy.Spec.Rules = []apigatewayv1beta1.Rule{*newRule} return apiRuleCopy }, diff --git a/testing/test_helpers.go b/testing/test_helpers.go index ee7e3a3e..b51aec66 100644 --- a/testing/test_helpers.go +++ b/testing/test_helpers.go @@ -370,9 +370,9 @@ func WithPath() APIRuleOption { r.Spec.Rules = []apigatewayv1beta1.Rule{ { Path: "/path", - Methods: []string{ - http.MethodPost, - http.MethodOptions, + Methods: []apigatewayv1beta1.HttpMethod{ + apigatewayv1beta1.HttpMethod(http.MethodPost), + apigatewayv1beta1.HttpMethod(http.MethodOptions), }, AccessStrategies: []*apigatewayv1beta1.Authenticator{ authenticator,