Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies in eventing-manager #367

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ require (
github.com/avast/retry-go/v3 v3.1.1
github.com/cloudevents/sdk-go/protocol/nats/v2 v2.14.0
github.com/cloudevents/sdk-go/v2 v2.14.0
github.com/go-logr/logr v1.3.0
github.com/go-logr/logr v1.4.1
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/kyma/common/logging v0.0.0-20231219124408-e2f66abc2d9a
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
github.com/nats-io/nats-server/v2 v2.10.7
Expand All @@ -21,7 +21,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.17.0
github.com/stretchr/testify v1.8.4
github.com/vektra/mockery/v2 v2.38.0
github.com/vektra/mockery/v2 v2.39.1
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.26.0
golang.org/x/oauth2 v0.15.0
Expand All @@ -39,7 +39,7 @@ require (
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chigopher/pathlib v0.15.0 // indirect
github.com/chigopher/pathlib v0.19.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
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
23 changes: 12 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dR
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chigopher/pathlib v0.15.0 h1:1pg96WL3iC1/YyWV4UJSl3E0GBf4B+h5amBtsbAAieY=
github.com/chigopher/pathlib v0.15.0/go.mod h1:3+YPPV21mU9vyw8Mjp+F33CyCfE6iOzinpiqBcccv7I=
github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A=
github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
Expand Down Expand Up @@ -87,8 +87,9 @@ github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyT
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
Expand Down Expand Up @@ -215,10 +216,10 @@ 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/kyma/common/logging v0.0.0-20231219124408-e2f66abc2d9a h1:6K6iTCj29ErBL7KpizLOekavD/RaqsC6ByVECNIAqwo=
github.com/kyma-project/kyma/common/logging v0.0.0-20231219124408-e2f66abc2d9a/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q=
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=
github.com/kyma-project/nats-manager v1.0.3-0.20231219150808-13159cfea47c/go.mod h1:1vHtViq9rGpz1rWY2RKkBWzDWeEFStZJSqBCMtpuOOI=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
Expand Down Expand Up @@ -326,8 +327,8 @@ github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/vektra/mockery/v2 v2.38.0 h1:I0LBuUzZHqAU4d1DknW0DTFBPO6n8TaD38WL2KJf3yI=
github.com/vektra/mockery/v2 v2.38.0/go.mod h1:diB13hxXG6QrTR0ol2Rk8s2dRMftzvExSvPDKr+IYKk=
github.com/vektra/mockery/v2 v2.39.1 h1:zgnW69s+351ZF/L+O5pO64MpVP96aDtw8jwOGvGXzwU=
github.com/vektra/mockery/v2 v2.39.1/go.mod h1:dPzGtjT0/Uu4hqpF6QNHwz+GLago7lq1bxdj9wHbGKo=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -679,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,
friedrichwilken marked this conversation as resolved.
Show resolved Hide resolved
) 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
12 changes: 10 additions & 2 deletions testing/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ func HaveAPIRuleSpecRules(ruleMethods []string, accessStrategy, certsURL, path s
return a.Spec.Rules
}, ContainElement(
MatchFields(IgnoreExtras|IgnoreMissing, Fields{
"Methods": ConsistOf(ruleMethods),
"Methods": ConsistOf(stringsToMethods(ruleMethods)),
"AccessStrategies": ConsistOf(haveAPIRuleAccessStrategies(authenticator)),
"Gateway": Equal(constants.ClusterLocalAPIGateway),
"Path": Equal(path),
}),
))
}

func stringsToMethods(methods []string) []apigatewayv1beta1.HttpMethod {
httpMethodes := []apigatewayv1beta1.HttpMethod{}
for _, m := range methods {
httpMethodes = append(httpMethodes, apigatewayv1beta1.HttpMethod(m))
}
return httpMethodes
}

func haveAPIRuleAccessStrategies(authenticator *apigatewayv1beta1.Authenticator) gomegatypes.GomegaMatcher {
return WithTransform(func(a *apigatewayv1beta1.Authenticator) *apigatewayv1beta1.Authenticator {
return a
Expand All @@ -68,7 +76,7 @@ func HaveAPIRuleSpecRulesWithOry(ruleMethods []string, accessStrategy, path stri
return a.Spec.Rules
}, ContainElement(
MatchFields(IgnoreExtras|IgnoreMissing, Fields{
"Methods": ConsistOf(ruleMethods),
"Methods": ConsistOf(stringsToMethods(ruleMethods)),
"AccessStrategies": ConsistOf(haveAPIRuleAccessStrategiesWithOry(accessStrategy)),
"Gateway": Equal(constants.ClusterLocalAPIGateway),
"Path": Equal(path),
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