Skip to content

Commit

Permalink
If the grpc certificate changed, reboot metal-hammer (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Feb 4, 2025
1 parent 726ce5d commit 96729c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/grpc/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"log/slog"
"strings"
"time"

v1 "github.com/metal-stack/metal-api/pkg/api/v1"
Expand All @@ -25,6 +26,10 @@ func WaitForAllocation(ctx context.Context, log *slog.Logger, service v1.BootSer
if err != nil {
log.Error("failed waiting for allocation", "retry after", timeout, "error", err)

if strings.Contains(err.Error(), "failed to verify certificate") {
return fmt.Errorf("certificate changed, rebooting")
}

time.Sleep(timeout)
continue
}
Expand Down

0 comments on commit 96729c0

Please sign in to comment.