Use Fatalf for non-recoverable errors in test

Kubernetes-commit: 5784e58446b7dd2aca0af0e84e43395c9391ae03
This commit is contained in:
Joe Betz 2024-08-19 11:18:04 -04:00 committed by Kubernetes Publisher
parent 908d899011
commit 86c96117c6

View File

@ -294,7 +294,7 @@ func TestApplyCreate(t *testing.T) {
handled, configMap, err := reaction(action)
assert.True(t, handled)
if err != nil {
t.Errorf("Failed to create a resource with apply: %v", err)
t.Fatalf("Failed to create a resource with apply: %v", err)
}
cm := configMap.(*v1.ConfigMap)
assert.Equal(t, cm.Data, map[string]string{"k": "v"})
@ -314,7 +314,7 @@ func TestApplyNoMeta(t *testing.T) {
handled, configMap, err := reaction(action)
assert.True(t, handled)
if err != nil {
t.Errorf("Failed to create a resource with apply: %v", err)
t.Fatalf("Failed to create a resource with apply: %v", err)
}
cm := configMap.(*v1.ConfigMap)
assert.Equal(t, "cm-1", cm.Name)