Skip to content

Commit

Permalink
bump api-gateway
Browse files Browse the repository at this point in the history
Bump github.com/kyma-project/api-gatway. Due to API changes also adopt the usage of the module.
  • Loading branch information
friedrichwilken committed Dec 27, 2023
1 parent 04da0a3 commit a87092e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions pkg/object/apirule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 == "" {
Expand Down
7 changes: 5 additions & 2 deletions pkg/object/apirule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package object

import (
"fmt"
"net/http"
"reflect"
"testing"

Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions pkg/object/equality_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down Expand Up @@ -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
},
Expand Down
6 changes: 3 additions & 3 deletions testing/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a87092e

Please sign in to comment.