Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

backport: 1.6.3 rel #1525

Merged
merged 6 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions .ci/static-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ check_docs()
# Google APIs typically require an auth token.
echo "$url"|grep -q 'https://www.googleapis.com' && continue

# Git repo URL check
if echo "$url"|grep -q '^https.*git'
then
git ls-remote "$url" > /dev/null 2>&1 && continue
fi

# Check the URL, saving it if invalid
( curl -sLf -o /dev/null "$url" ||\
echo "$url" >> "$invalid_urls") &
Expand Down Expand Up @@ -547,11 +553,15 @@ check_files()
exit 1
}

# Ensure that changes to vendored code are accompanied by an update to the
# vendor tooling config file. If not, the user simply hacked the vendor files
# rather than following the correct process:
# Perform vendor checks:
#
# - https://github.com/kata-containers/community/blob/master/VENDORING.md
# - Ensure that changes to vendored code are accompanied by an update to the
# vendor tooling config file. If not, the user simply hacked the vendor files
# rather than following the correct process:
#
# https://github.com/kata-containers/community/blob/master/VENDORING.md
#
# - Ensure vendor metadata is valid.
check_vendor()
{
local files
Expand All @@ -561,22 +571,34 @@ check_vendor()
# All vendor operations should modify this file
local vendor_ctl_file="Gopkg.lock"

[ -e "$vendor_ctl_file" ] || { info "No vendoring in this repository" && return; }

info "Checking vendored code is pristine"

files=$(get_pr_changed_file_details_full || true)

# Strip off status
files=$(echo "$files"|awk '{print $NF}')

# No files were changed
[ -z "$files" ] && info "No files found" && return
if [ -n "$files" ]
then
# PR changed files so check if it changed any vendored files
vendor_files=$(echo "$files" | grep "vendor/" || true)

vendor_files=$(echo "$files" | grep "vendor/" || true)
if [ -n "$vendor_files" ]
then
result=$(echo "$files" | egrep "\<${vendor_ctl_file}\>" || true)
[ -n "$result" ] || die "PR changes vendor files, but does not update ${vendor_ctl_file}"
fi
fi

# No vendor files modified
[ -z "$vendor_files" ] && return
info "Checking vendoring metadata"

result=$(echo "$files" | egrep "\<${vendor_ctl_file}\>" || true)
# Get the vendoring tool
go get github.com/golang/dep/cmd/dep

[ -n "$result" ] || die "PR changes vendor files, but does not update ${vendor_ctl_file}"
# Check, but don't touch!
dep ensure -no-vendor -dry-run
}

main()
Expand Down
7 changes: 5 additions & 2 deletions cmd/kata-manager/kata-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ get_git_repo()
local -r repo_url="https://${repo_path}"

if ! command -v git >/dev/null; then
info "getting repo $1 using http downloader"
detect_downloader
$downloader "${repo_url}/${tarball_suffix}" | tar xz -C "$local_dest" --strip-components=1
return
fi
Expand Down Expand Up @@ -437,6 +435,11 @@ setup()
if [ -z "$kata_repos_base" ]; then
kata_repos_base="$HOME/go"
fi

if ! command -v git >/dev/null; then
info "git not installed - trying to use a downloader instead"
detect_downloader
fi
}

parse_args()
Expand Down
11 changes: 3 additions & 8 deletions integration/cri-o/cri-o.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ done

IFS=$OLD_IFS

# run CRI-O tests using devicemapper on ubuntu 16.04
MAJOR=$(echo "$VERSION_ID"|cut -d\. -f1)
if [ "$ID" == "ubuntu" ] && [ "$MAJOR" -eq 16 ]; then
# run CRI-O tests using devicemapper on ubuntu
if [ "$ID" == "ubuntu" ]; then
# Block device attached to the VM where we run the CI
# If the block device has a partition, cri-o will not be able to use it.
export LVM_DEVICE
Expand All @@ -72,13 +71,9 @@ if [ "$ID" == "ubuntu" ] && [ "$MAJOR" -eq 16 ]; then
export STORAGE_OPTIONS="$DM_STORAGE_OPTIONS"
fi

# But if on ubuntu 17.10 or newer, test using overlay
# On other distros or on ZUUL, use overlay.
# This will allow us to run tests with at least 2 different
# storage drivers.
if [ "$ID" == "ubuntu" ] && [ "$MAJOR" -ge 17 ]; then
export STORAGE_OPTIONS="$OVERLAY_STORAGE_OPTIONS"
fi

if [ "$ID" == "fedora" ] || [ "$ID" == "centos" ]; then
export STORAGE_OPTIONS="$OVERLAY_STORAGE_OPTIONS"
fi
Expand Down
6 changes: 4 additions & 2 deletions integration/docker/mem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ var _ = Describe("memory constraints", func() {
useKmem bool
err error
defaultMemSz int
hotMemSz int
)

BeforeEach(func() {
Expand Down Expand Up @@ -143,8 +144,9 @@ var _ = Describe("memory constraints", func() {

Context("run container exceeding memory constraints", func() {
It("should ran out of memory", func() {
memSize = "256MB"
limSize = strconv.Itoa(260+defaultMemSz) + "M"
hotMemSz = 256
memSize = fmt.Sprintf("%dMB", hotMemSz)
limSize = fmt.Sprintf("%dM", (hotMemSz*2)+defaultMemSz)
args = []string{"--name", id, "--rm", "-m", memSize, StressImage, "-mem-total", limSize, "-mem-alloc-size", limSize}
_, stderr, exitCode = dockerRun(args...)
Expect(exitCode).NotTo(Equal(0))
Expand Down