mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 02:31:10 +00:00
chore: fix linter error (#645)
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
parent
72951dc656
commit
1056180ca5
@ -93,7 +93,7 @@ func (d *haGroupDatasource) Configure(
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T",
|
||||
req.ProviderData),
|
||||
)
|
||||
|
||||
|
@ -81,7 +81,7 @@ func (d *haGroupsDatasource) Configure(
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T",
|
||||
req.ProviderData),
|
||||
)
|
||||
|
||||
|
@ -104,7 +104,7 @@ func (d *haResourceDatasource) Configure(
|
||||
} else {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T",
|
||||
req.ProviderData),
|
||||
)
|
||||
}
|
||||
@ -124,8 +124,7 @@ func (d *haResourceDatasource) Read(ctx context.Context, req datasource.ReadRequ
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected error parsing Proxmox HA resource identifier",
|
||||
fmt.Sprintf("Couldn't parse configuration into a valid HA resource identifier: %s. "+
|
||||
"Please report this issue to the provider developers.", err.Error()),
|
||||
fmt.Sprintf("Couldn't parse configuration into a valid HA resource identifier: %ss", err.Error()),
|
||||
)
|
||||
|
||||
return
|
||||
|
@ -98,7 +98,7 @@ func (d *haResourcesDatasource) Configure(
|
||||
} else {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T",
|
||||
req.ProviderData),
|
||||
)
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ func (d *versionDatasource) Configure(
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T",
|
||||
req.ProviderData),
|
||||
)
|
||||
|
||||
|
@ -136,7 +136,7 @@ func (r *hagroupResource) Configure(
|
||||
} else {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T",
|
||||
req.ProviderData),
|
||||
)
|
||||
}
|
||||
|
@ -151,8 +151,7 @@ func (r *haResourceResource) Configure(
|
||||
} else {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
req.ProviderData),
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -171,8 +170,7 @@ func (r *haResourceResource) Create(ctx context.Context, req resource.CreateRequ
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected error parsing Proxmox HA resource identifier",
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
|
||||
"Please report this issue to the provider developers.", err),
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
|
||||
)
|
||||
|
||||
return
|
||||
@ -214,8 +212,7 @@ func (r *haResourceResource) Update(
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected error parsing Proxmox HA resource identifier",
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
|
||||
"Please report this issue to the provider developers.", err),
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
|
||||
)
|
||||
|
||||
return
|
||||
@ -253,8 +250,7 @@ func (r *haResourceResource) Delete(
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected error parsing Proxmox HA resource identifier",
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
|
||||
"Please report this issue to the provider developers.", err),
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
|
||||
)
|
||||
|
||||
return
|
||||
@ -329,8 +325,7 @@ func (r *haResourceResource) read(ctx context.Context, data *haResourceModel) (b
|
||||
if err != nil {
|
||||
diags.AddError(
|
||||
"Unexpected error parsing Proxmox HA resource identifier",
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
|
||||
"Please report this issue to the provider developers.", err),
|
||||
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
|
||||
)
|
||||
|
||||
return false, diags
|
||||
|
@ -254,8 +254,7 @@ func (r *linuxBridgeResource) Configure(
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
req.ProviderData),
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
|
||||
)
|
||||
|
||||
return
|
||||
|
@ -228,8 +228,7 @@ func (r *linuxVLANResource) Configure(
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
req.ProviderData),
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
|
||||
)
|
||||
|
||||
return
|
||||
|
@ -464,8 +464,7 @@ func (r *clusterOptionsResource) Configure(
|
||||
if !ok {
|
||||
resp.Diagnostics.AddError(
|
||||
"Unexpected Resource Configure Type",
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
|
||||
req.ProviderData),
|
||||
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
|
||||
)
|
||||
|
||||
return
|
||||
|
@ -44,7 +44,7 @@ func AssertListMaxItems(t *testing.T, s *schema.Resource, key string, expectedMa
|
||||
t.Helper()
|
||||
|
||||
require.NotNil(t, s.Schema[key], "Error in Schema: Missing definition for \"%s\"", key)
|
||||
assert.Equal(t, s.Schema[key].MaxItems, expectedMaxItems,
|
||||
assert.Equal(t, expectedMaxItems, s.Schema[key].MaxItems,
|
||||
"Error in Schema: Argument \"%s\" has \"MaxItems: %#v\", but value %#v is expected!",
|
||||
key, s.Schema[key].MaxItems, expectedMaxItems)
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ func TestCloseOrLogError(t *testing.T) {
|
||||
func() {
|
||||
defer f(c)
|
||||
defer f(b)
|
||||
assert.Equal(t, false, c.isClosed)
|
||||
assert.False(t, c.isClosed)
|
||||
}()
|
||||
|
||||
assert.Equal(t, true, c.isClosed)
|
||||
assert.True(t, c.isClosed)
|
||||
}
|
||||
|
||||
type testCloser struct {
|
||||
|
Loading…
Reference in New Issue
Block a user