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

Use nip.io domain in MinioExtension #6856

Merged
merged 2 commits into from
May 19, 2023
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 @@ -47,6 +47,7 @@ final class MinioContainer extends GenericContainer<MinioContainer>

private static final String DEFAULT_STORAGE_DIRECTORY = "/data";
private static final String HEALTH_ENDPOINT = "/minio/health/ready";
private static final String MINIO_DOMAIN_NIP = "minio.127-0-0-1.nip.io";

private final String accessKey;
private final String secretKey;
Expand Down Expand Up @@ -74,7 +75,7 @@ public MinioContainer(String image, String accessKey, String secretKey, String b
withEnv(MINIO_ACCESS_KEY, this.accessKey);
withEnv(MINIO_SECRET_KEY, this.secretKey);
// S3 SDK encodes bucket names in host names - need to tell Minio which domain to use
withEnv(MINIO_DOMAIN, "localhost");
withEnv(MINIO_DOMAIN, MINIO_DOMAIN_NIP);
withCommand("server", DEFAULT_STORAGE_DIRECTORY);
setWaitStrategy(
new HttpWaitStrategy()
Expand Down Expand Up @@ -149,7 +150,7 @@ public URI s3BucketUri(String path) {
public void start() {
super.start();

this.hostPort = getHost() + ":" + getMappedPort(DEFAULT_PORT);
this.hostPort = MINIO_DOMAIN_NIP + ":" + getMappedPort(DEFAULT_PORT);
this.s3endpoint = String.format("http://%s/", hostPort);
this.bucketBaseUri = URI.create(String.format("s3://%s/", bucket()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
// Disable tests on GitHub Actions
return enabled("Running on macOS locally");
}
return disabled(
format(
"Disabled on %s, because it doesn't support wildcard localhost FQDNs.",
OS.current().name()));
return disabled(format("Disabled on %s", OS.current().name()));
Copy link
Contributor Author

@adutra adutra May 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I think the extension is also compatible with Windows now, but I can't really guarantee. This is why I simplified the message.

}

@Override
Expand Down