From 4c51eb9063af51520017b094639dbc69d4ba6e60 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Wed, 1 Jan 2020 03:58:14 -0800 Subject: [PATCH] test images: Image Promoter fixes Prior to the Image Centralization part 4 (https://github.com/kubernetes/kubernetes/pull/81170), a PR merged that enables the Image Promoter to run on the k/k test images. The Image Promoter currently only builds the Conformance-related images, but the Image Centralization part 4 centralized some of those images into agnhost, so they need to be removed from the conformance_images list. Additionally, https://github.com/kubernetes/kubernetes/pull/81226 proposes mounttest-user image to be removed, and RunAsUser to be used in tests instead. The image used by the Image Promoter (gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4) is based on busybox, and thus, the sed binary is actually busybox. image-util.sh calls kube::util::ensure-gnu-sed several times, which ensures that a GNU sed binary exists (it checks by greping GNU in its --help output). Obviously, it won't match the busybox sed binary. But the sed usage in image-util.sh is fairly simple, and the busybox sed is sufficient. Bumps image versions for: jessie-dnsutils, nonewprivs, resource-consumer, sample-apiserver. These images are included in the conformance_images that are being built by the Image Promoter, so we're bumping them just to make sure we're not breaking anything and cause all the CIs to fall. We're going to bump the image versions used in tests in a subsequent PR. The image version was not bumped for: agnhost, kitten, nautilus, as they were already bumped by the Image Centralization part 4 PR. --- hack/lib/util.sh | 5 ++++- test/images/image-util.sh | 4 ++-- test/images/jessie-dnsutils/VERSION | 2 +- test/images/mounttest-user/BASEIMAGE | 5 ----- test/images/mounttest-user/Dockerfile | 16 ---------------- test/images/mounttest-user/VERSION | 1 - test/images/nonewprivs/VERSION | 2 +- test/images/resource-consumer/VERSION | 2 +- test/images/sample-apiserver/VERSION | 2 +- 9 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 test/images/mounttest-user/BASEIMAGE delete mode 100644 test/images/mounttest-user/Dockerfile delete mode 100644 test/images/mounttest-user/VERSION diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 8fd29213de5..ecb7c2f09dc 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -698,7 +698,10 @@ function kube::util::ensure_dockerized { # SED: The name of the gnu-sed binary # function kube::util::ensure-gnu-sed { - if LANG=C sed --help 2>&1 | grep -q GNU; then + # NOTE: the echo below is a workaround to ensure sed is executed before the grep. + # see: https://github.com/kubernetes/kubernetes/issues/87251 + sed_help="$(LANG=C sed --help 2>&1)" + if echo "${sed_help}" | grep -q "GNU\|BusyBox"; then SED="sed" elif command -v gsed &>/dev/null; then SED="gsed" diff --git a/test/images/image-util.sh b/test/images/image-util.sh index 2e7791f8394..732084ed9c2 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -22,6 +22,7 @@ TASK=$1 WHAT=$2 KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" +source "${KUBE_ROOT}/hack/lib/logging.sh" source "${KUBE_ROOT}/hack/lib/util.sh" # Mapping of go ARCH to actual architectures shipped part of multiarch/qemu-user-static project @@ -166,8 +167,7 @@ if [[ "${WHAT}" == "all-conformance" ]]; then # Discussed during Conformance Office Hours Meeting (2019.12.17): # https://docs.google.com/document/d/1W31nXh9RYAb_VaYkwuPLd1hFxuRX3iU0DmaQ4lkCsX8/edit#heading=h.l87lu17xm9bh # echoserver image not included: https://github.com/kubernetes/kubernetes/issues/84158 - conformance_images=("agnhost" "dnsutils" "jessie-dnsutils" "kitten" "mounttest" "mounttest-user"\ - "nautilus" "nonewprivs" "resource-consumer" "resource-consumer-controller" "sample-apiserver" "test-webserver") + conformance_images=("agnhost" "jessie-dnsutils" "kitten" "nautilus" "nonewprivs" "resource-consumer" "sample-apiserver") for image in "${conformance_images[@]}"; do eval "${TASK}" "${image}" done diff --git a/test/images/jessie-dnsutils/VERSION b/test/images/jessie-dnsutils/VERSION index 9459d4ba2a0..5625e59da88 100644 --- a/test/images/jessie-dnsutils/VERSION +++ b/test/images/jessie-dnsutils/VERSION @@ -1 +1 @@ -1.1 +1.2 diff --git a/test/images/mounttest-user/BASEIMAGE b/test/images/mounttest-user/BASEIMAGE deleted file mode 100644 index 0d501766eeb..00000000000 --- a/test/images/mounttest-user/BASEIMAGE +++ /dev/null @@ -1,5 +0,0 @@ -amd64=gcr.io/kubernetes-e2e-test-images/mounttest-amd64:1.0 -arm=gcr.io/kubernetes-e2e-test-images/mounttest-arm:1.0 -arm64=gcr.io/kubernetes-e2e-test-images/mounttest-arm64:1.0 -ppc64le=gcr.io/kubernetes-e2e-test-images/mounttest-ppc64le:1.0 -s390x=gcr.io/kubernetes-e2e-test-images/mounttest-s390x:1.0 diff --git a/test/images/mounttest-user/Dockerfile b/test/images/mounttest-user/Dockerfile deleted file mode 100644 index 132e4c19cc5..00000000000 --- a/test/images/mounttest-user/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE -USER 1001 diff --git a/test/images/mounttest-user/VERSION b/test/images/mounttest-user/VERSION deleted file mode 100644 index d3827e75a5c..00000000000 --- a/test/images/mounttest-user/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/test/images/nonewprivs/VERSION b/test/images/nonewprivs/VERSION index d3827e75a5c..9459d4ba2a0 100644 --- a/test/images/nonewprivs/VERSION +++ b/test/images/nonewprivs/VERSION @@ -1 +1 @@ -1.0 +1.1 diff --git a/test/images/resource-consumer/VERSION b/test/images/resource-consumer/VERSION index c239c60cba2..810ee4e91e2 100644 --- a/test/images/resource-consumer/VERSION +++ b/test/images/resource-consumer/VERSION @@ -1 +1 @@ -1.5 +1.6 diff --git a/test/images/sample-apiserver/VERSION b/test/images/sample-apiserver/VERSION index b48f3226098..06fb41b6322 100644 --- a/test/images/sample-apiserver/VERSION +++ b/test/images/sample-apiserver/VERSION @@ -1 +1 @@ -1.17 +1.17.2