Skip to content

Commit

Permalink
Merge pull request kubernetes#70718 from cblecker/godep-round-a-million
Browse files Browse the repository at this point in the history
Fork godep to fix inconsistent abbreviation size
  • Loading branch information
k8s-ci-robot authored Nov 8, 2018
2 parents 66989e8 + c0967ed commit e998d6c
Show file tree
Hide file tree
Showing 56 changed files with 329 additions and 383 deletions.
563 changes: 279 additions & 284 deletions Godeps/Godeps.json

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions Godeps/LICENSES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hack/godep-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ fi
kube::util::ensure_godep_version

kube::log::status "Downloading dependencies - this might take a while"
GOPATH="${GOPATH}:${KUBE_ROOT}/staging" godep restore "$@"
GOPATH="${GOPATH}:${KUBE_ROOT}/staging" ${KUBE_GODEP:?} restore "$@"
kube::log::status "Done"
3 changes: 1 addition & 2 deletions hack/godep-save.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fi
REQUIRED_BINS=(
"github.com/onsi/ginkgo/ginkgo"
"github.com/jteeuwen/go-bindata/go-bindata"
"github.com/tools/godep"
"github.com/client9/misspell/cmd/misspell"
"github.com/cloudflare/cfssl/cmd/cfssl"
"github.com/cloudflare/cfssl/cmd/cfssljson"
Expand All @@ -71,7 +70,7 @@ kube::log::status "Running godep save - this might take a while"
# This uses $(pwd) rather than ${KUBE_ROOT} because KUBE_ROOT will be
# realpath'ed, and godep barfs ("... is not using a known version control
# system") on our staging dirs.
GOPATH="${GOPATH}:$(pwd)/staging" godep save "${REQUIRED_BINS[@]}"
GOPATH="${GOPATH}:$(pwd)/staging" ${KUBE_GODEP:?} save "${REQUIRED_BINS[@]}"

# create a symlink in vendor directory pointing to the staging client. This
# let other packages use the staging client as if it were vendored.
Expand Down
36 changes: 19 additions & 17 deletions hack/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,28 +441,30 @@ kube::util::ensure_clean_working_dir() {

# Ensure that the given godep version is installed and in the path. Almost
# nobody should use any version but the default.
#
# Sets:
# KUBE_GODEP: The path to the godep binary
#
kube::util::ensure_godep_version() {
GODEP_VERSION=${1:-"v80"} # this version is known to work
local godep_target_version=${1:-"v80-k8s-r1"} # this version is known to work

if [[ "$(godep version 2>/dev/null)" == *"godep ${GODEP_VERSION}"* ]]; then
# If KUBE_GODEP is already set, and it's the right version, then use it.
if [[ -n "${KUBE_GODEP:-}" && "$(${KUBE_GODEP:?} version 2>/dev/null)" == *"godep ${godep_target_version}"* ]]; then
kube::log::status "Using ${KUBE_GODEP}"
return
fi

kube::log::status "Installing godep version ${GODEP_VERSION}"
go install k8s.io/kubernetes/vendor/github.com/tools/godep/
if ! which godep >/dev/null 2>&1; then
kube::log::error "Can't find godep - is your GOPATH 'bin' in your PATH?"
kube::log::error " GOPATH: ${GOPATH}"
kube::log::error " PATH: ${PATH}"
return 1
fi

if [[ "$(godep version 2>/dev/null)" != *"godep ${GODEP_VERSION}"* ]]; then
kube::log::error "Wrong godep version - is your GOPATH 'bin' in your PATH?"
kube::log::error " expected: godep ${GODEP_VERSION}"
kube::log::error " got: $(godep version)"
kube::log::error " GOPATH: ${GOPATH}"
kube::log::error " PATH: ${PATH}"
# Otherwise, install forked godep
kube::log::status "Installing godep version ${godep_target_version}"
# Run in hermetic GOPATH
kube::golang::setup_env
go install k8s.io/kubernetes/third_party/forked/godep
export KUBE_GODEP="${KUBE_GOPATH}/bin/godep"
kube::log::status "Installed ${KUBE_GODEP}"

# Verify that the installed godep from fork is what we expect
if [[ "$(${KUBE_GODEP:?} version 2>/dev/null)" != *"godep ${godep_target_version}"* ]]; then
kube::log::error "Expected godep ${godep_target_version} from ${KUBE_GODEP}, got $(${KUBE_GODEP:?} version)"
return 1
fi
}
Expand Down
2 changes: 1 addition & 1 deletion hack/update-staging-godeps-dockerized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function updateGodepManifest() {
pushd "${TMP_GOPATH}/src/k8s.io/${repo}" >/dev/null
kube::log::status "Updating godeps for k8s.io/${repo}"
rm -rf Godeps # remove the current Godeps.json so we always rebuild it
GOPATH="${TMP_GOPATH}:${GOPATH}:${GOPATH}/src/k8s.io/kubernetes/staging" godep save ${GODEP_OPTS} ./... 2>&1 | sed 's/^/ /'
GOPATH="${TMP_GOPATH}:${GOPATH}:${GOPATH}/src/k8s.io/kubernetes/staging" ${KUBE_GODEP:?} save ${GODEP_OPTS} ./... 2>&1 | sed 's/^/ /'

# Rewriting Godeps.json to cross-out commits that don't really exist because we haven't pushed the prereqs yet
local repo
Expand Down
3 changes: 1 addition & 2 deletions hack/verify-godeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function cleanup {
echo "Removing ${_tmpdir}"
rm -rf "${_tmpdir}"
fi
export GODEP=""
}
trap cleanup EXIT

Expand Down Expand Up @@ -85,7 +84,7 @@ ret=0

pushd "${KUBE_ROOT}" > /dev/null 2>&1
# Test for diffs
if ! _out="$(diff -Naupr --ignore-matching-lines='^\s*\"GoVersion\":' --ignore-matching-line='^\s*\"GodepVersion\":' --ignore-matching-lines='^\s*\"Comment\":' Godeps/Godeps.json ${_kubetmp}/Godeps/Godeps.json)"; then
if ! _out="$(diff -Naupr --ignore-matching-lines='^\s*\"GoVersion\":' Godeps/Godeps.json ${_kubetmp}/Godeps/Godeps.json)"; then
echo "Your Godeps.json is different:" >&2
echo "${_out}" >&2
echo "Godeps Verify failed." >&2
Expand Down
2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/apimachinery/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/apiserver/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/cli-runtime/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/client-go/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/cloud-provider/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/cluster-bootstrap/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/code-generator/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/csi-api/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/kube-proxy/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/kube-scheduler/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/kubelet/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/metrics/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/sample-controller/Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ filegroup(
"//third_party/forked/etcd221/wal:all-srcs",
"//third_party/forked/etcd237/pkg/fileutil:all-srcs",
"//third_party/forked/etcd237/wal:all-srcs",
"//third_party/forked/godep:all-srcs",
"//third_party/forked/golang/expansion:all-srcs",
"//third_party/forked/golang/reflect:all-srcs",
"//third_party/forked/golang/template:all-srcs",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

licenses(["notice"])

go_library(
name = "go_default_library",
srcs = [
Expand All @@ -24,8 +26,7 @@ go_library(
"vcs.go",
"version.go",
],
importmap = "k8s.io/kubernetes/vendor/github.com/tools/godep",
importpath = "github.com/tools/godep",
importpath = "k8s.io/kubernetes/third_party/forked/godep",
visibility = ["//visibility:private"],
deps = [
"//vendor/github.com/kr/fs:go_default_library",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (g *Godeps) save() (int64, error) {
}

func (g *Godeps) writeTo(w io.Writer) (int64, error) {
g.GodepVersion = fmt.Sprintf("v%d", version) // godep always writes its current version.
g.GodepVersion = fmt.Sprintf("v%s", version) // godep always writes its current version.
b, err := json.MarshalIndent(g, "", "\t")
if err != nil {
return 0, err
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var vcsGit = &VCS{
vcs: vcs.ByCmd("git"),

IdentifyCmd: "rev-parse HEAD",
DescribeCmd: "describe --tags",
DescribeCmd: "describe --tags --abbrev=14",
DiffCmd: "diff {rev}",
ListCmd: "ls-files --full-name",
RootCmd: "rev-parse --show-cdup",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
)

const version = 80
const version = "80-k8s-r1"

var cmdVersion = &Command{
Name: "version",
Expand All @@ -21,7 +21,7 @@ Displays the version of godep as well as the target OS, architecture and go runt
}

func versionString() string {
return fmt.Sprintf("godep v%d (%s/%s/%s)", version, runtime.GOOS, runtime.GOARCH, runtime.Version())
return fmt.Sprintf("godep v%s (%s/%s/%s)", version, runtime.GOOS, runtime.GOARCH, runtime.Version())
}

func runVersion(cmd *Command, args []string) {
Expand Down
2 changes: 0 additions & 2 deletions vendor/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ filegroup(
"//vendor/bitbucket.org/ww/goautoneg:all-srcs",
"//vendor/cloud.google.com/go/compute/metadata:all-srcs",
"//vendor/cloud.google.com/go/internal:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:all-srcs",
Expand Down Expand Up @@ -364,7 +363,6 @@ filegroup(
"//vendor/github.com/stretchr/testify/require:all-srcs",
"//vendor/github.com/syndtr/gocapability/capability:all-srcs",
"//vendor/github.com/tmc/grpc-websocket-proxy/wsproxy:all-srcs",
"//vendor/github.com/tools/godep:all-srcs",
"//vendor/github.com/ugorji/go/codec:all-srcs",
"//vendor/github.com/vishvananda/netlink:all-srcs",
"//vendor/github.com/vishvananda/netns:all-srcs",
Expand Down
Loading

0 comments on commit e998d6c

Please sign in to comment.