mirror of
https://github.com/go-acme/lego.git
synced 2025-11-26 08:01:26 +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
|
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,
|
return wait.Retry(ctx,
|
||||||
func() error {
|
func() error {
|
||||||
result, err := d.client.GetAction(ctx, actionID)
|
result, err := d.client.GetAction(ctx, actionID)
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ func (c *Client) RemoveRRSetRecords(ctx context.Context, zoneIDName, recordType,
|
|||||||
|
|
||||||
// GetAction gets an action.
|
// GetAction gets an action.
|
||||||
// https://docs.hetzner.cloud/reference/cloud#actions-get-an-action
|
// https://docs.hetzner.cloud/reference/cloud#actions-get-an-action
|
||||||
func (c *Client) GetAction(ctx context.Context, id int) (*Action, error) {
|
func (c *Client) GetAction(ctx context.Context, id int64) (*Action, error) {
|
||||||
endpoint := c.BaseURL.JoinPath("actions", strconv.Itoa(id))
|
endpoint := c.BaseURL.JoinPath("actions", strconv.FormatInt(id, 10))
|
||||||
|
|
||||||
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
|
req, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func TestClient_AddRRSetRecords(t *testing.T) {
|
|||||||
Command: "add_rrset_records",
|
Command: "add_rrset_records",
|
||||||
Status: "running",
|
Status: "running",
|
||||||
Progress: 50,
|
Progress: 50,
|
||||||
Resources: []Resources{{ID: 42, Type: "zone"}},
|
Resources: []Resources{{ID: 590000000000000, Type: "zone"}},
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, expected, result)
|
assert.Equal(t, expected, result)
|
||||||
@@ -139,11 +139,11 @@ func TestClient_GetAction(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
expected := &Action{
|
expected := &Action{
|
||||||
ID: 42,
|
ID: 590000000000000,
|
||||||
Command: "start_resource",
|
Command: "start_resource",
|
||||||
Status: "running",
|
Status: "running",
|
||||||
Progress: 100,
|
Progress: 100,
|
||||||
Resources: []Resources{{ID: 42, Type: "server"}},
|
Resources: []Resources{{ID: 590000000000000, Type: "server"}},
|
||||||
ErrorInfo: &ErrorInfo{
|
ErrorInfo: &ErrorInfo{
|
||||||
Code: "action_failed",
|
Code: "action_failed",
|
||||||
Message: "Action failed",
|
Message: "Action failed",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"finished": null,
|
"finished": null,
|
||||||
"resources": [
|
"resources": [
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 590000000000000,
|
||||||
"type": "zone"
|
"type": "zone"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"action": {
|
"action": {
|
||||||
"id": 42,
|
"id": 590000000000000,
|
||||||
"command": "start_resource",
|
"command": "start_resource",
|
||||||
"status": "running",
|
"status": "running",
|
||||||
"started": "2016-01-30T23:55:00+00:00",
|
"started": "2016-01-30T23:55:00+00:00",
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"progress": 100,
|
"progress": 100,
|
||||||
"resources": [
|
"resources": [
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 590000000000000,
|
||||||
"type": "server"
|
"type": "server"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ type ActionResponse struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Action struct {
|
type Action struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int64 `json:"id,omitempty"`
|
||||||
Command string `json:"command,omitempty"`
|
Command string `json:"command,omitempty"`
|
||||||
|
|
||||||
// It can be: `running`, `success`, `error`.
|
// It can be: `running`, `success`, `error`.
|
||||||
@@ -93,6 +93,6 @@ type Action struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Resources struct {
|
type Resources struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int64 `json:"id,omitempty"`
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user