-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Build] Update krb5kdc test fixture base image and krb5 library (#119403
- Loading branch information
Showing
9 changed files
with
28 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
FROM ubuntu:14.04 | ||
ADD . /fixture | ||
FROM alpine:3.21.0 | ||
|
||
ADD src/main/resources /fixture | ||
RUN apk update && apk add -y --no-cache python3 krb5 krb5-server | ||
|
||
RUN echo kerberos.build.elastic.co > /etc/hostname | ||
RUN bash /fixture/src/main/resources/provision/installkdc.sh | ||
RUN sh /fixture/provision/installkdc.sh | ||
|
||
EXPOSE 88 | ||
EXPOSE 88/udp | ||
|
||
CMD sleep infinity | ||
CMD ["sleep", "infinity"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
import java.util.List; | ||
|
||
public final class Krb5kDcContainer extends DockerEnvironmentAwareTestContainer { | ||
public static final String DOCKER_BASE_IMAGE = "docker.elastic.co/elasticsearch-dev/krb5dc-fixture:1.0"; | ||
public static final String DOCKER_BASE_IMAGE = "docker.elastic.co/elasticsearch-dev/krb5dc-fixture:1.1"; | ||
private final TemporaryFolder temporaryFolder = new TemporaryFolder(); | ||
private final ProvisioningId provisioningId; | ||
private Path krb5ConfFile; | ||
|
@@ -39,14 +39,14 @@ public final class Krb5kDcContainer extends DockerEnvironmentAwareTestContainer | |
public enum ProvisioningId { | ||
HDFS( | ||
"hdfs", | ||
"/fixture/src/main/resources/provision/hdfs.sh", | ||
"/fixture/provision/hdfs.sh", | ||
"/fixture/build/keytabs/hdfs_hdfs.build.elastic.co.keytab", | ||
"/fixture/build/keytabs/elasticsearch.keytab", | ||
"hdfs/[email protected]" | ||
), | ||
PEPPA( | ||
"peppa", | ||
"/fixture/src/main/resources/provision/peppa.sh", | ||
"/fixture/provision/peppa.sh", | ||
"/fixture/build/keytabs/peppa.keytab", | ||
"/fixture/build/keytabs/HTTP_localhost.keytab", | ||
"[email protected]" | ||
|
@@ -94,7 +94,7 @@ public Krb5kDcContainer(ProvisioningId provisioningId) { | |
withNetworkAliases("kerberos.build.elastic.co", "build.elastic.co"); | ||
withCopyFileToContainer(MountableFile.forHostPath("/dev/urandom"), "/dev/random"); | ||
withExtraHost("kerberos.build.elastic.co", "127.0.0.1"); | ||
withCommand("bash", provisioningId.scriptPath); | ||
withCommand("sh", provisioningId.scriptPath); | ||
} | ||
|
||
@Override | ||
|
@@ -122,7 +122,7 @@ public String getConf() { | |
.findFirst(); | ||
String hostPortSpec = bindings.get().getHostPortSpec(); | ||
String s = copyFileFromContainer("/fixture/build/krb5.conf.template", i -> IOUtils.toString(i, StandardCharsets.UTF_8)); | ||
return s.replace("${MAPPED_PORT}", hostPortSpec); | ||
return s.replace("#KDC_DOCKER_HOST", "kdc = 127.0.0.1:" + hostPortSpec); | ||
} | ||
|
||
public Path getKeytab() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/fixtures/krb5kdc-fixture/src/main/resources/provision/hdfs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/fixtures/krb5kdc-fixture/src/main/resources/provision/peppa.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
|