kubectl diff: Print error when something goes wrong

This commit is contained in:
Antoine Pelisse
2018-10-12 11:08:14 -07:00
parent e31d14cb10
commit 572a028148
2 changed files with 4 additions and 8 deletions

View File

@@ -27,12 +27,12 @@ run_kubectl_diff_tests() {
kube::log::status "Testing kubectl diff"
# Test that it works when the live object doesn't exist
output_message=$(kubectl diff -f hack/testdata/pod.yaml)
output_message=$(! kubectl diff -f hack/testdata/pod.yaml)
kube::test::if_has_string "${output_message}" 'test-pod'
kubectl apply -f hack/testdata/pod.yaml
output_message=$(kubectl diff -f hack/testdata/pod-changed.yaml)
output_message=$(! kubectl diff -f hack/testdata/pod-changed.yaml)
kube::test::if_has_string "${output_message}" 'k8s.gcr.io/pause:3.0'
kubectl delete -f hack/testdata/pod.yaml