Update kubectl diff --server-side test.

In 1.19, we made it so that upgrading from client-side `kubectl apply`
to server-side `kubectl apply --server-side` does not conflict.

This means that `kubectl diff --server-side` should work the same:
server-side apply diffing a resource managed originally with client-side apply
should not result in conflicts.
This commit is contained in:
Julian V. Modesto 2020-08-31 15:46:35 -04:00
parent ed6ac4e438
commit 690c6b2f25

View File

@ -54,7 +54,7 @@ run_kubectl_diff_tests() {
kube::test::if_has_string "${resourceVersion}" "${initialResourceVersion}" kube::test::if_has_string "${resourceVersion}" "${initialResourceVersion}"
# Test found diff with server-side apply # Test found diff with server-side apply
output_message=$(kubectl diff -f hack/testdata/pod-changed.yaml --server-side --force-conflicts || test $? -eq 1) output_message=$(kubectl diff -f hack/testdata/pod-changed.yaml --server-side || test $? -eq 1)
kube::test::if_has_string "${output_message}" 'k8s.gcr.io/pause:3.0' kube::test::if_has_string "${output_message}" 'k8s.gcr.io/pause:3.0'
# Ensure diff --server-side only dry-runs and doesn't persist change # Ensure diff --server-side only dry-runs and doesn't persist change