From 08b40e260cada8909ea401810c0c1f1ce629cd06 Mon Sep 17 00:00:00 2001 From: liu-hm19 Date: Tue, 11 Jun 2024 16:14:17 +0800 Subject: [PATCH] fix: watch context timeout and display text for apply (#1153) --- pkg/cmd/apply/apply.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/apply/apply.go b/pkg/cmd/apply/apply.go index 8db1049d..68a0016e 100644 --- a/pkg/cmd/apply/apply.go +++ b/pkg/cmd/apply/apply.go @@ -459,7 +459,7 @@ func Apply( // Init a spinner printer for the resource to print the apply status. changesWriterMap[key.ID], err = o.UI.SpinnerPrinter. WithWriter(multi.NewWriter()). - Start(fmt.Sprintf("Waiting %s to apply ...", pterm.Bold.Sprint(key.ID))) + Start(fmt.Sprintf("Pending %s", pterm.Bold.Sprint(key.ID))) if err != nil { return nil, fmt.Errorf("failed to init change step spinner printer: %v", err) } @@ -695,8 +695,8 @@ func Watch( // Get the resource ID to be watched. case id := <-ac.WatchCh: res := resourceMap[id] - // Set the timeout duration for watch context, here we set an experiential value of 5 minutes. - ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(5)) + // Set the timeout duration for watch context, here we set an experiential value of 60 minutes. + ctx, cancel := context.WithTimeout(context.Background(), time.Minute*time.Duration(60)) defer cancel() // Get the event channel for watching the resource.