Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
91872107
Commit
91872107
authored
Jul 07, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
godep-save.sh: add sanity checks
parent
a9bf4410
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
24 deletions
+31
-24
godep-save.sh
hack/godep-save.sh
+23
-24
util.sh
hack/lib/util.sh
+8
-0
No files found.
hack/godep-save.sh
View file @
91872107
...
@@ -22,8 +22,14 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
...
@@ -22,8 +22,14 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
kube::util::ensure_single_dir_gopath
kube::util::ensure_godep_version v79
kube::util::ensure_godep_version v79
if
[
-e
"
${
KUBE_ROOT
}
/vendor"
-o
-e
"
${
KUBE_ROOT
}
/Godeps"
]
;
then
echo
"The directory vendor/ or Godeps/ exists. Remove them before running godep-save.sh"
1>&2
exit
1
fi
# Some things we want in godeps aren't code dependencies, so ./...
# Some things we want in godeps aren't code dependencies, so ./...
# won't pick them up.
# won't pick them up.
REQUIRED_BINS
=(
REQUIRED_BINS
=(
...
@@ -34,34 +40,27 @@ REQUIRED_BINS=(
...
@@ -34,34 +40,27 @@ REQUIRED_BINS=(
)
)
pushd
"
${
KUBE_ROOT
}
"
>
/dev/null
pushd
"
${
KUBE_ROOT
}
"
>
/dev/null
# sanity check that staging directories do not exist in GOPATH
error
=
0
for
repo
in
$(
ls
${
KUBE_ROOT
}
/staging/src/k8s.io
)
;
do
if
[
-e
"
${
GOPATH
}
/src/k8s.io/
${
repo
}
"
]
;
then
echo
"k8s.io/
${
repo
}
exists in GOPATH. Remove before running godep-save.sh."
1>&2
error
=
1
fi
done
if
[
"
${
error
}
"
=
"1"
]
;
then
exit
1
fi
GOPATH
=
${
GOPATH
}
:
${
KUBE_ROOT
}
/staging godep save
"
${
REQUIRED_BINS
[@]
}
"
GOPATH
=
${
GOPATH
}
:
${
KUBE_ROOT
}
/staging godep save
"
${
REQUIRED_BINS
[@]
}
"
# create a symlink in vendor directory pointing to the staging client. This
# create a symlink in vendor directory pointing to the staging client. This
# let other packages use the staging client as if it were vendored.
# let other packages use the staging client as if it were vendored.
if
[
!
-e
"vendor/k8s.io/api"
]
;
then
for
repo
in
$(
ls
${
KUBE_ROOT
}
/staging/src/k8s.io
)
;
do
ln
-s
../../staging/src/k8s.io/api vendor/k8s.io/api
if
[
!
-e
"vendor/k8s.io/
${
repo
}
"
]
;
then
fi
ln
-s
"../../staging/src/k8s.io/
${
repo
}
"
"vendor/k8s.io/
${
repo
}
"
if
[
!
-e
"vendor/k8s.io/client-go"
]
;
then
fi
ln
-s
../../staging/src/k8s.io/client-go vendor/k8s.io/client-go
done
fi
if
[
!
-e
"vendor/k8s.io/apiserver"
]
;
then
ln
-s
../../staging/src/k8s.io/apiserver vendor/k8s.io/apiserver
fi
if
[
!
-e
"vendor/k8s.io/apimachinery"
]
;
then
ln
-s
../../staging/src/k8s.io/apimachinery vendor/k8s.io/apimachinery
fi
if
[
!
-e
"vendor/k8s.io/kube-aggregator"
]
;
then
ln
-s
../../staging/src/k8s.io/kube-aggregator vendor/k8s.io/kube-aggregator
fi
if
[
!
-e
"vendor/k8s.io/apiextensions-apiserver"
]
;
then
ln
-s
../../staging/src/k8s.io/apiextensions-apiserver vendor/k8s.io/apiextensions-apiserver
fi
if
[
!
-e
"vendor/k8s.io/sample-apiserver"
]
;
then
ln
-s
../../staging/src/k8s.io/sample-apiserver vendor/k8s.io/sample-apiserver
fi
if
[
!
-e
"vendor/k8s.io/metrics"
]
;
then
ln
-s
../../staging/src/k8s.io/metrics vendor/k8s.io/metrics
fi
popd
>
/dev/null
popd
>
/dev/null
echo
"Don't forget to run hack/update-godep-licenses.sh if you added or removed a dependency!"
echo
"Don't forget to run hack/update-godep-licenses.sh if you added or removed a dependency!"
hack/lib/util.sh
View file @
91872107
...
@@ -513,6 +513,14 @@ kube::util::ensure_godep_version() {
...
@@ -513,6 +513,14 @@ kube::util::ensure_godep_version() {
godep version
godep version
}
}
# Checks that the GOPATH is simple, i.e. consists only of one directory, not multiple.
kube::util::ensure_single_dir_gopath
()
{
if
[[
"
${
GOPATH
}
"
==
*
:
*
]]
;
then
echo
"GOPATH must consist of a single directory."
1>&2
exit
1
fi
}
# Checks whether there are any files matching pattern $2 changed between the
# Checks whether there are any files matching pattern $2 changed between the
# current branch and upstream branch named by $1.
# current branch and upstream branch named by $1.
# Returns 1 (false) if there are no changes, 0 (true) if there are changes
# Returns 1 (false) if there are no changes, 0 (true) if there are changes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment