diff --git a/model/metadata/test_approved_system/transform_empty.approved.json b/model/metadata/test_approved_system/transform_empty.approved.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/model/metadata/test_approved_system/transform_empty.approved.json @@ -0,0 +1 @@ +{} diff --git a/model/metadata/test_approved_system/transform_empty_ip.approved.json b/model/metadata/test_approved_system/transform_empty_ip.approved.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/model/metadata/test_approved_system/transform_empty_ip.approved.json @@ -0,0 +1 @@ +{} diff --git a/model/metadata/test_approved_system/transform_k8s_namespace.approved.json b/model/metadata/test_approved_system/transform_k8s_namespace.approved.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/model/metadata/test_approved_system/transform_k8s_namespace.approved.json @@ -0,0 +1 @@ +{} diff --git a/model/metadata/test_approved_system/transform_k8s_podUID.approved.json b/model/metadata/test_approved_system/transform_k8s_podUID.approved.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/model/metadata/test_approved_system/transform_k8s_podUID.approved.json @@ -0,0 +1 @@ +{} diff --git a/model/metadata/test_approved_system/transform_k8s_podname.approved.json b/model/metadata/test_approved_system/transform_k8s_podname.approved.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/model/metadata/test_approved_system/transform_k8s_podname.approved.json @@ -0,0 +1 @@ +{} diff --git a/tests/approvals/approvals.go b/tests/approvals/approvals.go index d2bb8928d1a..cb83f0ba19b 100644 --- a/tests/approvals/approvals.go +++ b/tests/approvals/approvals.go @@ -108,9 +108,7 @@ func Compare(path string, ignoredFields ...string) (map[string]interface{}, map[ var approved map[string]interface{} approvedf, err := os.Open(path + ApprovedSuffix) - if err != nil { - approved = map[string]interface{}{} - } else { + if err == nil { defer approvedf.Close() if err := json.NewDecoder(approvedf).Decode(&approved); err != nil { fmt.Println("Cannot unmarshal approved file ", path, err)