Skip to content

Commit

Permalink
[test] Create subdir in config dir if required
Browse files Browse the repository at this point in the history
This commit updates the local cluster factory so that extra config
files (see `LocalSecpBuilder.configFile`) can be placed into
subdirectories of the config dir.
This is needed when creating files for the `FileSettingsService` -
these k8s managed files are required to be in an `"operator/"`
directory within the general configuration directory.
  • Loading branch information
tvernum committed Sep 6, 2023
1 parent bd136f8 commit 391b8b3
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,18 @@ private void writeConfiguration() {
}

private void copyExtraConfigFiles() {
spec.getExtraConfigFiles().forEach((fileName, resource) -> resource.writeTo(configDir.resolve(fileName)));
spec.getExtraConfigFiles().forEach((fileName, resource) -> {
final Path target = configDir.resolve(fileName);
final Path directory = target.getParent();
if (Files.exists(directory) == false) {
try {
Files.createDirectories(directory);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
resource.writeTo(target);
});
}

private void createKeystore() {
Expand Down

0 comments on commit 391b8b3

Please sign in to comment.