From 78ccafd98c69b7f8523b5e0fd7f1bbb0bec973dc Mon Sep 17 00:00:00 2001 From: Ricardo Maraschini Date: Tue, 31 Oct 2023 12:18:53 +0100 Subject: [PATCH] chore: fix 'timed out waiting for admin console: ' if the timeout is reached but no error happen inside the func lasterr will be nil but err will have the timeout. on this scenario lasterr should be the actual timeout error. --- pkg/addons/adminconsole/adminconsole.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/addons/adminconsole/adminconsole.go b/pkg/addons/adminconsole/adminconsole.go index 80cd6c0f9..5883665ea 100644 --- a/pkg/addons/adminconsole/adminconsole.go +++ b/pkg/addons/adminconsole/adminconsole.go @@ -224,8 +224,11 @@ func (a *AdminConsole) Outro(ctx context.Context, cli client.Client) error { loading.Infof("Waiting %v for Admin Console to deploy: %d/3 ready", duration, count) return count == 3, nil }); err != nil { + if lasterr == nil { + lasterr = err + } loading.Close() - return fmt.Errorf("timed out waiting for admin console: %v", lasterr) + return fmt.Errorf("error waiting for admin console: %v", lasterr) } loading.Closef("Admin Console is ready!") a.printSuccessMessage()