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

cmd/operator-sdk/build: expand env in go build #1535

Merged
merged 3 commits into from
Jun 7, 2019

Conversation

estroz
Copy link
Member

@estroz estroz commented Jun 7, 2019

Description of the change: expand environment variables in operator-sdk build's go build process, and always append os.Environ() to go commands.

Motivation for the change: exec.Cmd's are not run in a shell, so env variables are not expanded.

Closes #1530

internal/util/projutil: always append os.Environ() to go cmds
@estroz estroz added the kind/bug Categorizes issue or PR as related to a bug. label Jun 7, 2019
@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 7, 2019
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should add a line in the CHANGELOG since this fixes a bug.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-Authored-By: Haseeb Tariq <hasbro17@gmail.com>
Copy link
Contributor

@hasbro17 hasbro17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estroz estroz merged commit cf3aaf1 into operator-framework:master Jun 7, 2019
@estroz estroz deleted the fix-build-trimpath branch June 7, 2019 21:21
estroz pushed a commit to estroz/operator-sdk that referenced this pull request Jul 19, 2019
* cmd/operator-sdk/build: expand env in go build

* internal/util/projutil: always append os.Environ() to go cmds

* CHANGELOG.md: add bug fix for env expansion in operator-sdk build

Co-Authored-By: Haseeb Tariq <hasbro17@gmail.com>
estroz pushed a commit that referenced this pull request Jul 19, 2019
* cmd/operator-sdk/build: expand env in go build

* internal/util/projutil: always append os.Environ() to go cmds

* CHANGELOG.md: add bug fix for env expansion in operator-sdk build

Co-Authored-By: Haseeb Tariq <hasbro17@gmail.com>
joel-bluedata added a commit to joel-bluedata/kubedirector that referenced this pull request Feb 11, 2020
This removes $GOPATH from the beginning of the filepaths built into the object, and e.g. shown in stacktraces.

The operator-sdk build is supposed to do this as well, although with our version of the operator SDK you need to backport this fix to your own local copy before building/installing it: operator-framework/operator-sdk#1535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error stack trace still shows the user GOPATH
5 participants