Revision 33b9e70f7ceea28eda07aa2e638f758acacd7032 authored by Tobias Klauser on 30 November 2021, 12:08:22 UTC, committed by Nathan Sweet on 02 December 2021, 23:08:48 UTC
[ upstream commit e38e3c44f712b5f0ecf33efd1867c0ae16b241f7 ]

Commit 8bcc4e5dd830 ("bugtool: avoid allocation on conversion of
execCommand result to string") broke the `ip route show` commands
because the change from `[]byte` to `string` causes the `%v` formatting
verb to emit the raw byte slice, not the string. Fix this by using the
`%s` formatting verb to make sure the argument gets interpreted as a
string.

Also fix another instance in `writeCmdToFile` where `fmt.Fprint` is now
invoked with a byte slice.

Grepping for `%v` in bugtool sources and manually inspecting all changes
from commit 8bcc4e5dd830 showed no other instances where a byte slice
could potentially end up being formatted in a wrong way.

Fixes: 8bcc4e5dd830 ("bugtool: avoid allocation on conversion of execCommand result to string")

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
1 parent b51a044
Raw File
hubble-relay.Dockerfile
# (first line comment needed for DOCKER_BUILDKIT use)
#
ARG BASE_IMAGE=scratch

FROM docker.io/library/golang:1.15.15 as builder
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
ADD . /go/src/github.com/cilium/cilium
WORKDIR /go/src/github.com/cilium/cilium/hubble-relay
ARG NOSTRIP
ARG LOCKDEBUG
ARG RACE
RUN make RACE=${RACE} NOSTRIP=${NOSTRIP} LOCKDEBUG=${LOCKDEBUG}
WORKDIR /go/src/github.com/cilium/cilium
RUN make licenses-all

FROM docker.io/library/alpine:3.12.0 as certs
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
RUN apk --update add ca-certificates

FROM docker.io/library/golang:1.15.15 as gops
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
RUN go get -d github.com/google/gops && \
    cd /go/src/github.com/google/gops && \
    git checkout -b v0.3.10 v0.3.10 && \
    git --no-pager remote -v && \
    git --no-pager log -1 && \
    CGO_ENABLED=0 go install && \
    strip /go/bin/gops

FROM ${BASE_IMAGE}
ARG CILIUM_SHA=""
LABEL cilium-sha=${CILIUM_SHA}
LABEL maintainer="maintainer@cilium.io"
ENV GOPS_CONFIG_DIR=/
COPY --from=builder /go/src/github.com/cilium/cilium/hubble-relay/hubble-relay /usr/bin/hubble-relay
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=gops /go/bin/gops /bin/gops
COPY --from=builder /go/src/github.com/cilium/cilium/LICENSE.all /LICENSE.all
ENTRYPOINT ["/usr/bin/hubble-relay"]
# FIXME Remove me once we add support for Go 1.16
ENV GODEBUG="madvdontneed=1"
CMD ["serve"]
back to top