fix: pipeline fixes
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Prepare GO cache (pull_request) Successful in 6m40s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 17m11s
CI Workflow / CI run build and linting (pull_request) Successful in 21m11s
CI Workflow / Code coverage report (pull_request) Successful in 14s
CI Workflow / CI run tests (pull_request) Failing after 23m33s
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Prepare GO cache (pull_request) Successful in 6m40s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 17m11s
CI Workflow / CI run build and linting (pull_request) Successful in 21m11s
CI Workflow / Code coverage report (pull_request) Successful in 14s
CI Workflow / CI run tests (pull_request) Failing after 23m33s
This commit is contained in:
parent
d971a470dc
commit
ea0a749cd8
5 changed files with 11 additions and 63 deletions
|
|
@ -19,8 +19,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// Default location of credentials JSON
|
||||
// credentialsFilePath = ".stackit/credentials.json" //nolint:gosec // linter false positive
|
||||
// Default location of service account JSON
|
||||
serviceAccountFilePath = "service_account.json"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -54,14 +54,6 @@ func TestInstanceResourceSchema(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
var (
|
||||
//go:embed testdata/resource-no-enc.tf
|
||||
resourceConfigNoEnc string //nolint:unused // needs implementation
|
||||
|
||||
//go:embed testdata/resource-enc.tf
|
||||
resourceConfigEnc string //nolint:unused // needs implementation
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
testutils.Setup()
|
||||
code := m.Run()
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
variable "project_id" {}
|
||||
variable "kek_key_id" {}
|
||||
variable "kek_key_ring_id" {}
|
||||
|
||||
resource "stackitprivatepreview_postgresflexalpha_instance" "msh-instance-only" {
|
||||
project_id = var.project_id
|
||||
name = "example-instance"
|
||||
backup_schedule = "0 0 * * *"
|
||||
retention_days = 30
|
||||
flavor_id = "2.4"
|
||||
replicas = 1
|
||||
storage = {
|
||||
performance_class = "premium-perf2-stackit"
|
||||
size = 10
|
||||
}
|
||||
encryption = {
|
||||
kek_key_id = var.kek_key_id
|
||||
kek_key_ring_id = var.kek_key_ring_id
|
||||
kek_key_version = 1
|
||||
service_account = "service@account.email"
|
||||
}
|
||||
network = {
|
||||
acl = ["0.0.0.0/0"]
|
||||
access_scope = "PUBLIC"
|
||||
}
|
||||
version = 17
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
variable "project_id" {}
|
||||
|
||||
resource "stackitprivatepreview_postgresflexalpha_instance" "msh-instance-only" {
|
||||
project_id = var.project_id
|
||||
name = "example-instance"
|
||||
backup_schedule = "0 0 * * *"
|
||||
retention_days = 30
|
||||
flavor_id = "2.4"
|
||||
replicas = 1
|
||||
storage = {
|
||||
performance_class = "premium-perf2-stackit"
|
||||
size = 10
|
||||
}
|
||||
network = {
|
||||
acl = ["0.0.0.0/0"]
|
||||
access_scope = "PUBLIC"
|
||||
}
|
||||
version = 17
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
|
|
@ -45,7 +44,10 @@ var (
|
|||
_ provider.Provider = &Provider{}
|
||||
)
|
||||
|
||||
const providerConfigError = "Error configuring provider"
|
||||
|
||||
//nolint:unused // These constants are defined for future use in retry logic for HTTP requests, which is not yet implemented.
|
||||
/*
|
||||
const (
|
||||
// maxRetries is the maximum number of retries for a failed HTTP request.
|
||||
maxRetries = 3
|
||||
|
|
@ -56,6 +58,7 @@ const (
|
|||
// perTryTimeout is the timeout for each individual HTTP request attempt.
|
||||
perTryTimeout = 30 * time.Second
|
||||
)
|
||||
*/
|
||||
|
||||
// Provider is the provider implementation.
|
||||
type Provider struct {
|
||||
|
|
@ -91,7 +94,7 @@ type providerModel struct {
|
|||
// Custom endpoints
|
||||
AuthorizationCustomEndpoint types.String `tfsdk:"authorization_custom_endpoint"`
|
||||
CdnCustomEndpoint types.String `tfsdk:"cdn_custom_endpoint"`
|
||||
DnsCustomEndpoint types.String `tfsdk:"dns_custom_endpoint"`
|
||||
DNSCustomEndpoint types.String `tfsdk:"dns_custom_endpoint"`
|
||||
GitCustomEndpoint types.String `tfsdk:"git_custom_endpoint"`
|
||||
IaaSCustomEndpoint types.String `tfsdk:"iaas_custom_endpoint"`
|
||||
KmsCustomEndpoint types.String `tfsdk:"kms_custom_endpoint"`
|
||||
|
|
@ -369,7 +372,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
core.LogAndAddError(
|
||||
ctx,
|
||||
&resp.Diagnostics,
|
||||
"Error configuring provider",
|
||||
providerConfigError,
|
||||
fmt.Sprintf("Setting up bool value: %v", diags.Errors()),
|
||||
)
|
||||
}
|
||||
|
|
@ -388,7 +391,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
|
||||
setStringField(providerConfig.DefaultRegion, func(v string) { providerData.DefaultRegion = v })
|
||||
setStringField(
|
||||
providerConfig.Region,
|
||||
providerConfig.Region, // nolint:staticcheck // preliminary handling of deprecated attribute
|
||||
func(v string) { providerData.Region = v }, // nolint:staticcheck // preliminary handling of deprecated attribute
|
||||
)
|
||||
setBoolField(providerConfig.EnableBetaResources, func(v bool) { providerData.EnableBetaResources = v })
|
||||
|
|
@ -398,7 +401,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
func(v string) { providerData.AuthorizationCustomEndpoint = v },
|
||||
)
|
||||
setStringField(providerConfig.CdnCustomEndpoint, func(v string) { providerData.CdnCustomEndpoint = v })
|
||||
setStringField(providerConfig.DnsCustomEndpoint, func(v string) { providerData.DnsCustomEndpoint = v })
|
||||
setStringField(providerConfig.DNSCustomEndpoint, func(v string) { providerData.DnsCustomEndpoint = v })
|
||||
setStringField(providerConfig.GitCustomEndpoint, func(v string) { providerData.GitCustomEndpoint = v })
|
||||
setStringField(providerConfig.IaaSCustomEndpoint, func(v string) { providerData.IaaSCustomEndpoint = v })
|
||||
setStringField(providerConfig.KmsCustomEndpoint, func(v string) { providerData.KMSCustomEndpoint = v })
|
||||
|
|
@ -472,7 +475,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
core.LogAndAddError(
|
||||
ctx,
|
||||
&resp.Diagnostics,
|
||||
"Error configuring provider",
|
||||
providerConfigError,
|
||||
fmt.Sprintf("Setting up experiments: %v", diags.Errors()),
|
||||
)
|
||||
}
|
||||
|
|
@ -484,7 +487,7 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest,
|
|||
core.LogAndAddError(
|
||||
ctx,
|
||||
&resp.Diagnostics,
|
||||
"Error configuring provider",
|
||||
providerConfigError,
|
||||
fmt.Sprintf("Setting up authentication: %v", err),
|
||||
)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue