chore(iaas): move beta resources and datasources to GA (#717)
relates to STACKITTPR-103
This commit is contained in:
parent
176fb8408f
commit
727d67af01
59 changed files with 80 additions and 518 deletions
|
|
@ -33,16 +33,10 @@ import (
|
|||
"github.com/stackitcloud/stackit-sdk-go/services/iaas/wait"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/features"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
|
||||
)
|
||||
|
||||
// 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 = &serverResource{}
|
||||
|
|
@ -162,14 +156,6 @@ func (r *serverResource) Configure(ctx context.Context, req resource.ConfigureRe
|
|||
return
|
||||
}
|
||||
|
||||
if !resourceBetaCheckDone {
|
||||
features.CheckBetaResourcesEnabled(ctx, &providerData, &resp.Diagnostics, "stackit_server", "resource")
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
resourceBetaCheckDone = true
|
||||
}
|
||||
|
||||
var apiClient *iaas.APIClient
|
||||
var err error
|
||||
if providerData.IaaSCustomEndpoint != "" {
|
||||
|
|
@ -982,9 +968,11 @@ func toCreatePayload(ctx context.Context, model *Model) (*iaas.CreateServerPaylo
|
|||
}
|
||||
}
|
||||
|
||||
var userData *string
|
||||
var userData *[]byte
|
||||
if !model.UserData.IsNull() && !model.UserData.IsUnknown() {
|
||||
encodedUserData := base64.StdEncoding.EncodeToString([]byte(model.UserData.ValueString()))
|
||||
src := []byte(model.UserData.ValueString())
|
||||
encodedUserData := make([]byte, base64.StdEncoding.EncodedLen(len(src)))
|
||||
base64.StdEncoding.Encode(encodedUserData, src)
|
||||
userData = &encodedUserData
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue