From 46d43b6487594c4dfa7f69e25fca4c8a8ea82f18 Mon Sep 17 00:00:00 2001 From: Xavier Coulon Date: Thu, 30 May 2024 11:42:27 +0200 Subject: [PATCH] fix(cmd): fail when resource file is not referenced a warning message is not enough, the GH action would succeed and we would miss the problem Signed-off-by: Xavier Coulon --- pkg/validation/resources.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/validation/resources.go b/pkg/validation/resources.go index d552e09..7666fae 100644 --- a/pkg/validation/resources.go +++ b/pkg/validation/resources.go @@ -1,6 +1,7 @@ package validation import ( + "fmt" "path/filepath" "strings" @@ -85,7 +86,7 @@ entries: continue entries } } - logger.Warn("resource is not referenced", "path", path, "resource", e.Name()) + return fmt.Errorf("resource is not referenced: %s", filepath.Join(path, e.Name())) } return nil }