Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

Commit c79fad2

Browse files
honnixclaude
andcommitted
fix: fix SpotBugs NP warning and Error Prone @var check
- Always create a fresh HostConfig to avoid null dereference path - Inline mkdirs() result to avoid non-constant variable Signed-off-by: Hongxin Liang <honnix@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d10b37e commit c79fad2

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

integration-tests/src/test/java/org/flyte/SerializeJavaIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ void testSerializeWorkflows() {
4040
// with the project root as working directory
4141
String serializePath = "integration-tests/target/protos";
4242
File tempDir = new File("../" + serializePath);
43-
boolean created = tempDir.mkdirs();
44-
if (!created && !tempDir.exists()) {
43+
if (!tempDir.mkdirs() && !tempDir.exists()) {
4544
throw new IOException("Unable to create path");
4645
}
4746

integration-tests/src/test/java/org/flyte/utils/FlyteSandboxContainer.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,13 @@ private static void patchInsecureEnvVar() {
160160
// k3s requires tmpfs mounts and cgroupns=host on Linux (CI)
161161
withTmpFs(Map.of("/run", "", "/var/run", ""));
162162
withCreateContainerCmdModifier(
163-
cmd -> {
164-
HostConfig hostConfig = cmd.getHostConfig();
165-
if (hostConfig == null) {
166-
hostConfig = new HostConfig();
167-
cmd.withHostConfig(hostConfig);
168-
}
169-
hostConfig
170-
.withCgroupnsMode("host")
171-
// host.docker.internal is needed by the bootstrap to template manifests;
172-
// Docker Desktop adds it automatically, but Linux Docker does not
173-
.withExtraHosts("host.docker.internal:host-gateway");
174-
});
163+
cmd ->
164+
cmd.withHostConfig(
165+
new HostConfig()
166+
.withCgroupnsMode("host")
167+
// host.docker.internal is needed by the bootstrap to template manifests;
168+
// Docker Desktop adds it automatically, but Linux Docker does not
169+
.withExtraHosts("host.docker.internal:host-gateway")));
175170

176171
withNetworkAliases("flyte");
177172

0 commit comments

Comments
 (0)