This commit is contained in:
asteam
2024-12-04 13:18:58 +03:00
parent 003e4d656e
commit 76ea459b3d
417 changed files with 30051 additions and 975 deletions

View File

@@ -59,14 +59,17 @@ func resourceComputeInputChecks(ctx context.Context, plan *models.ResourceComput
diags.AddError(fmt.Sprintf("Cannot create compute because extnet ID %d is not allowed or does not exist", extNetId), err.Error())
}
case "VFNIC":
if strings.EqualFold(plan.Driver.ValueString(), "KVM_PPC") {
diags.AddError("can't create compute because 'VFNIC' net_type is not allowed for driver 'KVM_PPC'", "")
}
vfpoolId := uint64(elemMap["net_id"].(types.Int64).ValueInt64())
err = ic.ExistVFPool(ctx, vfpoolId, c)
if err != nil {
diags.AddError(fmt.Sprintf("Cannot create compute because vfpool ID %d is not allowed or does not exist", vfpoolId), err.Error())
}
case "DPDK":
dpdkId := uint64(elemMap["net_id"].(types.Int64).ValueInt64())
err = ic.ExistDPDK(ctx, dpdkId, c)
if err != nil {
diags.AddError(fmt.Sprintf("Cannot create compute because DPDK net ID %d is not allowed or does not exist", dpdkId), err.Error())
}
}
}
}