mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 12:46:06 +00:00
diff: Fix crash when remote object doesn't exist
Since we're saving nil in an interface rather than the implementation, we can't compare to nil to check if the remote object exists or not. Change the struct to save in the implementation.
This commit is contained in:
@@ -26,6 +26,10 @@ run_kubectl_diff_tests() {
|
||||
create_and_use_new_namespace
|
||||
kube::log::status "Testing kubectl alpha diff"
|
||||
|
||||
# Test that it works when the live object doesn't exist
|
||||
output_message=$(kubectl alpha diff LOCAL LIVE -f hack/testdata/pod.yaml)
|
||||
kube::test::if_has_string "${output_message}" 'test-pod'
|
||||
|
||||
kubectl apply -f hack/testdata/pod.yaml
|
||||
|
||||
# Ensure that selfLink has been added, and shown in the diff
|
||||
|
Reference in New Issue
Block a user