Skip to content

Commit

Permalink
Add resilience to installation status watch (kyma-project#517)
Browse files Browse the repository at this point in the history
Failing to connect to the cluster no longer terminates the watch.
Instead, it will attempt reattaching after 10 seconds periodically.

Signed-off-by: Borja Clemente <[email protected]>
  • Loading branch information
clebs authored Jul 23, 2020
1 parent 9d6e284 commit 2cc5d04
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/installation/installation.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,19 +385,19 @@ func (i *Installation) waitForInstaller() error {
default:
installationState, err := i.service.CheckInstallationState(i.k8s.Config())
if err != nil {
installErr := installationSDK.InstallationError{}
if errors.As(err, &installErr) {
if !errorOccured {
errorOccured = true
if !errorOccured {
errorOccured = true
installErr := installationSDK.InstallationError{}
if errors.As(err, &installErr) {
i.currentStep.LogErrorf("%s, which may be OK. Will retry later...", installErr.Error())
i.currentStep.LogInfo("To fetch the error logs from the installer, run: kubectl get installation kyma-installation -o go-template --template='{{- range .status.errorLog }}{{printf \"%s:\\n %s\\n\" .component .log}}{{- end}}'")
i.currentStep.LogInfo("To fetch the application logs from the installer, run: kubectl logs -n kyma-installer -l name=kyma-installer")
} else {
i.currentStep.LogErrorf("Failed to get installation state, which may be OK. Will retry later...\nError: %s", err)
}
time.Sleep(10 * time.Second)
continue
} else {
return fmt.Errorf("Failed to get installation state: %s", err.Error())
}
time.Sleep(10 * time.Second)
continue
}

switch installationState.State {
Expand Down

0 comments on commit 2cc5d04

Please sign in to comment.