You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you expect to see?
The stack trace should only contain paths relative to the GOROOT
What did you see instead? Under which circumstances?
When the operator panics for whatever reason the stack trace includes the full path to the source code. This discloses information on the host that built the binary, e.g. the home dir of the user that made the build.
Aesthetics apart it obfuscates errors as it looks as-if the operator is running locally on another host than on a kubernetes cluster. The source path should be trimmed and refer to a "canonical" go root such as /usr/local/go/... instead of something like /usr/home/user/go/src/...
Thanks for opening this issue. I tried building but was still getting some of my own home paths (specifically for things in the vendor directory) during panics with the flags you provided. I found that the correct flags to remove the paths even across the vendored packages seems to be -gcflags "all=-trimpath=$GOPATH" -asmflags "all=-trimpath=$GOPATH". I will make a PR with the fixes in the makefile
**Description of the change:** Trim the GOPATH from binaries built with `install` or `build`.
**Motivation for the change:** Remove the home directory of the builder from the panic path.
Closes#1036
AlexNPavel
added a commit
to AlexNPavel/operator-sdk
that referenced
this issue
Feb 1, 2019
**Description of the change:** Trim the GOPATH from binaries built with `install` or `build`.
**Motivation for the change:** Remove the home directory of the builder from the panic path.
Closesoperator-framework#1036
Bug Report
What did you do?
Panic.
What did you expect to see?
The stack trace should only contain paths relative to the GOROOT
What did you see instead? Under which circumstances?
When the operator panics for whatever reason the stack trace includes the full path to the source code. This discloses information on the host that built the binary, e.g. the home dir of the user that made the build.
Aesthetics apart it obfuscates errors as it looks as-if the operator is running locally on another host than on a kubernetes cluster. The source path should be trimmed and refer to a "canonical" go root such as
/usr/local/go/...
instead of something like/usr/home/user/go/src/...
Environment
operator-sdk version v0.3.0+git
(not relevant for the issue but here goes...)
Docker CE (local), Docker EE (cluster)
Go.
Possible Solution
Launch
go build
with the following two flagsCf. golang/go#13809 (reference)
Additional context
To illustrate the issue locally without the operator SDK or a k8s cluster, run the following:
The text was updated successfully, but these errors were encountered: