fix: return error instead of log.Fatalf() (#5625)

* fix: return error instead of log.Fatalf()

* chore: add meaningful message to error output

* chore: add meaningful message to fatal function
This commit is contained in:
Yusuke Abe
2024-04-18 19:56:51 +09:00
committed by GitHub
parent 82ee768212
commit ed09399cd1
11 changed files with 412 additions and 190 deletions

View File

@@ -32,11 +32,14 @@ func TestDeterminePluginSrcRoot(t *testing.T) {
}
func makeConfigMap(rf *resource.Factory, name, behavior string, hashValue *string) *resource.Resource {
r := rf.FromMap(map[string]interface{}{
r, err := rf.FromMap(map[string]interface{}{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": map[string]interface{}{"name": name},
})
if err != nil {
panic(err)
}
annotations := map[string]string{}
if behavior != "" {
annotations[BehaviorAnnotation] = behavior