Skip to content

Commit

Permalink
improvements, mvp implementation works
Browse files Browse the repository at this point in the history
  • Loading branch information
csviri committed Jul 26, 2023
1 parent 5346ffb commit acfd4a3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkiverse.operatorsdk.deployment.helm;

import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -28,7 +30,7 @@
// TODO
// - configure:
// - to generate additional crds?
//
// - tests: IT, e2e
// - generate readme with values
// - add various customization options
// - generate the reconciler parts directly into templates
Expand Down Expand Up @@ -83,7 +85,9 @@ private void addCRDs(File crdDir, GeneratedCRDInfoBuildItem generatedCRDInfoBuil
crdInfos.forEach(crdInfo -> {
try {
var generateCrdPath = Path.of(crdInfo.getFilePath());
Files.copy(generateCrdPath, new File(crdDir, generateCrdPath.getFileName().toString()).toPath());
// replace needed since tests might generate files multiple times
Files.copy(generateCrdPath, new File(crdDir, generateCrdPath.getFileName().toString()).toPath(),
REPLACE_EXISTING);
} catch (IOException e) {
throw new IllegalStateException(e);
}
Expand Down Expand Up @@ -137,7 +141,7 @@ private void copyTemplates(File helmDir) {
for (String template : TEMPLATE_FILES) {
try (InputStream file = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("/helm/templates/" + template)) {
Files.copy(file, new File(new File(helmDir, TEMPLATES_DIR), template).toPath());
Files.copy(file, new File(new File(helmDir, TEMPLATES_DIR), template).toPath(), REPLACE_EXISTING);
} catch (IOException e) {
throw new IllegalStateException(e);
}
Expand Down

0 comments on commit acfd4a3

Please sign in to comment.