mirror of
https://github.com/go-acme/lego.git
synced 2025-11-24 07:04:15 +02:00
hetzner: use int64 for IDs (#2720)
This commit is contained in:
committed by
GitHub
parent
0abf391bd1
commit
93b8bb71ca
@@ -184,7 +184,7 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
|
||||
return d.config.PropagationTimeout, d.config.PollingInterval
|
||||
}
|
||||
|
||||
func (d *DNSProvider) waitAction(ctx context.Context, actionID int) error {
|
||||
func (d *DNSProvider) waitAction(ctx context.Context, actionID int64) error {
|
||||
return wait.Retry(ctx,
|
||||
func() error {
|
||||
result, err := d.client.GetAction(ctx, actionID)
|
||||
|
||||
@@ -85,8 +85,8 @@ func (c *Client) RemoveRRSetRecords(ctx context.Context, zoneIDName, recordType,
|
||||
|
||||
// GetAction gets an action.
|
||||
// https://docs.hetzner.cloud/reference/cloud#actions-get-an-action
|
||||
func (c *Client) GetAction(ctx context.Context, id int) (*Action, error) {
|
||||
endpoint := c.BaseURL.JoinPath("actions", strconv.Itoa(id))
|
||||
func (c *Client) GetAction(ctx context.Context, id int64) (*Action, error) {
|
||||
endpoint := c.BaseURL.JoinPath("actions", strconv.FormatInt(id, 10))
|
||||
|
||||
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -49,7 +49,7 @@ func TestClient_AddRRSetRecords(t *testing.T) {
|
||||
Command: "add_rrset_records",
|
||||
Status: "running",
|
||||
Progress: 50,
|
||||
Resources: []Resources{{ID: 42, Type: "zone"}},
|
||||
Resources: []Resources{{ID: 590000000000000, Type: "zone"}},
|
||||
}
|
||||
|
||||
assert.Equal(t, expected, result)
|
||||
@@ -139,11 +139,11 @@ func TestClient_GetAction(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
expected := &Action{
|
||||
ID: 42,
|
||||
ID: 590000000000000,
|
||||
Command: "start_resource",
|
||||
Status: "running",
|
||||
Progress: 100,
|
||||
Resources: []Resources{{ID: 42, Type: "server"}},
|
||||
Resources: []Resources{{ID: 590000000000000, Type: "server"}},
|
||||
ErrorInfo: &ErrorInfo{
|
||||
Code: "action_failed",
|
||||
Message: "Action failed",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"finished": null,
|
||||
"resources": [
|
||||
{
|
||||
"id": 42,
|
||||
"id": 590000000000000,
|
||||
"type": "zone"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"action": {
|
||||
"id": 42,
|
||||
"id": 590000000000000,
|
||||
"command": "start_resource",
|
||||
"status": "running",
|
||||
"started": "2016-01-30T23:55:00+00:00",
|
||||
@@ -8,7 +8,7 @@
|
||||
"progress": 100,
|
||||
"resources": [
|
||||
{
|
||||
"id": 42,
|
||||
"id": 590000000000000,
|
||||
"type": "server"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -79,7 +79,7 @@ type ActionResponse struct {
|
||||
}
|
||||
|
||||
type Action struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Command string `json:"command,omitempty"`
|
||||
|
||||
// It can be: `running`, `success`, `error`.
|
||||
@@ -93,6 +93,6 @@ type Action struct {
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
ID int64 `json:"id,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user