Skip to content

Commit

Permalink
Fix favicon returning 500 inside container (#3569)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashmita152 committed Mar 8, 2022
1 parent 9a9f616 commit 55fdb2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
16 changes: 16 additions & 0 deletions cmd/all-in-one/all_in_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func TestAllInOne(t *testing.T) {
if err := healthCheck(); err != nil {
t.Fatal(err)
}
// Check if the favicon icon is available
if err := faviconCheck(); err != nil {
t.Fatal(err)
}
createTrace(t)
getAPITrace(t)
getSamplingStrategy(t)
Expand Down Expand Up @@ -138,6 +142,18 @@ func healthCheck() error {
return fmt.Errorf("query service is not ready")
}

func faviconCheck() error {
println("Checking favicon...")
resp, err := http.Get(queryURL + "/favicon.ico")
if err == nil && resp.StatusCode == http.StatusOK {
println("Favicon check successful")
return nil
} else {
println("Favicon check failed")
return fmt.Errorf("all-in-one failed to serve favicon icon")
}
}

func getServicesAPIV3(t *testing.T) {
req, err := http.NewRequest("GET", getServicesAPIV3URL, nil)
require.NoError(t, err)
Expand Down
3 changes: 2 additions & 1 deletion docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ ARG cert_image
ARG root_image

FROM $cert_image AS cert
RUN apk add --update --no-cache ca-certificates
RUN apk add --update --no-cache ca-certificates mailcap

FROM $root_image
COPY --from=cert /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=cert /etc/mime.types /etc/mime.types
3 changes: 2 additions & 1 deletion docker/debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG golang_image
FROM $golang_image AS build
ARG TARGETARCH
ENV GOPATH /go
RUN apk add --update --no-cache ca-certificates make git build-base
RUN apk add --update --no-cache ca-certificates make git build-base mailcap
#Once go-delve adds support for s390x (see PR #2948), remove this entire conditional.
#Once go-delve adds support for ppc64le (see PR go-delve/delve#1564), remove this entire conditional.
RUN if [[ "$TARGETARCH" == "s390x" || "$TARGETARCH" == "ppc64le" ]] ; then \
Expand All @@ -15,3 +15,4 @@ RUN if [[ "$TARGETARCH" == "s390x" || "$TARGETARCH" == "ppc64le" ]] ; then \
FROM $golang_image
COPY --from=build /go/bin/dlv /go/bin/dlv
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/mime.types /etc/mime.types

0 comments on commit 55fdb2a

Please sign in to comment.