Skip to content

Commit

Permalink
Wrap Workload cluster errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoflorido committed Oct 7, 2024
1 parent 4e06b89 commit 6c139b3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/ck8s/workload_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,24 @@ func (w *Workload) RefreshWorkerCertificates(ctx context.Context, machine *clust
eg, ctx := errgroup.WithContext(ctx)
eg.Go(func() error {
seconds, err = w.refreshCertificatesRun(ctx, machine, nodeToken, &request)
return err
if err != nil {
return fmt.Errorf("failed to run refresh certificates: %w", err)
}
return nil
})

eg.Go(func() error {
return w.ApproveCertificates(ctx, machine, nodeToken, seed)
if err := w.ApproveCertificates(ctx, machine, nodeToken, seed); err != nil {
return fmt.Errorf("failed to approve certificates: %w", err)
}
return nil
})

if err := eg.Wait(); err != nil {
return 0, fmt.Errorf("failed to refresh worker certificates: %w", err)
}

return seconds, nil

}

func (w *Workload) RefreshControlPlaneCertificates(ctx context.Context, machine *clusterv1.Machine, nodeToken string, expirationSeconds int, extraSANs []string) (int, error) {
Expand Down

0 comments on commit 6c139b3

Please sign in to comment.