Skip to content

Commit

Permalink
etcd: update to v3.5.9
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>
  • Loading branch information
lburgazzoli committed May 28, 2023
1 parent 7374906 commit 927dd07
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
export TC_USER="$(id -u):$(id -g)"
echo "tc user -> $TC_USER"
./gradlew spotlessCheck
./gradlew test
./gradlew publishToSonatype -Prelease.forceSnapshot
3 changes: 3 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ jobs:
distribution: 'temurin'
- name: Build Project
run: |
export TC_USER="$(id -u):$(id -g)"
echo "tc user -> $TC_USER"
./gradlew check -x test
./gradlew test
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.testcontainers.containers.Network;

public final class Etcd {
public static final String CONTAINER_IMAGE = "gcr.io/etcd-development/etcd:v3.5.4";
public static final String CONTAINER_IMAGE = "gcr.io/etcd-development/etcd:v3.5.9";
public static final int ETCD_CLIENT_PORT = 2379;
public static final int ETCD_PEER_PORT = 2380;
public static final String ETCD_DATA_DIR = "/data.etcd";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ protected void configure() {
withLogConsumer(new Slf4jLogConsumer(LOGGER).withPrefix(node));
withCommand(createCommand());

String user = System.getenv("TC_USER");
if (user != null) {
withCreateContainerCmdModifier(c -> c.withUser(user));
}

waitingFor(Wait.forLogMessage(".*ready to serve client requests.*", 1));
}

Expand Down Expand Up @@ -188,11 +193,15 @@ private String[] createCommand() {

private static void deleteDataDirectory(Path dir) {
if (dir != null && Files.exists(dir)) {
try (Stream<Path> stream = Files.walk(dir)) {
stream.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
} catch (IOException e) {
try {
try (Stream<Path> stream = Files.walk(dir)) {
stream.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
} catch (IOException e) {
LOGGER.error("Error deleting directory {}", dir, e);
}
} catch (Exception e) {
LOGGER.error("Error deleting directory {}", dir, e);
}
}
Expand Down

0 comments on commit 927dd07

Please sign in to comment.