hack/versions: extract most from vendor.conf
This sets `$what_VERSION` and `$what_REPO` for runc, cni, containerd and kubernetes based on vendor.conf, removing the need to duplicate things in hack/versions. With this `update_hack_versions` becomes redundant so remove it and both calls. Since CONTAINERD_REPO is now unconditionally set we can also simplify the fetching of vendor.conf in update-vendor.sh a bit, so do so. Further since `*_REPO` are now unconditionally set we can support alternative clone paths for all of these repos by adjusting checkout_repo to make the 3rd argument non-optional and always passing it. Since `CRITOOL_VERSION` is not coming from `vendor.conf` (since it is not used from Go code) we manually set `CRITOOL_REPO` for consistency. The final wrinkle is that `k8s.io/kubernetes` is has a Go specific redirect in the form of HTML meta headers returned from https://k8s.io/kubernetes/?go-get=1 which point to the real repo to clone. Parsing that in shell is tricky so just hardcode that. Fixes #540. Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
@@ -59,12 +59,11 @@ fi
|
||||
GOPATH=${GOPATH%%:*}
|
||||
|
||||
# Get kubernetes
|
||||
KUBERNETES_REPO="https://github.com/kubernetes/kubernetes"
|
||||
KUBERNETES_PATH="${GOPATH}/src/k8s.io/kubernetes"
|
||||
if [ ! -d "${KUBERNETES_PATH}" ]; then
|
||||
mkdir -p ${KUBERNETES_PATH}
|
||||
cd ${KUBERNETES_PATH}
|
||||
git clone ${KUBERNETES_REPO} .
|
||||
git clone https://${KUBERNETES_REPO} .
|
||||
fi
|
||||
cd ${KUBERNETES_PATH}
|
||||
git fetch --all
|
||||
|
||||
Reference in New Issue
Block a user