Browse code

Use vendor instead of Godeps/_workspace in builds

Clayton Coleman authored on 2016/07/04 09:38:25
Showing 26 changed files
... ...
@@ -87,7 +87,7 @@ To enable running the kubernetes unit tests:
87 87
 
88 88
 To run unit test for an individual kubernetes package:
89 89
 
90
-    $ hack/test-go.sh Godeps/_workspace/src/k8s.io/kubernetes/examples
90
+    $ hack/test-go.sh vendor/k8s.io/kubernetes/examples
91 91
 
92 92
 To change the coverage mode, which is `-cover -covermode=atomic` by default, use:
93 93
 
... ...
@@ -217,7 +217,7 @@ Docker. More information about running extended tests can be found in [test/exte
217 217
 
218 218
 OpenShift and Kubernetes use [Godep](https://github.com/tools/godep) for dependency management.
219 219
 Godep allows versions of dependent packages to be locked at a specific commit by *vendoring* them
220
-(checking a copy of them into `Godeps/_workspace/`).  This means that everything you need for
220
+(checking a copy of them into `vendor/`).  This means that everything you need for
221 221
 OpenShift is checked into this repository.  To install `godep` locally run:
222 222
 
223 223
     $ go get github.com/tools/godep
... ...
@@ -374,7 +374,7 @@ of Origin to your GOPATH.
374 374
 of Kubernetes to your GOPATH.
375 375
 5. `$ cd $GOPATH/src/github.com/openshift/origin`.
376 376
 6. `$ make clean ; godep save ./...` will save a list of the checked-out dependencies to the file
377
-`Godeps/Godeps.json`, and copy their source code into `Godeps/_workspace`.
377
+`Godeps/Godeps.json`, and copy their source code into `vendor`.
378 378
 7. If in the previous step godep complaints about the checked out revision of a package being different
379 379
 than the wanted revision, this probably means there are new packages in Kubernetes that we need to add.
380 380
 Do a `godep save <pkgname>` with the package specified by the error message and then `$ godep save ./...`
... ...
@@ -448,7 +448,7 @@ A typical pull request for your Kubernetes rebase will contain:
448 448
 
449 449
 To update to a new version of a dependency that's not already included in Kubernetes, checkout the
450 450
 correct version in your GOPATH and then run `godep save <pkgname>`.  This should create a new
451
-version of `Godeps/Godeps.json`, and update `Godeps/_workspace/src`.  Create a commit that includes
451
+version of `Godeps/Godeps.json`, and update `vendor`.  Create a commit that includes
452 452
 both of these changes with message `bump(<pkgname>): <pkgcommit>`.
453 453
 
454 454
 ## Updating external examples
... ...
@@ -9,7 +9,6 @@
9 9
 #   clean: Clean up.
10 10
 
11 11
 OUT_DIR = _output
12
-OUT_PKG_DIR = Godeps/_workspace/pkg
13 12
 OS_OUTPUT_GOPATH ?= 1
14 13
 
15 14
 export GOFLAGS
... ...
@@ -33,6 +32,16 @@ all build:
33 33
 	hack/build-go.sh $(WHAT)
34 34
 .PHONY: all build
35 35
 
36
+# Build the test binaries.
37
+#
38
+# Example:
39
+#   make build-tests
40
+build-tests:
41
+	hack/build-go.sh test/extended/extended.test
42
+	hack/build-go.sh test/extended/networking/extended.test
43
+	hack/build-go.sh test/integration/integration.test -tags='integration docker'
44
+.PHONY: build-tests
45
+
36 46
 # Run core verification and all self contained tests.
37 47
 #
38 48
 # Example:
... ...
@@ -47,7 +56,7 @@ check: | build verify
47 47
 # Example:
48 48
 #   make verify
49 49
 verify: build
50
-	hack/build-go.sh test/extended/extended.test test/extended/networking/extended.test test/integration/integration.test -tags='integration docker'
50
+	# build-tests is disabled until we can determine why memory usage is so high
51 51
 	hack/verify-upstream-commits.sh
52 52
 	hack/verify-gofmt.sh
53 53
 	hack/verify-govet.sh
... ...
@@ -154,7 +163,7 @@ run: build
154 154
 # Example:
155 155
 #   make clean
156 156
 clean:
157
-	rm -rf $(OUT_DIR) $(OUT_PKG_DIR)
157
+	rm -rf $(OUT_DIR)
158 158
 .PHONY: clean
159 159
 
160 160
 # Build an official release of OpenShift, including the official images.
... ...
@@ -63,14 +63,14 @@ if [[ -z "${NO_REBASE-}" ]]; then
63 63
   # stage any new files
64 64
   git add . > /dev/null
65 65
   # construct a new patch
66
-  git diff --cached -p --raw --binary --{src,dst}-prefix=a/Godeps/_workspace/src/${repo}/ > "${patch}"
66
+  git diff --cached -p --raw --binary --{src,dst}-prefix=a/vendor/${repo}/ > "${patch}"
67 67
   # cleanup the current state
68 68
   git reset HEAD --hard > /dev/null
69 69
   git checkout master > /dev/null
70 70
   git branch -D last_upstream_branch > /dev/null
71 71
 else
72 72
   echo "++ Generating patch for ${selector} without rebasing ..." 2>&1
73
-  git diff -p --raw --binary --{src,dst}-prefix=a/Godeps/_workspace/src/${repo}/ "${selector}" > "${patch}"
73
+  git diff -p --raw --binary --{src,dst}-prefix=a/vendor/${repo}/ "${selector}" > "${patch}"
74 74
 fi
75 75
 
76 76
 popd > /dev/null
... ...
@@ -30,11 +30,6 @@ readonly OS_LOCAL_RELEASEPATH="${OS_OUTPUT}/releases"
30 30
 readonly OS_OUTPUT_BINPATH="${OS_OUTPUT}/bin"
31 31
 
32 32
 readonly OS_GO_PACKAGE=github.com/openshift/origin
33
-readonly OS_GOPATH=$(
34
-  unset CDPATH
35
-  cd ${OS_ROOT}/../../../..
36
-  pwd
37
-)
38 33
 
39 34
 readonly OS_IMAGE_COMPILE_PLATFORMS=(
40 35
   linux/amd64
... ...
@@ -191,23 +186,30 @@ EOF
191 191
   if [[ "${TRAVIS:-}" != "true" ]]; then
192 192
     local go_version
193 193
     go_version=($(go version))
194
-    if [[ "${go_version[2]}" < "go1.4" ]]; then
194
+    if [[ "${go_version[2]}" < "go1.5" ]]; then
195 195
       cat <<EOF
196 196
 
197 197
 Detected Go version: ${go_version[*]}.
198
-Origin builds require Go version 1.4 or greater.
198
+Origin builds require Go version 1.6 or greater.
199 199
 
200 200
 EOF
201 201
       exit 2
202 202
     fi
203 203
   fi
204
+  # For any tools that expect this to be set (it is default in golang 1.6),
205
+  # force vendor experiment.
206
+  export GO15VENDOREXPERIMENT=1
204 207
 
205 208
   unset GOBIN
206 209
 
210
+  # default to OS_OUTPUT_GOPATH if no GOPATH set
211
+  if [[ -z "${GOPATH:-}" ]]; then
212
+    export OS_OUTPUT_GOPATH=1
213
+  fi
214
+
207 215
   # use the regular gopath for building
208 216
   if [[ -z "${OS_OUTPUT_GOPATH:-}" ]]; then
209
-    export GOPATH=${OS_ROOT}/Godeps/_workspace:${OS_GOPATH}
210
-    export OS_TARGET_BIN=${OS_GOPATH}/bin
217
+    export OS_TARGET_BIN=${GOPATH}/bin
211 218
     return
212 219
   fi
213 220
 
... ...
@@ -223,18 +225,15 @@ EOF
223 223
   # TODO: This symlink should be relative.
224 224
   ln -s "${OS_ROOT}" "${go_pkg_dir}"
225 225
 
226
+  # lots of tools "just don't work" unless we're in the GOPATH
227
+  cd "${go_pkg_dir}"
228
+
226 229
   # Append OS_EXTRA_GOPATH to the GOPATH if it is defined.
227 230
   if [[ -n ${OS_EXTRA_GOPATH:-} ]]; then
228 231
     GOPATH="${GOPATH}:${OS_EXTRA_GOPATH}"
229 232
     # TODO: needs to handle multiple directories
230 233
     OS_TARGET_BIN=${OS_EXTRA_GOPATH}/bin
231 234
   fi
232
-  # Append the tree maintained by `godep` to the GOPATH unless OS_NO_GODEPS
233
-  # is defined.
234
-  if [[ -z ${OS_NO_GODEPS:-} ]]; then
235
-    GOPATH="${GOPATH}:${OS_ROOT}/Godeps/_workspace"
236
-    OS_TARGET_BIN=${OS_ROOT}/Godeps/_workspace/bin
237
-  fi
238 235
   export GOPATH
239 236
   export OS_TARGET_BIN
240 237
 }
... ...
@@ -262,7 +261,7 @@ readonly -f os::build::build_static_binaries
262 262
 function os::build::build_binaries() {
263 263
   local -a binaries=( "$@" )
264 264
   # Create a sub-shell so that we don't pollute the outer environment
265
-  ( os::build::internal::build_binaries "${binaries[@]+"${binaries[@]}"}" )  
265
+  ( os::build::internal::build_binaries "${binaries[@]+"${binaries[@]}"}" )
266 266
 }
267 267
 
268 268
 # Build binary targets specified. Should always be run in a sub-shell so we don't leak GOBIN
... ...
@@ -740,8 +739,8 @@ function os::build::ldflags() {
740 740
   ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/pkg/version.minorFromGit" "${OS_GIT_MINOR}"))
741 741
   ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/pkg/version.versionFromGit" "${OS_GIT_VERSION}"))
742 742
   ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/pkg/version.commitFromGit" "${OS_GIT_COMMIT}"))
743
-  ldflags+=($(os::build::ldflag "k8s.io/kubernetes/pkg/version.gitCommit" "${OS_GIT_COMMIT}"))
744
-  ldflags+=($(os::build::ldflag "k8s.io/kubernetes/pkg/version.gitVersion" "${KUBE_GIT_VERSION}"))
743
+  ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/vendor/k8s.io/kubernetes/pkg/version.gitCommit" "${OS_GIT_COMMIT}"))
744
+  ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/vendor/k8s.io/kubernetes/pkg/version.gitVersion" "${KUBE_GIT_VERSION}"))
745 745
 
746 746
   # The -ldflags parameter takes a single string, so join the output.
747 747
   echo "${ldflags[*]-}"
... ...
@@ -12,8 +12,9 @@ source "${OS_ROOT}/hack/lib/init.sh"
12 12
 # Go to the top of the tree.
13 13
 cd "${OS_ROOT}"
14 14
 
15
+GODEP_ROOT="${OS_ROOT}/vendor"
15 16
 KUBE_ROOT=${1:-""}
16
-KUBE_GODEP_ROOT="${OS_ROOT}/Godeps/_workspace/src/k8s.io/kubernetes"
17
+KUBE_GODEP_ROOT="${GODEP_ROOT}/k8s.io/kubernetes"
17 18
 
18 19
 if [ -z "$KUBE_ROOT" ]; then
19 20
   echo "usage: copy-kube-artifacts.sh <kubernetes root dir>"
... ...
@@ -44,6 +45,7 @@ rsync -av \
44 44
 /docs/user-guide/simple-yaml.md
45 45
 /docs/user-guide/walkthrough/README.md
46 46
 /examples/***
47
+/federation/client/clientset_generated/**.go
47 48
 /pkg/***
48 49
 /plugin/***
49 50
 /test/e2e/***
... ...
@@ -52,3 +54,16 @@ rsync -av \
52 52
 /third_party/golang/***
53 53
 /README.md
54 54
 EOF
55
+
56
+# Copy extra vendored files that aren't direct dependencies of any package
57
+rsync -av \
58
+  --exclude='examples/blog-logging/diagrams/***' \
59
+  --exclude='pkg/ui/data/swagger/datafile.go' \
60
+  --include-from=- \
61
+  --include='*/' \
62
+  --exclude='*' \
63
+  --prune-empty-dirs \
64
+  $KUBE_ROOT/vendor/ $GODEP_ROOT <<EOF
65
+/github.com/golang/mock/gomock/**.go
66
+/github.com/google/cadvisor/info/v1/test/**.go
67
+EOF
... ...
@@ -12,15 +12,12 @@ os::log::stacktrace::install
12 12
 EXAMPLES=examples
13 13
 OUTPUT_PARENT=${OUTPUT_ROOT:-$OS_ROOT}
14 14
 
15
-pushd ${OS_ROOT}/Godeps/_workspace > /dev/null
16
-  godep_path=$(pwd)
17
-  pushd src/github.com/jteeuwen/go-bindata > /dev/null
18
-    GOPATH=$godep_path go install ./...
19
-  popd > /dev/null
15
+pushd vendor/github.com/jteeuwen/go-bindata > /dev/null
16
+  go install ./...
20 17
 popd > /dev/null
21 18
 
22 19
 pushd "${OS_ROOT}" > /dev/null
23
-  Godeps/_workspace/bin/go-bindata -nocompress -nometadata -prefix "bootstrap" -pkg "bootstrap" \
20
+  "${GOPATH}/bin/go-bindata" -nocompress -nometadata -prefix "bootstrap" -pkg "bootstrap" \
24 21
                                    -o "${OUTPUT_PARENT}/pkg/bootstrap/bindata.go" -ignore "README.md" \
25 22
                                    ${EXAMPLES}/image-streams/... \
26 23
                                    ${EXAMPLES}/db-templates/... \
... ...
@@ -47,8 +47,8 @@ fi
47 47
 
48 48
 echo "++ Generating patch for ${selector} onto ${lastrev} ..." 2>&1
49 49
 index=0
50
-for commit in $(git log --no-merges --format="%H" --reverse "${selector}" -- "Godeps/_workspace/src/${repo}/"); do
51
-  git format-patch --raw --start-number=${index} --relative="Godeps/_workspace/src/${repo}/" "${commit}^..${commit}" -o "${patch}"
50
+for commit in $(git log --no-merges --format="%H" --reverse "${selector}" -- "vendor/${repo}/"); do
51
+  git format-patch --raw --start-number=${index} --relative="vendor/${repo}/" "${commit}^..${commit}" -o "${patch}"
52 52
   let index+=10
53 53
 done
54 54
 
... ...
@@ -12,7 +12,7 @@ echo "This command will update Origin with the latest stable_proposed branch or
12 12
 echo "in your OpenShift fork of Kubernetes."
13 13
 echo
14 14
 echo "This command is destructive and will alter the contents of your GOPATH projects"
15
-echo 
15
+echo
16 16
 echo "Hit ENTER to continue or CTRL+C to cancel"
17 17
 read
18 18
 
... ...
@@ -32,7 +32,7 @@ popd > /dev/null
32 32
 pushd $GOPATH/src/k8s.io/kubernetes > /dev/null
33 33
 git checkout stable_proposed
34 34
 echo "Restoring any newer Kubernetes dependencies ..."
35
-rm -rf _output Godeps/_workspace/pkg
35
+rm -rf _output
36 36
 godep restore
37 37
 popd > /dev/null
38 38
 
... ...
@@ -130,11 +130,11 @@ function list_test_packages_under() {
130 130
     # arguments that use expansion, e.g. paths containing brace expansion or wildcards
131 131
     find ${basedir} -not \(                   \
132 132
         \(                                    \
133
-              -path 'Godeps'                  \
133
+              -path 'vendor'                  \
134 134
               -o -path '*_output'             \
135 135
               -o -path '*.git'                \
136 136
               -o -path '*openshift.local.*'   \
137
-              -o -path '*Godeps/*'            \
137
+              -o -path '*vendor/*'            \
138 138
               -o -path '*assets/node_modules' \
139 139
               -o -path '*test/*'              \
140 140
         \) -prune                             \
... ...
@@ -156,7 +156,7 @@ done
156 156
 gotest_flags+=" $*"
157 157
 
158 158
 # Determine packages to test
159
-godeps_package_prefix="Godeps/_workspace/src/"
159
+godeps_package_prefix="vendor/"
160 160
 test_packages=
161 161
 if [[ -n "${package_args}" ]]; then
162 162
     for package in ${package_args}; do
... ...
@@ -171,8 +171,8 @@ else
171 171
     # If no packages are given to test, we need to generate a list of all packages with unit tests
172 172
     openshift_test_packages="$(list_test_packages_under '*')"
173 173
 
174
-    kubernetes_path="Godeps/_workspace/src/k8s.io/kubernetes"
175
-    mandatory_kubernetes_packages="${OS_GO_PACKAGE}/${kubernetes_path}/pkg/api ${OS_GO_PACKAGE}/${kubernetes_path}/pkg/api/v1"
174
+    kubernetes_path="vendor/k8s.io/kubernetes"
175
+    mandatory_kubernetes_packages="./vendor/k8s.io/kubernetes/pkg/api ./vendor/k8s.io/kubernetes/pkg/api/v1"
176 176
 
177 177
     test_packages="${openshift_test_packages} ${mandatory_kubernetes_packages}"
178 178
 
... ...
@@ -184,12 +184,12 @@ else
184 184
           \(                                                                                          \
185 185
             -path "${kubernetes_path}/pkg/api"                                                        \
186 186
             -o -path "${kubernetes_path}/pkg/api/v1"                                                  \
187
-            -o -path "${kubernetes_path}/test/e2e"                                                    \
187
+            -o -path "${kubernetes_path}/test"                                                        \
188 188
             -o -path "${kubernetes_path}/cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned" \
189 189
             -o -path "${kubernetes_path}/pkg/storage/etcd3"                                           \
190 190
             -o -path "${kubernetes_path}/third_party/golang/go/build"                                 \
191 191
           \) -prune                                                                                   \
192
-        \) -name '*_test.go' | xargs -n1 dirname | sort -u | xargs -n1 printf "${OS_GO_PACKAGE}/%s\n")"
192
+        \) -name '*_test.go' | cut -f 2- -d / | xargs -n1 dirname | sort -u | xargs -n1 printf "./vendor/%s\n")"
193 193
 
194 194
         test_packages="${test_packages} ${optional_kubernetes_packages}"
195 195
     fi
... ...
@@ -208,7 +208,7 @@ fi
208 208
 # Run 'go test' with the accumulated arguments and packages:
209 209
 if [[ -n "${junit_report}" ]]; then
210 210
     # we need to generate jUnit xml
211
-    hack/build-go.sh tools/junitreport
211
+    "${OS_ROOT}/hack/build-go.sh" tools/junitreport
212 212
     junitreport="$(os::build::find-binary junitreport)"
213 213
 
214 214
     if [[ -z "${junitreport}" ]]; then
... ...
@@ -7,7 +7,9 @@ set -o pipefail
7 7
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
8 8
 source "${OS_ROOT}/hack/lib/init.sh"
9 9
 
10
-"${OS_ROOT}/hack/build-go.sh" Godeps/_workspace/src/k8s.io/kubernetes/cmd/libs/go2idl/client-gen
10
+os::build::setup_env
11
+
12
+"${OS_ROOT}/hack/build-go.sh" vendor/k8s.io/kubernetes/cmd/libs/go2idl/client-gen
11 13
 
12 14
 # Find binary
13 15
 clientgen="$(os::build::find-binary client-gen)"
... ...
@@ -10,7 +10,7 @@ OS_ROOT=$(dirname "${BASH_SOURCE}")/..
10 10
 source "${OS_ROOT}/hack/lib/init.sh"
11 11
 
12 12
 # ensure we have the latest compiled binaries
13
-(cd ${OS_ROOT} && make clean); "${OS_ROOT}/hack/build-go.sh"
13
+"${OS_ROOT}/hack/build-go.sh"
14 14
 
15 15
 platform="$(os::build::host_platform)"
16 16
 if [[ "${platform}" != "linux/amd64" ]]; then
... ...
@@ -10,9 +10,10 @@ source "${OS_ROOT}/hack/lib/init.sh"
10 10
 # Go to the top of the tree.
11 11
 cd "${OS_ROOT}"
12 12
 
13
+# Do not allow a synthetic GOPATH for these checks
13 14
 os::build::setup_env
14 15
 
15
-hack/build-go.sh tools/genconversion
16
+"${OS_ROOT}/hack/build-go.sh" tools/genconversion
16 17
 genconversion="$( os::build::find-binary genconversion )"
17 18
 
18 19
 if [[ -z "${genconversion}" ]]; then
... ...
@@ -23,4 +24,4 @@ if [[ -z "${genconversion}" ]]; then
23 23
 	exit 1
24 24
 fi
25 25
 
26
-${genconversion} --output-base="${OS_GOPATH}/src" "$@"
27 26
\ No newline at end of file
27
+${genconversion} --output-base="${GOPATH}/src" "$@"
28 28
\ No newline at end of file
... ...
@@ -10,9 +10,10 @@ source "${OS_ROOT}/hack/lib/init.sh"
10 10
 # Go to the top of the tree.
11 11
 cd "${OS_ROOT}"
12 12
 
13
+# Do not allow a synthetic GOPATH for these checks
13 14
 os::build::setup_env
14 15
 
15
-hack/build-go.sh tools/gendeepcopy
16
+"${OS_ROOT}/hack/build-go.sh" tools/gendeepcopy
16 17
 gendeepcopy="$( os::build::find-binary gendeepcopy )"
17 18
 
18 19
 if [[ -z "${gendeepcopy}" ]]; then
... ...
@@ -23,4 +24,4 @@ if [[ -z "${gendeepcopy}" ]]; then
23 23
 	exit 1
24 24
 fi
25 25
 
26
-${gendeepcopy} --output-base="${OS_GOPATH}/src" "$@"
27 26
\ No newline at end of file
27
+${gendeepcopy} --output-base="${GOPATH}/src" "$@"
28 28
\ No newline at end of file
... ...
@@ -2,7 +2,7 @@
2 2
 #
3 3
 # This script generates methods to allow our API objects to describe themsleves for the Swagger tool
4 4
 # by reading the current version of the Godoc for the objects. This script can either generate new
5
-# documentation or verify that the documentation currently in the repository remains valid. 
5
+# documentation or verify that the documentation currently in the repository remains valid.
6 6
 #
7 7
 # This script accepts the following parameters as environment variables:
8 8
 #  - VERIFY:  run the script to verify current documentation
... ...
@@ -23,7 +23,7 @@ dryrun="${DRY_RUN:-}"
23 23
 
24 24
 mkdir -p /tmp/openshift/generate/swaggerdoc
25 25
 
26
-hack/build-go.sh tools/genswaggerdoc
26
+"${OS_ROOT}/hack/build-go.sh" tools/genswaggerdoc
27 27
 genswaggerdoc="$( os::build::find-binary genswaggerdoc )"
28 28
 
29 29
 if [[ -z "${genswaggerdoc}" ]]; then
... ...
@@ -64,7 +64,7 @@ for file in ${source_files}; do
64 64
 " >> "${tmp_output_file}"
65 65
 		${genswaggerdoc} --input="${file}" --output="${tmp_output_file}"
66 66
 		gofmt -s -w "${tmp_output_file}"
67
-		
67
+
68 68
 		if [[ -n "${verify}" ]]; then
69 69
 			if ! diff --new-file --unified=3 --text "${tmp_output_file}" "${swagger_file}"; then
70 70
 				echo "[ERROR] Generated Swagger documentation at \"${swagger_file}\" is out of date."
... ...
@@ -560,7 +560,7 @@ function cleanup_openshift() {
560 560
 	set +e
561 561
 	dump_container_logs
562 562
 
563
- 	# pull information out of the server log so that we can get failure management in jenkins to highlight it and 
563
+ 	# pull information out of the server log so that we can get failure management in jenkins to highlight it and
564 564
 	# really have it smack people in their logs.  This is a severe correctness problem
565 565
 	grep -a5 "CACHE.*ALTERED" ${LOG_DIR}/openshift.log
566 566
 
... ...
@@ -758,7 +758,7 @@ function find_files() {
758 758
 		-o -wholename './pkg/assets/*/bindata.go' \
759 759
 		-o -wholename './pkg/bootstrap/bindata.go' \
760 760
 		-o -wholename './openshift.local.*' \
761
-		-o -wholename '*/Godeps/*' \
761
+		-o -wholename '*/vendor/*' \
762 762
 		-o -wholename './assets/bower_components/*' \
763 763
 		\) -prune \
764 764
 	\) -name '*.go' | sort -u
... ...
@@ -1,5 +1,5 @@
1
-#!/bin/bash 
2
-# 
1
+#!/bin/bash
2
+#
3 3
 #  This script vendors the Web Console source files into bindata.go files that can be built into the openshift binary.
4 4
 #
5 5
 #  Accepted environment variables are:
... ...
@@ -9,8 +9,8 @@
9 9
 #   - CONSOLE_REPO_PATH: specifies a directory path to look for the web console repo.  If not set it is assumed to be
10 10
 #                        a sibling to this repository.
11 11
 
12
-set -o errexit 
13
-set -o nounset 
12
+set -o errexit
13
+set -o nounset
14 14
 set -o pipefail
15 15
 
16 16
 OS_ROOT=$(dirname "${BASH_SOURCE}")/..
... ...
@@ -25,16 +25,13 @@ if [[ ! -d "$CONSOLE_REPO_PATH" ]]; then
25 25
 fi
26 26
 
27 27
 echo "Making sure go-bindata binary has been built..."
28
-pushd "${OS_ROOT}/Godeps/_workspace" > /dev/null
29
-  godep_path=$(pwd)
30
-  pushd src/github.com/jteeuwen/go-bindata > /dev/null
31
-    GOPATH=$godep_path go install ./...
32
-  popd > /dev/null
28
+pushd vendor/github.com/jteeuwen/go-bindata > /dev/null
29
+  go install ./...
33 30
 popd > /dev/null
34 31
 
35
-if [[ -z "${GIT_REF:+x}" ]]; then 
32
+if [[ -z "${GIT_REF:+x}" ]]; then
36 33
   echo "No git ref specified, using current state of the repo including any unstaged changes...";
37
-else 
34
+else
38 35
   echo "Using git ref ${GIT_REF} ..."
39 36
   pushd "${CONSOLE_REPO_PATH}" > /dev/null
40 37
     if [[ -n "$(git status --porcelain -uall)" ]]; then
... ...
@@ -52,9 +49,9 @@ pushd "${OS_ROOT}" > /dev/null
52 52
   # Put each component in its own go package for compilation performance
53 53
   # Strip off the dist folder from each package to flatten the resulting directory structure
54 54
   # Force timestamps to unify, and mode to 493 (0755)
55
-  Godeps/_workspace/bin/go-bindata -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist"      -pkg "assets" -o "pkg/assets/bindata.go"      "${CONSOLE_REPO_PATH}/dist/..."
56
-  Godeps/_workspace/bin/go-bindata -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist.java" -pkg "java"   -o "pkg/assets/java/bindata.go" "${CONSOLE_REPO_PATH}/dist.java/..."
57
-  
55
+  "${GOPATH}/bin/go-bindata" -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist"      -pkg "assets" -o "pkg/assets/bindata.go"      "${CONSOLE_REPO_PATH}/dist/..."
56
+  "${GOPATH}/bin/go-bindata" -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist.java" -pkg "java"   -o "pkg/assets/java/bindata.go" "${CONSOLE_REPO_PATH}/dist.java/..."
57
+
58 58
   if [[ -n "${COMMIT:+x}" ]]; then
59 59
     if [[ -n "$(git status --porcelain)" ]]; then
60 60
       echo "Creating branch and commit..."
... ...
@@ -8,7 +8,7 @@ cat <<EOF > ${build_script_path}
8 8
 
9 9
 function chown_output {
10 10
     if [ ! -z "$OWNER_GROUP" ]; then
11
-        chown -R "$OWNER_GROUP" Godeps/_workspace/pkg _output
11
+        chown -R "$OWNER_GROUP" _output
12 12
     fi
13 13
 }
14 14
 
... ...
@@ -182,7 +182,7 @@ popd
182 182
 mkdir _thirdpartyhacks
183 183
 pushd _thirdpartyhacks
184 184
     ln -s \
185
-        $(dirs +1 -l)/Godeps/_workspace/src/ \
185
+        $(dirs +1 -l)/vendor/ \
186 186
             src
187 187
 popd
188 188
 export GOPATH=$(pwd)/_build:$(pwd)/_thirdpartyhacks:%{buildroot}%{gopath}:%{gopath}
... ...
@@ -56,7 +56,7 @@ func getOrCreateOriginKinds() map[unversioned.GroupVersionKind]bool {
56 56
 			// enumerate all supported versions, get the kinds, and register with the mapper how to address our resources
57 57
 			for _, version := range Versions {
58 58
 				for kind, t := range api.Scheme.KnownTypes(version) {
59
-					if !strings.Contains(t.PkgPath(), "openshift/origin") {
59
+					if !strings.Contains(t.PkgPath(), "github.com/openshift/origin") || strings.Contains(t.PkgPath(), "github.com/openshift/origin/vendor/") {
60 60
 						continue
61 61
 					}
62 62
 					gvk := version.WithKind(kind)
... ...
@@ -34,7 +34,7 @@ func checkDescriptions(objType reflect.Type, seen *map[reflect.Type]bool, t *tes
34 34
 		return
35 35
 	}
36 36
 	(*seen)[objType] = true
37
-	if !strings.Contains(objType.PkgPath(), "openshift/origin") {
37
+	if !strings.Contains(objType.PkgPath(), "github.com/openshift/origin/pkg") {
38 38
 		return
39 39
 	}
40 40
 
... ...
@@ -79,7 +79,7 @@ func checkJsonTags(objType reflect.Type, seen *map[reflect.Type]bool, t *testing
79 79
 		return
80 80
 	}
81 81
 	(*seen)[objType] = true
82
-	if !strings.Contains(objType.PkgPath(), "openshift/origin") {
82
+	if !strings.Contains(objType.PkgPath(), "github.com/openshift/origin/pkg") {
83 83
 		return
84 84
 	}
85 85
 	if internalTypesWithAllowedJsonTags.Has(objType.Name()) {
... ...
@@ -475,7 +475,7 @@ func TestTypes(t *testing.T) {
475 475
 
476 476
 	for internalVersion, externalVersions := range internalVersionToExternalVersions {
477 477
 		for kind, reflectType := range kapi.Scheme.KnownTypes(internalVersion) {
478
-			if !strings.Contains(reflectType.PkgPath(), "/origin/") && reflectType.PkgPath() != "k8s.io/kubernetes/pkg/api" {
478
+			if !strings.Contains(reflectType.PkgPath(), "github.com/openshift/origin/") && reflectType.PkgPath() != "github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/api" {
479 479
 				continue
480 480
 			}
481 481
 			if nonInternalRoundTrippableTypes.Has(kind) {
... ...
@@ -39,7 +39,7 @@ var MissingValidationExceptions = []reflect.Type{
39 39
 
40 40
 func TestCoverage(t *testing.T) {
41 41
 	for kind, apiType := range kapi.Scheme.KnownTypes(api.SchemeGroupVersion) {
42
-		if !strings.Contains(apiType.PkgPath(), "openshift/origin") {
42
+		if strings.HasPrefix(apiType.PkgPath(), "github.com/openshift/origin/vendor/") {
43 43
 			continue
44 44
 		}
45 45
 		if strings.HasSuffix(kind, "List") {
... ...
@@ -89,7 +89,7 @@ func TestDescriberCoverage(t *testing.T) {
89 89
 
90 90
 main:
91 91
 	for _, apiType := range kapi.Scheme.KnownTypes(api.SchemeGroupVersion) {
92
-		if !strings.Contains(apiType.PkgPath(), "openshift/origin") {
92
+		if !strings.HasPrefix(apiType.PkgPath(), "github.com/openshift/origin") || strings.HasPrefix(apiType.PkgPath(), "github.com/openshift/origin/vendor/") {
93 93
 			continue
94 94
 		}
95 95
 		// we don't describe lists
... ...
@@ -65,7 +65,7 @@ func TestPrinterCoverage(t *testing.T) {
65 65
 
66 66
 main:
67 67
 	for _, apiType := range kapi.Scheme.KnownTypes(api.SchemeGroupVersion) {
68
-		if !strings.Contains(apiType.PkgPath(), "openshift/origin") {
68
+		if !strings.Contains(apiType.PkgPath(), "github.com/openshift/origin") || strings.Contains(apiType.PkgPath(), "github.com/openshift/origin/vendor/") {
69 69
 			continue
70 70
 		}
71 71
 
... ...
@@ -41,7 +41,7 @@ Extended tests live under the `./test/extended` directory in the origin reposito
41 41
 The structure of this directory is following:
42 42
 
43 43
 * [**`test/extended/util`**](util) provides useful helpers and utilities to use in your extended test. It provides a easy-to-use interface to OpenShift CLI and also
44
-access to the Kubernetes [E2E framework](https://github.com/openshift/origin/tree/master/Godeps/_workspace/src/k8s.io/kubernetes/test/e2e) helpers. It also contains OpenShift helpers that are shared across multiple test cases, to make the test cases more DRY.
44
+access to the Kubernetes [E2E framework](https://github.com/openshift/origin/tree/master/vendor/k8s.io/kubernetes/test/e2e) helpers. It also contains OpenShift helpers that are shared across multiple test cases, to make the test cases more DRY.
45 45
 * [**`test/extended/fixtures`**](fixtures) contains the JSON and YAML fixtures that are meant to be used by the extended tests.
46 46
 * [**`test/extended/[images,builds,...]`**](builds) each of these Go packages contains extended tests that are related to each other. For example, the `images` directory should contain test cases that are exercising usage of various Docker images in OpenShift.
47 47
 * [**`hack/test-extended/[group]/run.sh`**](../../hack/test-extended) is the shell script that sets up any needed dependencies and then launches the extended tests whose top level ginkgo spec's Describe call reference the [group](#groups-vs-packages)
... ...
@@ -26,7 +26,7 @@ function os::test::extended::setup {
26 26
 
27 27
   # build binaries
28 28
   if [[ -z $(os::build::find-binary ginkgo) ]]; then
29
-    hack/build-go.sh Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo
29
+    hack/build-go.sh vendor/github.com/onsi/ginkgo/ginkgo
30 30
   fi
31 31
   if [[ -z $(os::build::find-binary extended.test) ]]; then
32 32
     hack/build-go.sh test/extended/extended.test
... ...
@@ -43,7 +43,7 @@ function os::test::extended::setup {
43 43
   export EXTENDEDTEST="$(os::build::find-binary extended.test)"
44 44
   export TMPDIR=${BASETMPDIR:-/tmp}
45 45
   export EXTENDED_TEST_PATH="$(pwd)/test/extended"
46
-  export KUBE_REPO_ROOT="$(pwd)/Godeps/_workspace/src/k8s.io/kubernetes"
46
+  export KUBE_REPO_ROOT="$(pwd)/vendor/k8s.io/kubernetes"
47 47
 
48 48
   # output tests instead of running
49 49
   if [[ -n "${SHOW_ALL:-}" ]]; then