...

Text file src/k8s.io/kubernetes/test/conformance/image/conformance-e2e.sh

Documentation: k8s.io/kubernetes/test/conformance/image

     1#!/usr/bin/env bash
     2# Copyright 2018 The Kubernetes Authors.
     3#
     4# Licensed under the Apache License, Version 2.0 (the "License");
     5# you may not use this file except in compliance with the License.
     6# You may obtain a copy of the License at
     7#
     8#     http://www.apache.org/licenses/LICENSE-2.0
     9#
    10# Unless required by applicable law or agreed to in writing, software
    11# distributed under the License is distributed on an "AS IS" BASIS,
    12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13# See the License for the specific language governing permissions and
    14# limitations under the License.
    15
    16set -o errexit
    17set -o nounset
    18set -o pipefail
    19
    20kubectl create -f conformance-e2e.yaml
    21while true; do
    22  STATUS=$(kubectl -n conformance get pods e2e-conformance-test -o jsonpath="{.status.phase}")
    23  timestamp=$(date +"[%H:%M:%S]")
    24  echo "$timestamp Pod status is: ${STATUS}"
    25  if [[ "$STATUS" == "Succeeded" ]]; then
    26    echo "$timestamp Done."
    27    break
    28  elif [[ "$STATUS" == "Failed" ]]; then
    29    echo "$timestamp Failed."
    30    kubectl -n conformance describe pods e2e-conformance-test || true
    31    kubectl -n conformance logs e2e-conformance-test || true
    32    exit 1
    33  else
    34    sleep 5
    35  fi
    36done
    37echo "Please use 'kubectl logs -n conformance e2e-conformance-test' to view the results"

View as plain text