From 6daa95f39f9f1cb5ae455e449e2c88a0cb8192a5 Mon Sep 17 00:00:00 2001 From: Rohit Aggarwal Date: Thu, 5 Dec 2024 22:16:55 +0530 Subject: [PATCH] Show actual log during custom wait rule if asked specifically Signed-off-by: Rohit Aggarwal --- pkg/kapp/resourcesmisc/custom_waiting_resource.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/kapp/resourcesmisc/custom_waiting_resource.go b/pkg/kapp/resourcesmisc/custom_waiting_resource.go index ccf6d4b97..3eb2fd8d0 100644 --- a/pkg/kapp/resourcesmisc/custom_waiting_resource.go +++ b/pkg/kapp/resourcesmisc/custom_waiting_resource.go @@ -131,6 +131,7 @@ func (s CustomWaitingResource) IsDoneApplying() DoneApplyState { } unblockChangeMsg := "" + message := "No failing or successful conditions found" // If no failure conditions found, check on successful ones for _, condMatcher := range s.waitRule.ConditionMatchers { @@ -151,6 +152,9 @@ func (s CustomWaitingResource) IsDoneApplying() DoneApplyState { cond.Type, condMatcher.Status, cond.Reason) continue } + if cond.Message != "" { + message = cond.Message + } } } } @@ -164,7 +168,7 @@ func (s CustomWaitingResource) IsDoneApplying() DoneApplyState { return DoneApplyState{Done: false, UnblockChanges: true, Message: unblockChangeMsg} } - return DoneApplyState{Done: false, Message: "No failing or successful conditions found"} + return DoneApplyState{Done: false, Message: message} } func (s CustomWaitingResource) hasTimeoutOccurred(timeout string, key string) bool {