1
0
mirror of https://github.com/helm/chart-testing.git synced 2026-02-05 18:45:18 +01:00

Fix exit code when test with multiple custom CI values files fails

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
This commit is contained in:
Reinhard Nägele
2018-09-11 09:16:07 +02:00
parent 2f8115e1d5
commit 64c1e522be
5 changed files with 9 additions and 7 deletions

View File

@@ -83,7 +83,7 @@ chart-test.sh
### Linting Charts
```shell
docker run --rm -v "$(pwd):/workdir" --workdir /workdir gcr.io/kubernetes-charts-ci/chart-testing:v1.0.3 chart_test.sh --no-install --config .mytestenv
docker run --rm -v "$(pwd):/workdir" --workdir /workdir gcr.io/kubernetes-charts-ci/chart-testing:v1.0.4 chart_test.sh --no-install --config .mytestenv
```
*Sample Output*
@@ -143,7 +143,7 @@ Done.
### Installing and Testing Charts
Installing a chart requires access to a Kubernetes cluster.
You may have to create your own Docker image that extends from `gcr.io/kubernetes-charts-ci/chart-testing:v1.0.3` in order to install additional tools (e. g. `google-cloud-sdk` for GKE).
You may have to create your own Docker image that extends from `gcr.io/kubernetes-charts-ci/chart-testing:v1.0.4` in order to install additional tools (e. g. `google-cloud-sdk` for GKE).
You could run a container in the background, run the required steps to authenticatre and initialize the `kubectl` context before you, and eventually run `chart_test.sh`.
Charts are installed into newly created namespaces that will be deleted again afterwards.
@@ -152,7 +152,7 @@ By default, they are named by the chart, which may not be a good idea, especiall
Make sure you set it based on the pull request number.
```shell
docker run --rm -v "$(pwd):/workdir" --workdir /workdir gcr.io/kubernetes-charts-ci/chart-testing:v1.0.3 chart_test.sh --no-lint --config .mytestenv
docker run --rm -v "$(pwd):/workdir" --workdir /workdir gcr.io/kubernetes-charts-ci/chart-testing:v1.0.4 chart_test.sh --no-lint --config .mytestenv
```
#### GKE Example

View File

@@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail
readonly IMAGE_TAG=v1.0.3
readonly IMAGE_TAG=v1.0.4
readonly IMAGE_REPOSITORY="gcr.io/kubernetes-charts-ci/chart-testing"
readonly SCRIPT_DIR=$(dirname "$(readlink -f "$0")")

View File

@@ -18,7 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail
readonly IMAGE_TAG=v1.0.3
readonly IMAGE_TAG=v1.0.4
readonly IMAGE_REPOSITORY="gcr.io/kubernetes-charts-ci/chart-testing"
main() {

View File

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM gcr.io/kubernetes-charts-ci/chart-testing:v1.0.3
FROM gcr.io/kubernetes-charts-ci/chart-testing:v1.0.4
ENV PATH /google-cloud-sdk/bin:$PATH
ARG CLOUD_SDK_VERSION=200.0.0

View File

@@ -389,7 +389,9 @@ chartlib::install_chart_with_all_configs() {
local has_test_values=
for values_file in "$chart_dir"/ci/*-values.yaml; do
has_test_values=true
chartlib::install_chart_with_single_config "$chart_dir" "$release-$index" "$namespace-$index" "$values_file"
if ! chartlib::install_chart_with_single_config "$chart_dir" "$release-$index" "$namespace-$index" "$values_file"; then
return 1
fi
((index += 1))
done