Skip to content

Commit 42d6353

Browse files
author
Adam Bowen
committed
parameterized 'mount base'
1 parent 3067ede commit 42d6353

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

provider_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func init() {
3535
testAccVDB.name = os.Getenv("TEST_VDBNAME")
3636
testAccVDB.groupName = os.Getenv("TEST_GROUP_NAME")
3737
testAccVDB.oracleHome = os.Getenv("TEST_ORACLE_HOME")
38+
testAccVDB.mountBase = os.Getenv("TEST_MOUNT_BASE")
3839
//dSources
3940
testAccDsource.name = os.Getenv("TEST_DELPHIX_DSOURCE_NAME")
4041
testAccDsource.description = os.Getenv("TEST_DELPHIX_DSOURCE_DESCRIPTION")

resource_delphix_oracle_si_vdb.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type VDB struct {
1717
groupName string
1818
dbName string
1919
oracleHome string
20+
mountBase string
2021
}
2122

2223
func resourceDelphixOracleSIVDB() *schema.Resource {
@@ -57,6 +58,11 @@ func resourceDelphixOracleSIVDB() *schema.Resource {
5758
Required: true,
5859
ForceNew: true,
5960
},
61+
"mount_base": &schema.Schema{
62+
Type: schema.TypeString,
63+
Required: true,
64+
ForceNew: true,
65+
},
6066
},
6167
}
6268
}
@@ -85,6 +91,7 @@ func resourceDelphixOracleSIVDBCreate(d *schema.ResourceData, meta interface{})
8591
environment: d.Get("environment").(string),
8692
groupName: d.Get("group_name").(string),
8793
oracleHome: d.Get("oracle_home").(string),
94+
mountBase: d.Get("mount_base").(string),
8895
}
8996

9097
vdbExists, err := client.FindDatabaseByName(vdb.name)
@@ -133,7 +140,7 @@ func resourceDelphixOracleSIVDBCreate(d *schema.ResourceData, meta interface{})
133140
},
134141
Source: &delphix.OracleVirtualSource{
135142
Type: "OracleVirtualSource",
136-
MountBase: "/mnt/provision",
143+
MountBase: vdb.mountBase,
137144
AllowAutoVDBRestartOnHostReboot: f,
138145
},
139146
SourceConfig: &delphix.OracleSIConfig{

resource_delphix_oracle_si_vdb_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,16 @@ func testAccCheckVDBConfigImported(c *Config, v *VDB) string {
110110
group_name = "%s"
111111
name = "%s"
112112
db_name = "%s"
113-
source = "ORACLE_DB_CONTAINER-96"
114-
environment = "UNIX_HOST_ENVIRONMENT-53"
113+
source = "ORACLE_DB_CONTAINER-4"
114+
environment = "UNIX_HOST_ENVIRONMENT-18"
115115
oracle_home = "%s"
116+
mount_base = "%s"
116117
}
117118
118119
variable "url" {
119120
default = "%s"
120121
}`,
121-
c.username, c.password, v.groupName, v.name, v.dbName, v.oracleHome, c.url,
122+
c.username, c.password, v.groupName, v.name, v.dbName, v.oracleHome, v.mountBase, c.url,
122123
)
123124
}
124125

@@ -134,15 +135,16 @@ func testAccCheckVDBConfigUpdatedName(c *Config, v *VDB, n string) string {
134135
group_name = "%s"
135136
name = "%s"
136137
db_name = "%s"
137-
source = "ORACLE_DB_CONTAINER-96"
138-
environment = "UNIX_HOST_ENVIRONMENT-53"
138+
source = "ORACLE_DB_CONTAINER-4"
139+
environment = "UNIX_HOST_ENVIRONMENT-18"
139140
oracle_home = "%s"
141+
mount_base = "%s"
140142
}
141143
142144
variable "url" {
143145
default = "%s"
144146
}`,
145-
c.username, c.password, v.groupName, n, v.dbName, v.oracleHome, c.url,
147+
c.username, c.password, v.groupName, n, v.dbName, v.oracleHome, v.mountBase, c.url,
146148
)
147149
}
148150

@@ -161,12 +163,13 @@ func testAccCheckVDBConfigUpdatedMult(c *Config, v *VDB, g string, n string, d s
161163
source = "ORACLE_DB_CONTAINER-96"
162164
environment = "UNIX_HOST_ENVIRONMENT-53"
163165
oracle_home = "%s"
166+
mount_base = "%s"
164167
}
165168
166169
variable "url" {
167170
default = "%s"
168171
}`,
169-
c.username, c.password, g, n, d, v.oracleHome, c.url,
172+
c.username, c.password, g, n, d, v.oracleHome, v.mountBase, c.url,
170173
)
171174
}
172175

0 commit comments

Comments
 (0)