Skip to content

Commit

Permalink
Revert "Always set the ORACLE_DATABASE environment variable"
Browse files Browse the repository at this point in the history
This reverts commit e17bd73.

Container would fail to start with this error.
> ORA-65012: Pluggable database FREEPDB1 already exists.
  • Loading branch information
0xced committed Feb 16, 2025
1 parent e17bd73 commit 9af66e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Testcontainers.Oracle/OracleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ private OracleBuilder(OracleConfiguration resourceConfiguration)
/// <returns>A configured instance of <see cref="OracleBuilder" />.</returns>
public OracleBuilder WithDatabase(string database)
{
return Merge(DockerResourceConfiguration, new OracleConfiguration(database: database))
.WithEnvironment("ORACLE_DATABASE", database);
return Merge(DockerResourceConfiguration, new OracleConfiguration(database: database));
}

/// <summary>
Expand Down Expand Up @@ -85,6 +84,11 @@ public override OracleContainer Build()
return new OracleContainer(WithDatabase(defaultServiceName).DockerResourceConfiguration);
}

if (DockerResourceConfiguration.Database != defaultServiceName)
{
return new OracleContainer(WithEnvironment("ORACLE_DATABASE", DockerResourceConfiguration.Database).DockerResourceConfiguration);
}

return new OracleContainer(DockerResourceConfiguration);
}

Expand Down

0 comments on commit 9af66e2

Please sign in to comment.