From 35f03d424191f40718d03791f6d2141fdabe2484 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 10 Sep 2014 14:32:44 -0400 Subject: [PATCH 1/2] KUBE_EXTRA_GOPATH to append to the GOPATH So you can add your own package to the GOPATH outside of the kube tree --- hack/config-go.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/config-go.sh b/hack/config-go.sh index d49b8a0688e..eb3ee198cba 100644 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -105,8 +105,13 @@ kube::setup_go_environment() { fi fi + GOPATH=${KUBE_TARGET} + # Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined. + if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then + GOPATH=${GOPATH}:${KUBE_EXTRA_GOPATH} + fi # Set GOPATH to point to the tree maintained by `godep`. - GOPATH="${KUBE_TARGET}:${KUBE_REPO_ROOT}/Godeps/_workspace" + GOPATH="${GOPATH}:${KUBE_REPO_ROOT}/Godeps/_workspace" export GOPATH # Unset GOBIN in case it already exists in the current session. From df5fe66636fef666973ae84db62bf0ac7ef8cbcf Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 10 Sep 2014 14:49:26 -0400 Subject: [PATCH 2/2] KUBE_NO_GODEPS to not use in tree godeps If this is set, and it normally shouldn't be, the config file will not add the in tree Godeps to the GOPATH. So all of them must be solved by the KUBE_EXTRA_GOPATH --- hack/config-go.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hack/config-go.sh b/hack/config-go.sh index eb3ee198cba..3904f57ed3b 100644 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -110,8 +110,11 @@ kube::setup_go_environment() { if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then GOPATH=${GOPATH}:${KUBE_EXTRA_GOPATH} fi - # Set GOPATH to point to the tree maintained by `godep`. - GOPATH="${GOPATH}:${KUBE_REPO_ROOT}/Godeps/_workspace" + # Append the tree maintained by `godep` to the GOPATH unless KUBE_NO_GODEPS + # is defined. + if [[ -z ${KUBE_NO_GODEPS:-} ]]; then + GOPATH="${GOPATH}:${KUBE_REPO_ROOT}/Godeps/_workspace" + fi export GOPATH # Unset GOBIN in case it already exists in the current session.