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

Fix middleware writer: #343

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Fix middleware writer: #343

merged 1 commit into from
Sep 25, 2023

Conversation

jacobweinstock
Copy link
Member

Description

Func now only returns an error when the error is not nil.

Why is this needed

logs were showing an error when there wasnt one.

{"level":"error","ts":1695434959.912211,"caller":"script/ipxe.go:152","msg":"unable to write boot script","script":"auto.ipxe","error":"writing response: %!w(<nil>)","stacktrace":"github.com/tinkerbell/smee/ipxe/script.(*Handler).serveBootScript\n\t/home/tink/repos/tinkerbell/boots/ipxe/script/ipxe.go:152\ngithub.com/tinkerbell/smee/ipxe/script.(*Handler).HandlerFunc.func1\n\t/home/tink/repos/tinkerbell/boots/ipxe/script/ipxe.go:108\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2122\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.WithRouteTag.func1\n\t/root/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/net/http/[email protected]/handler.go:262\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2122\nnet/http.(*ServeMux).ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2500\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*Handler).ServeHTTP\n\t/root/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/net/http/[email protected]/handler.go:212\ngithub.com/tinkerbell/smee/ipxe/http.(*loggingMiddleware).ServeHTTP\n\t/home/tink/repos/tinkerbell/boots/ipxe/http/middleware.go:35\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2936\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1995"}

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

Func now only returns an error when
err is not nil.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock added the ready-to-merge Signal to Mergify to merge the PR. label Sep 25, 2023
@mergify mergify bot merged commit e758659 into tinkerbell:main Sep 25, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants