Revert "*: initial wire in of crictl from cri-tools"

This reverts commit 49bdd59406.
This commit is contained in:
Mrunal Patel 2017-08-26 17:55:01 -07:00
parent a38419af88
commit 198cd7b34b
3 changed files with 27 additions and 58 deletions

View file

@ -76,17 +76,6 @@ RUN set -x \
&& cp bin/* /opt/cni/bin/ \ && cp bin/* /opt/cni/bin/ \
&& rm -rf "$GOPATH" && rm -rf "$GOPATH"
# Install crictl
ENV CRICTL_COMMIT a2d0e8f7bc7e80111a7d79052ab9aca3469609aa
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/kubernetes-incubator/cri-tools.git "$GOPATH/src/github.com/kubernetes-incubator/cri-tools" \
&& cd "$GOPATH/src/github.com/kubernetes-incubator/cri-tools" \
&& git checkout -q "$CRICTL_COMMIT" \
&& go install github.com/kubernetes-incubator/cri-tools/cmd/crictl \
&& cp "$GOPATH"/bin/crictl /usr/bin/ \
&& rm -rf "$GOPATH"
COPY test/plugin_test_args.bash /opt/cni/bin/plugin_test_args.bash COPY test/plugin_test_args.bash /opt/cni/bin/plugin_test_args.bash
# Make sure we have some policy for pulling images # Make sure we have some policy for pulling images

View file

@ -127,12 +127,6 @@
async: 600 async: 600
poll: 10 poll: 10
when: xunit when: xunit
- name: git clone crictl repo
git:
repo: https://github.com/kubernetes-incubator/cri-tools
dest: /root/src/github.com/kubernetes-incubator/cri-tools
async: 600
poll: 10
- name: git clone runc repo - name: git clone runc repo
git: git:
repo: https://github.com/opencontainers/runc repo: https://github.com/opencontainers/runc
@ -199,12 +193,6 @@
chdir: /root/src/github.com/opencontainers/runc chdir: /root/src/github.com/opencontainers/runc
async: 600 async: 600
poll: 10 poll: 10
- name: make crictl
shell: |
go install github.com/kubernetes-incubator/cri-tools/cmd/crictl && \
cp $GOPATH/bin/crictl /usr/bin/crictl
args:
chdir: /root/src/github.com/kubernetes-incubator/cri-o/
- name: make runc - name: make runc
make: make:
params: BUILDTAGS="seccomp selinux" params: BUILDTAGS="seccomp selinux"

View file

@ -11,9 +11,8 @@ CRIO_ROOT=${CRIO_ROOT:-$(cd "$INTEGRATION_ROOT/../.."; pwd -P)}
# Path of the crio binary. # Path of the crio binary.
CRIO_BINARY=${CRIO_BINARY:-${CRIO_ROOT}/cri-o/crio} CRIO_BINARY=${CRIO_BINARY:-${CRIO_ROOT}/cri-o/crio}
# Path of the crictl binary. # Path of the crioctl binary.
CRICTL_PATH=$(command -v crictl || true) OCIC_BINARY=${OCIC_BINARY:-${CRIO_ROOT}/cri-o/crioctl}
CRICTL_BINARY=${CRICTL_PATH:-/usr/bin/crictl}
# Path to kpod binary. # Path to kpod binary.
KPOD_BINARY=${KPOD_BINARY:-${CRIO_ROOT}/cri-o/kpod} KPOD_BINARY=${KPOD_BINARY:-${CRIO_ROOT}/cri-o/kpod}
# Path of the conmon binary. # Path of the conmon binary.
@ -152,18 +151,11 @@ function crio() {
"$CRIO_BINARY" --listen "$CRIO_SOCKET" "$@" "$CRIO_BINARY" --listen "$CRIO_SOCKET" "$@"
} }
# DEPRECATED
OCIC_BINARY=${OCIC_BINARY:-${CRIO_ROOT}/cri-o/crioctl}
# Run crioctl using the binary specified by $OCIC_BINARY. # Run crioctl using the binary specified by $OCIC_BINARY.
function crioctl() { function crioctl() {
"$OCIC_BINARY" --connect "$CRIO_SOCKET" "$@" "$OCIC_BINARY" --connect "$CRIO_SOCKET" "$@"
} }
# Run crictl using the binary specified by $CRICTL_BINARY.
function crictl() {
"$CRICTL_BINARY" -r "$CRIO_SOCKET" -i "$CRIO_SOCKET" "$@"
}
# Communicate with Docker on the host machine. # Communicate with Docker on the host machine.
# Should rarely use this. # Should rarely use this.
function docker_host() { function docker_host() {
@ -192,7 +184,7 @@ function retry() {
# Waits until the given crio becomes reachable. # Waits until the given crio becomes reachable.
function wait_until_reachable() { function wait_until_reachable() {
retry 15 1 crictl status retry 15 1 crioctl runtimeversion
} }
# Start crio. # Start crio.
@ -236,14 +228,14 @@ function start_crio() {
"$CRIO_BINARY" --debug --config "$CRIO_CONFIG" & CRIO_PID=$! "$CRIO_BINARY" --debug --config "$CRIO_CONFIG" & CRIO_PID=$!
wait_until_reachable wait_until_reachable
run crictl image status redis:alpine run crioctl image status --id=redis:alpine
if [ "$status" -ne 0 ] ; then if [ "$status" -ne 0 ] ; then
crictl image pull redis:alpine crioctl image pull redis:alpine
fi fi
REDIS_IMAGEID=$(crictl image status redis:alpine | head -1 | sed -e "s/ID: //g") REDIS_IMAGEID=$(crioctl image status --id=redis:alpine | head -1 | sed -e "s/ID: //g")
run crictl image status mrunalp/oom run crioctl image status --id=mrunalp/oom
if [ "$status" -ne 0 ] ; then if [ "$status" -ne 0 ] ; then
crictl image pull mrunalp/oom crioctl image pull mrunalp/oom
fi fi
# #
# #
@ -256,63 +248,63 @@ function start_crio() {
# #
# #
REDIS_IMAGEID_DIGESTED="redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b" REDIS_IMAGEID_DIGESTED="redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b"
run crictl image status $REDIS_IMAGEID_DIGESTED run crioctl image status --id $REDIS_IMAGEID_DIGESTED
if [ "$status" -ne 0 ]; then if [ "$status" -ne 0 ]; then
crictl image pull $REDIS_IMAGEID_DIGESTED crioctl image pull $REDIS_IMAGEID_DIGESTED
fi fi
# #
# #
# #
run crictl image status runcom/stderr-test run crioctl image status --id=runcom/stderr-test
if [ "$status" -ne 0 ] ; then if [ "$status" -ne 0 ] ; then
crictl image pull runcom/stderr-test:latest crioctl image pull runcom/stderr-test:latest
fi fi
STDERR_IMAGEID=$(crictl image status runcom/stderr-test | head -1 | sed -e "s/ID: //g") STDERR_IMAGEID=$(crioctl image status --id=runcom/stderr-test | head -1 | sed -e "s/ID: //g")
run crictl image status busybox run crioctl image status --id=busybox
if [ "$status" -ne 0 ] ; then if [ "$status" -ne 0 ] ; then
crictl image pull busybox:latest crioctl image pull busybox:latest
fi fi
BUSYBOX_IMAGEID=$(crictl image status busybox | head -1 | sed -e "s/ID: //g") BUSYBOX_IMAGEID=$(crioctl image status --id=busybox | head -1 | sed -e "s/ID: //g")
run crictl image status mrunalp/image-volume-test run crioctl image status --id=mrunalp/image-volume-test
if [ "$status" -ne 0 ] ; then if [ "$status" -ne 0 ] ; then
crictl image pull mrunalp/image-volume-test:latest crioctl image pull mrunalp/image-volume-test:latest
fi fi
VOLUME_IMAGEID=$(crictl image status mrunalp/image-volume-test | head -1 | sed -e "s/ID: //g") VOLUME_IMAGEID=$(crioctl image status --id=mrunalp/image-volume-test | head -1 | sed -e "s/ID: //g")
} }
function cleanup_ctrs() { function cleanup_ctrs() {
run crictl ctr ls --quiet run crioctl ctr list --quiet
if [ "$status" -eq 0 ]; then if [ "$status" -eq 0 ]; then
if [ "$output" != "" ]; then if [ "$output" != "" ]; then
printf '%s\n' "$output" | while IFS= read -r line printf '%s\n' "$output" | while IFS= read -r line
do do
crictl ctr stop "$line" crioctl ctr stop --id "$line"
crictl ctr rm "$line" crioctl ctr remove --id "$line"
done done
fi fi
fi fi
} }
function cleanup_images() { function cleanup_images() {
run crictl image ls --quiet run crioctl image list --quiet
if [ "$status" -eq 0 ]; then if [ "$status" -eq 0 ]; then
if [ "$output" != "" ]; then if [ "$output" != "" ]; then
printf '%s\n' "$output" | while IFS= read -r line printf '%s\n' "$output" | while IFS= read -r line
do do
crictl image rm "$line" crioctl image remove --id "$line"
done done
fi fi
fi fi
} }
function cleanup_pods() { function cleanup_pods() {
run crictl sandbox ls --quiet run crioctl pod list --quiet
if [ "$status" -eq 0 ]; then if [ "$status" -eq 0 ]; then
if [ "$output" != "" ]; then if [ "$output" != "" ]; then
printf '%s\n' "$output" | while IFS= read -r line printf '%s\n' "$output" | while IFS= read -r line
do do
crictl sandbox stop "$line" crioctl pod stop --id "$line"
crictl sandbox rm "$line" crioctl pod remove --id "$line"
done done
fi fi
fi fi