Skip to content

Commit 0849463

Browse files
committed
Handle file existing and not existing scenarios
1 parent 3028de2 commit 0849463

File tree

1 file changed

+5
-1
lines changed
  • integration-tests/src/test/java/oracle/kubernetes/operator

1 file changed

+5
-1
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/SitConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ private static void copySitConfigFiles(String files[], String secretName) throws
191191
}
192192
path = Paths.get(dstDir, file);
193193
logger.log(Level.INFO, "to {0}", path.toString());
194-
Files.write(path, content.getBytes(charset), StandardOpenOption.TRUNCATE_EXISTING);
194+
if (path.toFile().exists()) {
195+
Files.write(path, content.getBytes(charset), StandardOpenOption.TRUNCATE_EXISTING);
196+
} else {
197+
Files.write(path, content.getBytes(charset));
198+
}
195199
}
196200
}
197201

0 commit comments

Comments
 (0)