Modify according to comments.

Change hook.Container's value in test case to ""

Signed-off-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
Xun Jiang
2022-02-28 19:28:17 +08:00
parent 6d9004dc62
commit 0503b2675f
+2 -1
View File
@@ -109,7 +109,7 @@ func TestExecutePodCommandMissingInputs(t *testing.T) {
podName: "pod",
hookName: "hook",
hook: &v1.ExecHook{
Container: "bar",
Container: "",
},
},
}
@@ -127,6 +127,7 @@ func TestExecutePodCommandMissingInputs(t *testing.T) {
e := &defaultPodCommandExecutor{}
err := e.ExecutePodCommand(velerotest.NewLogger(), test.item, test.podNamespace, test.podName, test.hookName, test.hook)
if hookPodContainerNotSame && test.hook.Container == pod.Spec.Containers[0].Name {
assert.Error(t, fmt.Errorf("hook exec container is overwritten"))
}