Fix: fix imports and names (#9)
* fix: add missing entries and correct refs * fix: add missing docs --------- Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
This commit is contained in:
parent
db080dc89a
commit
944a75295f
19 changed files with 424 additions and 235 deletions
|
|
@ -71,7 +71,7 @@ func (r *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
|
|||
"backup_schedule": `The backup schedule. Should follow the cron scheduling system format (e.g. "0 0 * * *").`,
|
||||
"options": "Custom parameters for the SQLServer Flex instance.",
|
||||
"region": "The resource region. If not defined, the provider region is used.",
|
||||
// TODO
|
||||
// TODO @mhenselin
|
||||
}
|
||||
|
||||
resp.Schema = schema.Schema{
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ func toCreatePayload(model *Model, storage *storageModel, encryption *encryption
|
|||
var aclElements []string
|
||||
if network != nil && !(network.ACL.IsNull() || network.ACL.IsUnknown()) {
|
||||
aclElements = make([]string, 0, len(network.ACL.Elements()))
|
||||
diags := network.ACL.ElementsAs(nil, &aclElements, false)
|
||||
diags := network.ACL.ElementsAs(context.TODO(), &aclElements, false)
|
||||
if diags.HasError() {
|
||||
return nil, fmt.Errorf("creating network: %w", core.DiagsToError(diags))
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ func toUpdatePayload(model *Model, storage *storageModel, network *networkModel)
|
|||
var aclElements []string
|
||||
if network != nil && !(network.ACL.IsNull() || network.ACL.IsUnknown()) {
|
||||
aclElements = make([]string, 0, len(network.ACL.Elements()))
|
||||
diags := network.ACL.ElementsAs(nil, &aclElements, false)
|
||||
diags := network.ACL.ElementsAs(context.TODO(), &aclElements, false)
|
||||
if diags.HasError() {
|
||||
return nil, fmt.Errorf("creating network: %w", core.DiagsToError(diags))
|
||||
}
|
||||
|
|
@ -349,7 +349,7 @@ func loadFlavorId(ctx context.Context, client sqlserverflexClient, model *Model,
|
|||
if f.Id == nil || f.Cpu == nil || f.Memory == nil {
|
||||
continue
|
||||
}
|
||||
if strings.ToLower(*f.NodeType) != strings.ToLower(*nodeType) {
|
||||
if !strings.EqualFold(*f.NodeType, *nodeType) {
|
||||
continue
|
||||
}
|
||||
if *f.Cpu == *cpu && *f.Memory == *ram {
|
||||
|
|
|
|||
|
|
@ -629,7 +629,6 @@ func (r *instanceResource) Create(ctx context.Context, req resource.CreateReques
|
|||
if flavor.RAM.IsNull() || flavor.RAM.IsUnknown() {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating instance", "Instance creation waiting: flavor ram is null or unknown")
|
||||
}
|
||||
// flavorData := getFlavorModelById(ctx, r.client, &model, flavor)
|
||||
|
||||
// Map response body to schema
|
||||
err = mapFields(ctx, waitResp, &model, flavor, storage, encryption, network, region)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue