Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Aerospike Enterprise #1741

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AerospikeEnterpriseConfigurer {
private final AerospikeProperties aerospikeProperties;
private final AerospikeEnterpriseProperties enterpriseProperties;

public void configure(GenericContainer<?> aerospikeContainer) throws IOException, InterruptedException {
public void configure(GenericContainer<?> aerospikeContainer) throws IOException, InterruptedException {
if (aerospikeProperties.getFeatureKey() == null || aerospikeProperties.getFeatureKey().isBlank()) {
log.warn("Evaluation feature key file not provided by 'embedded.aerospike.featureKey' property. " +
"Pay attention to license details: https://github.com/aerospike/aerospike-server.docker/blob/master/enterprise/ENTERPRISE_LICENSE");
Expand All @@ -32,9 +32,9 @@ private void setupDisallowExpunge(GenericContainer<?> aerospikeContainer) throws
String namespace = aerospikeProperties.getNamespace();
Container.ExecResult result = aerospikeContainer.execInContainer("asadm", "-e",
String.format("enable; manage config namespace %s param disallow-expunge to true", namespace));
if (result.getStderr().length() > 0) {
if (result.getExitCode() != 0) {
throw new IllegalStateException("Failed to set up 'disallow-expunge' to true: " + result.getStderr());
}
log.info("Set up 'disallow-expunge' to true: {}", result.getStdout());
log.info("Success setting up 'disallow-expunge' to true");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public class EnterpriseAerospikeTestOperationsAutoConfiguration {
@Bean
@ConditionalOnProperty(value = "embedded.aerospike.time-travel.enabled", havingValue = "true", matchIfMissing = true)
public ExpiredDocumentsCleaner expiredDocumentsCleaner(IAerospikeClient client,
AerospikeEnterpriseProperties aerospikeEnterpriseProperties,
AerospikeProperties properties) {
return new AerospikeExpiredDocumentsCleaner(client, properties.getNamespace(), true);
return new AerospikeExpiredDocumentsCleaner(client, properties.getNamespace(), aerospikeEnterpriseProperties.isDurableDeletes());
}

}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
embedded.aerospike.dockerImage=aerospike/aerospike-server-enterprise:6.3.0.16
embedded.aerospike.dockerImage=aerospike/aerospike-server-enterprise:7.0.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ void failOnNonEnterpriseImage() {

@Test
void failOnUnsuitableEnterpriseImageVersion() {
contextRunner.withPropertyValues("embedded.aerospike.dockerImage=aerospike/aerospike-server-enterprise:6.1.0.16_1")
contextRunner.withPropertyValues("embedded.aerospike.dockerImage=aerospike/aerospike-server-enterprise:6.1.0.16")
.run(context -> assertThat(context).hasFailed());
}

@Test
void skipValidation() {
contextRunner.withPropertyValues("embedded.aerospike.dockerImage=aerospike-server:6.1.0.16_1",
contextRunner.withPropertyValues("embedded.aerospike.dockerImage=aerospike-server:6.1.0.16",
"embedded.aerospike.enabled=false")
.run(context -> assertThat(context).hasNotFailed());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.playtika.testcontainer" level="info"/>
<Logger name="com.playtika.testcontainers" level="info"/>
<Logger name="org.springframework" level="error"/>
<Root level="error">
<AppenderRef ref="Console"/>
Expand Down
Loading