mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(docker): avoid host mountinfo false positives (#616)
This commit is contained in:
3 files changed
+48
-19
No files matched your search
+12
-1
@@ -149,6 +149,18 @@ class ContainerDetectorTest {
|
||||
assertTrue(d.isRunningInContainer());
|
||||
}
|
||||
|
||||
@Test
|
||||
void hostDockerMountsDoNotDetectAsContainer() {
|
||||
ContainerDetector d = detector(false, false, null,
|
||||
"""
|
||||
1505 1423 252:1 / / rw,relatime - ext4 /dev/mapper/root rw
|
||||
1514 1511 0:4 net:[4026533347] /run/docker/netns/abc rw - nsfs nsfs rw
|
||||
1538 1505 0:67 / /var/lib/docker/rootfs/abc rw - overlay overlay rw,lowerdir=/var/lib/containerd/snapshots/1/fs
|
||||
""",
|
||||
null, null, null);
|
||||
assertFalse(d.isRunningInContainer());
|
||||
}
|
||||
|
||||
@Test
|
||||
void detectedViaMountInfoMoby() {
|
||||
ContainerDetector d = detector(false, false, null,
|
||||
@@ -182,4 +194,3 @@ class ContainerDetectorTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -1,9 +1,7 @@
|
||||
package io.github.hectorvent.floci.services.s3;
|
||||
|
||||
import io.github.hectorvent.floci.testing.RestAssuredJsonUtils;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.config.EncoderConfig;
|
||||
import io.restassured.http.ContentType;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
@@ -25,9 +23,7 @@ class S3EventBridgeIntegrationTest {
|
||||
|
||||
@BeforeAll
|
||||
static void configureRestAssured() {
|
||||
RestAssured.config = RestAssured.config().encoderConfig(
|
||||
EncoderConfig.encoderConfig()
|
||||
.encodeContentTypeAs(EB_CONTENT_TYPE, ContentType.TEXT));
|
||||
RestAssuredJsonUtils.configureAwsContentTypes();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user