fix: fix flavor null ability
This commit is contained in:
parent
4ca2d6a05d
commit
70343b2193
2 changed files with 7 additions and 8 deletions
|
|
@ -85,7 +85,7 @@ type resData struct {
|
|||
Region string
|
||||
Name string
|
||||
TfName string
|
||||
FlavorID string
|
||||
FlavorID *string
|
||||
BackupSchedule string
|
||||
UseEncryption bool
|
||||
KekKeyID string
|
||||
|
|
@ -124,7 +124,7 @@ func getExample() resData {
|
|||
ProjectID: os.Getenv("TF_ACC_PROJECT_ID"),
|
||||
Name: name,
|
||||
TfName: name,
|
||||
FlavorID: singleFlavorID,
|
||||
FlavorID: utils.Ptr(singleFlavorID),
|
||||
BackupSchedule: "0 0 * * *",
|
||||
UseEncryption: false,
|
||||
RetentionDays: 33,
|
||||
|
|
@ -358,7 +358,7 @@ func TestAccInstance(t *testing.T) {
|
|||
|
||||
func TestAccInstanceHA(t *testing.T) {
|
||||
data := getExample()
|
||||
data.FlavorID = replicasFlavorID
|
||||
data.FlavorID = utils.Ptr(replicasFlavorID)
|
||||
data.Replicas = 3
|
||||
|
||||
testItemID := testutils.ResStr(pfx, "instance", data.TfName)
|
||||
|
|
@ -963,7 +963,7 @@ func getDatabaseTestID(name string) func(s *terraform.State) (string, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func getUserTestID(name string) func(s *terraform.State) (string, error) {
|
||||
func getUserTestID(name string) func(s *teraform.State) (string, error) {
|
||||
return func(s *terraform.State) (string, error) {
|
||||
r, ok := s.RootModule().Resources[testutils.ResStr(pfx, "user", name)]
|
||||
if !ok {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ type resData struct {
|
|||
Region string
|
||||
Name string
|
||||
TfName string
|
||||
FlavorID string
|
||||
FlavorID *string
|
||||
BackupSchedule string
|
||||
UseEncryption bool
|
||||
UseFlavorId bool
|
||||
|
|
@ -125,7 +125,7 @@ func getExample() resData {
|
|||
ProjectID: os.Getenv("TF_ACC_PROJECT_ID"),
|
||||
Name: name,
|
||||
TfName: name,
|
||||
FlavorID: "4.16-Single",
|
||||
FlavorID: utils.Ptr("4.16-Single"),
|
||||
BackupSchedule: "0 0 * * *",
|
||||
UseEncryption: false,
|
||||
RetentionDays: 33,
|
||||
|
|
@ -387,7 +387,6 @@ func TestAccInstanceNoEncryptionWithFlavorObject(t *testing.T) {
|
|||
data := getExample()
|
||||
|
||||
data.UseFlavorId = false
|
||||
data.FlavorID = ""
|
||||
data.FlavorCpu = 4
|
||||
data.FlavorRam = 16
|
||||
data.Replicas = 1
|
||||
|
|
@ -583,7 +582,7 @@ func basicInstanceTestChecks(testItemID string, data resData) resource.TestCheck
|
|||
resource.TestCheckResourceAttr(testItemID, "backup_schedule", data.BackupSchedule),
|
||||
|
||||
resource.TestCheckResourceAttrSet(testItemID, "flavor_id"),
|
||||
resource.TestCheckResourceAttr(testItemID, "flavor_id", data.FlavorID),
|
||||
resource.TestCheckResourceAttr(testItemID, "flavor_id", *data.FlavorID),
|
||||
|
||||
resource.TestCheckResourceAttrSet(testItemID, "id"),
|
||||
resource.TestCheckResourceAttrSet(testItemID, "instance_id"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue