Skip to content

Commit 9af66e2

Browse files
committed
Revert "Always set the ORACLE_DATABASE environment variable"
This reverts commit e17bd73. Container would fail to start with this error. > ORA-65012: Pluggable database FREEPDB1 already exists.
1 parent e17bd73 commit 9af66e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Testcontainers.Oracle/OracleBuilder.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ private OracleBuilder(OracleConfiguration resourceConfiguration)
4747
/// <returns>A configured instance of <see cref="OracleBuilder" />.</returns>
4848
public OracleBuilder WithDatabase(string database)
4949
{
50-
return Merge(DockerResourceConfiguration, new OracleConfiguration(database: database))
51-
.WithEnvironment("ORACLE_DATABASE", database);
50+
return Merge(DockerResourceConfiguration, new OracleConfiguration(database: database));
5251
}
5352

5453
/// <summary>
@@ -85,6 +84,11 @@ public override OracleContainer Build()
8584
return new OracleContainer(WithDatabase(defaultServiceName).DockerResourceConfiguration);
8685
}
8786

87+
if (DockerResourceConfiguration.Database != defaultServiceName)
88+
{
89+
return new OracleContainer(WithEnvironment("ORACLE_DATABASE", DockerResourceConfiguration.Database).DockerResourceConfiguration);
90+
}
91+
8892
return new OracleContainer(DockerResourceConfiguration);
8993
}
9094

0 commit comments

Comments
 (0)