Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion internal/probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"time"

Expand Down Expand Up @@ -221,7 +223,8 @@ func (a *Agent) registerServer(ctx context.Context) error {
}()

if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afritzler do we want to retry on all errors? 401 or 403 for example won't fix themselves

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO I would keep it simple for now. But you are are of course right.

a.log.Error(err, "Failed to register server", "url", a.RegistryURL)
body, _ := io.ReadAll(io.LimitReader(resp.Body, 1024))
a.log.Error(fmt.Errorf("HTTP %d: %s", resp.StatusCode, string(body)), "Failed to register server", "url", a.RegistryURL)
Comment thread
stefanhipfel marked this conversation as resolved.
Outdated
return false, nil
}

Expand Down
Loading