Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing 7636997...abba035:
  > abba035 Fix unique name generator for auto-created EventType (# 7160)
  > 8eaf932 Added .env files to the gitignore (# 7162)
  > 56e9420 [main] Upgrade to latest dependencies (# 7157)
bumping knative.dev/reconciler-test c77c0ec...a7237b0:
  > a7237b0 Use the Request in Forwarder directly (# 575)
  > 6e00c29 Forward headers starting with Kn- (# 572)

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed Aug 11, 2023
1 parent f478b16 commit fce46b7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ require (
github.com/google/gofuzz v1.2.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/kedacore/keda/v2 v2.8.1
knative.dev/eventing v0.38.1-0.20230809013337-7636997cd0b8
knative.dev/eventing v0.38.1-0.20230810151938-abba03518e7e
knative.dev/hack v0.0.0-20230809013436-ab12e24b8c13
knative.dev/pkg v0.0.0-20230809013237-cceb144872f7
knative.dev/reconciler-test v0.0.0-20230809013436-c77c0ec73cab
knative.dev/reconciler-test v0.0.0-20230810072538-a7237b013cbb
sigs.k8s.io/controller-runtime v0.12.3
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1322,14 +1322,14 @@ k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.38.1-0.20230809013337-7636997cd0b8 h1:BhrR2V3ce5Y+0p1RvASffGUrVjhmTn5E88/rNKaId+Q=
knative.dev/eventing v0.38.1-0.20230809013337-7636997cd0b8/go.mod h1:nikkNBn3jrJaccPQckf5CdNkWy2MkUId0cscbxKu+7Q=
knative.dev/eventing v0.38.1-0.20230810151938-abba03518e7e h1:ddjf1BfgsYCVHpi/pbPvXRhW3Ha7ui+EmYeAhT5TYw4=
knative.dev/eventing v0.38.1-0.20230810151938-abba03518e7e/go.mod h1:fOMOjOmyXS1SeLM5dcrZ2pfJqMlKYyveLMPkYQVIf8U=
knative.dev/hack v0.0.0-20230809013436-ab12e24b8c13 h1:RdXhtR06YIABp9kL8t89R/bPY8Cbde8+F5QELpxxw1s=
knative.dev/hack v0.0.0-20230809013436-ab12e24b8c13/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20230809013237-cceb144872f7 h1:QbvbP7Mq1iLLVxKYqj/BEp9rnwCeRuWvLG8IGao+KIo=
knative.dev/pkg v0.0.0-20230809013237-cceb144872f7/go.mod h1:1TUywzFGQcoDUg/hrP4PRPh1Xaw7s5B9n0Kb0hrytJs=
knative.dev/reconciler-test v0.0.0-20230809013436-c77c0ec73cab h1:ysXSLunBkfQ6Q+8UJ2uidMdXuogc1hnM1FUVoBQrMeI=
knative.dev/reconciler-test v0.0.0-20230809013436-c77c0ec73cab/go.mod h1:i+/PWK/n3HPgjXMoj5U7CA6WRW/C3c3EfHCQ0FmrhNM=
knative.dev/reconciler-test v0.0.0-20230810072538-a7237b013cbb h1:XKIYY3OOzlzuN1hX3jc3UoJyIXe33bghVHyyhIpkr2A=
knative.dev/reconciler-test v0.0.0-20230810072538-a7237b013cbb/go.mod h1:i+/PWK/n3HPgjXMoj5U7CA6WRW/C3c3EfHCQ0FmrhNM=
pgregory.net/rapid v1.0.0 h1:iQaM2w5PZ6xvt6x7hbd7tiDS+nk7YPp5uCaEba+T/F4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"

Expand All @@ -29,7 +30,6 @@ import (
"go.opencensus.io/trace"
"go.uber.org/zap"

"github.com/cloudevents/sdk-go/v2/binding"
cehttp "github.com/cloudevents/sdk-go/v2/protocol/http"
cloudeventshttp "github.com/cloudevents/sdk-go/v2/protocol/http"
"github.com/kelseyhightower/envconfig"
Expand Down Expand Up @@ -130,15 +130,15 @@ func (o *Forwarder) ServeHTTP(writer http.ResponseWriter, request *http.Request)
defer m.Finish(nil)

event, eventErr := cloudeventsbindings.ToEvent(context.TODO(), m)
headers := make(http.Header)
receivedHeaders := make(http.Header)
for k, v := range request.Header {
if !strings.HasPrefix(k, "Ce-") {
headers[k] = v
receivedHeaders[k] = v
}
}
// Host header is removed from the request.Header map by net/http
if request.Host != "" {
headers.Set("Host", request.Host)
receivedHeaders.Set("Host", request.Host)
}

eventErrStr := ""
Expand All @@ -150,7 +150,7 @@ func (o *Forwarder) ServeHTTP(writer http.ResponseWriter, request *http.Request)
Error: eventErrStr,
Event: event,
Observer: o.Name,
HTTPHeaders: headers,
HTTPHeaders: receivedHeaders,
Origin: request.RemoteAddr,
Time: time.Now(),
Kind: eventshub.EventReceived,
Expand All @@ -161,15 +161,15 @@ func (o *Forwarder) ServeHTTP(writer http.ResponseWriter, request *http.Request)
logging.FromContext(o.ctx).Fatalw("Error while venting the received event", zap.Error(err))
}

req, err := http.NewRequestWithContext(requestCtx, http.MethodPost, o.Sink, nil)
if err != nil {
logging.FromContext(o.ctx).Error("Cannot create the request: ", err)
}
req := request.Clone(requestCtx)
// It is an error to set this field in an HTTP client request.
req.RequestURI = ""

err = cehttp.WriteRequest(requestCtx, binding.ToMessage(event), req)
u, err := url.Parse(o.Sink)
if err != nil {
logging.FromContext(o.ctx).Error("Cannot write the event: ", err)
logging.FromContext(o.ctx).Fatalw("Unable to parse sink URL", zap.Error(err))
}
req.URL = u

eventString := "unknown"
if event != nil {
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ k8s.io/utils/net
k8s.io/utils/pointer
k8s.io/utils/strings/slices
k8s.io/utils/trace
# knative.dev/eventing v0.38.1-0.20230809013337-7636997cd0b8
# knative.dev/eventing v0.38.1-0.20230810151938-abba03518e7e
## explicit; go 1.19
knative.dev/eventing/cmd/event_display
knative.dev/eventing/cmd/heartbeats
Expand Down Expand Up @@ -1557,7 +1557,7 @@ knative.dev/pkg/webhook/json
knative.dev/pkg/webhook/resourcesemantics
knative.dev/pkg/webhook/resourcesemantics/defaulting
knative.dev/pkg/webhook/resourcesemantics/validation
# knative.dev/reconciler-test v0.0.0-20230809013436-c77c0ec73cab
# knative.dev/reconciler-test v0.0.0-20230810072538-a7237b013cbb
## explicit; go 1.18
knative.dev/reconciler-test/cmd/eventshub
knative.dev/reconciler-test/pkg/environment
Expand Down

0 comments on commit fce46b7

Please sign in to comment.