bootstrapper: calculate duration for all Helm charts

This commit is contained in:
Nils Hanke 2023-03-13 16:22:22 +01:00 committed by Nils Hanke
parent 4bf2498793
commit c1112addff
2 changed files with 7 additions and 4 deletions

View File

@ -214,9 +214,14 @@ func (h *Client) install(ctx context.Context, chartRaw []byte, values map[string
// Other errors will not be retried.
newCtx, cancel := context.WithTimeout(ctx, 10*time.Minute)
defer cancel()
retryLoopStartTime := time.Now()
if err := retrier.Do(newCtx); err != nil {
return fmt.Errorf("helm install: %w", err)
}
retryLoopFinishDuration := time.Since(retryLoopStartTime)
h.log.With(zap.String("chart", chart.Name()), zap.Duration("duration", retryLoopFinishDuration)).Infof("Helm chart installation finished")
return nil
}
@ -230,7 +235,7 @@ type installDoer struct {
// Do logs which chart is installed and tries to install it.
func (i installDoer) Do(ctx context.Context) error {
i.log.With(zap.String("chart", i.chart.Name())).Infof("Trying to install helm chart")
i.log.With(zap.String("chart", i.chart.Name())).Infof("Trying to install Helm chart")
_, err := i.client.RunWithContext(ctx, i.chart, i.values)

View File

@ -248,12 +248,10 @@ func (k *KubeWrapper) InitCluster(
// cert-manager is necessary for our operator deployments.
log.Infof("Installing cert-manager")
timeToStartWaiting = time.Now()
if err = k.helmClient.InstallCertManager(ctx, helmReleases.CertManager); err != nil {
return nil, fmt.Errorf("installing cert-manager: %w", err)
}
timeUntilFinishedWaiting = time.Since(timeToStartWaiting)
log.With(zap.Duration("duration", timeUntilFinishedWaiting)).Infof("cert-manager installation finished")
operatorVals, err := k.setupOperatorVals(ctx)
if err != nil {
return nil, fmt.Errorf("setting up operator vals: %w", err)