Skip to content

Commit

Permalink
Always set the ORACLE_DATABASE environment variable
Browse files Browse the repository at this point in the history
Older images that don't support a custom database will simply ignore it.
  • Loading branch information
0xced committed Feb 16, 2025
1 parent a311829 commit e17bd73
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Testcontainers.Oracle/OracleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ 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));
return Merge(DockerResourceConfiguration, new OracleConfiguration(database: database))
.WithEnvironment("ORACLE_DATABASE", database);
}

/// <summary>
Expand Down Expand Up @@ -84,11 +85,6 @@ 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 e17bd73

Please sign in to comment.