Harden worker federation and operator UI
This commit is contained in:
@@ -124,8 +124,8 @@ func (c Client) Ack(ctx context.Context, cursor uint64) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
func (c Client) Heartbeat(ctx context.Context) error {
|
||||
resp, err := c.request(ctx, http.MethodPost, "/v1/federation/workers/"+url.PathEscape(c.WorkerID)+"/heartbeat", nil)
|
||||
func (c Client) Heartbeat(ctx context.Context, health WorkerHealth) error {
|
||||
resp, err := c.request(ctx, http.MethodPost, "/v1/federation/workers/"+url.PathEscape(c.WorkerID)+"/heartbeat", health)
|
||||
if resp != nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
@@ -146,6 +146,8 @@ func (c Client) PutArtifact(ctx context.Context, b []byte) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/octet-stream")
|
||||
req.Header.Set("X-Orchestra-Worker", c.WorkerID)
|
||||
req.Header.Set("Authorization", "Bearer "+c.Token)
|
||||
h := c.HTTP
|
||||
if h == nil {
|
||||
h = http.DefaultClient
|
||||
|
||||
Reference in New Issue
Block a user