fix(beta): remove caching of beta checks (#757)
beta checks caused issues when debugging relates to STACKITTPR-206
This commit is contained in:
parent
d6749b6ce3
commit
7cc9ca4fd4
6 changed files with 18 additions and 66 deletions
|
|
@ -30,11 +30,6 @@ import (
|
|||
"github.com/stackitcloud/stackit-sdk-go/services/serverupdate"
|
||||
)
|
||||
|
||||
// resourceBetaCheckDone is used to prevent multiple checks for beta resources.
|
||||
// This is a workaround for the lack of a global state in the provider and
|
||||
// needs to exist because the Configure method is called twice.
|
||||
var resourceBetaCheckDone bool
|
||||
|
||||
// Ensure the implementation satisfies the expected interfaces.
|
||||
var (
|
||||
_ resource.Resource = &scheduleResource{}
|
||||
|
|
@ -115,12 +110,9 @@ func (r *scheduleResource) Configure(ctx context.Context, req resource.Configure
|
|||
return
|
||||
}
|
||||
|
||||
if !resourceBetaCheckDone {
|
||||
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_update_schedule", "resource")
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
resourceBetaCheckDone = true
|
||||
features.CheckBetaResourcesEnabled(ctx, &r.providerData, &resp.Diagnostics, "stackit_server_update_schedule", "resource")
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
var apiClient *serverupdate.APIClient
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue