Skip to content

Commit

Permalink
refactor: minor improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm committed Nov 7, 2024
1 parent 79626c9 commit dbce5ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ private static String getBundleName(AnnotationInstance csvMetadata, String defau
UnownedCRDInfoBuildItem unownedCRDInfo(BundleGenerationConfiguration bundleConfiguration,
CurateOutcomeBuildItem appInfoBuildItem) {
final Optional<List<String>> maybeExternalCRDs = bundleConfiguration.externalCRDLocations();
final var crds = new CRDInfos();
if (maybeExternalCRDs.isPresent()) {
final var moduleRoot = appInfoBuildItem.getApplicationModel().getApplicationModule().getModuleDir().toPath();
final var crds = new CRDInfos();
maybeExternalCRDs.get().parallelStream()
.filter(Predicate.not(String::isBlank))
.map(String::trim)
Expand All @@ -129,10 +129,8 @@ UnownedCRDInfoBuildItem unownedCRDInfo(BundleGenerationConfiguration bundleConfi
final var crd = loadFrom(crdPath);
crds.addCRDInfoFor(crd.getCrdName(), crd.getCrdSpecVersion(), crd);
});
return new UnownedCRDInfoBuildItem(crds);
} else {
return new UnownedCRDInfoBuildItem(new CRDInfos());
}
return new UnownedCRDInfoBuildItem(crds);
}

private CRDInfo loadFrom(Path crdPath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ CRDGenerationInfo generate(OutputTargetBuildItem outputTarget,
.forEach((version, crdInfo) -> {
final var filePath = crdInfo.getFilePath();
log.infov(" - {0} -> {1}", version, filePath);
converted.addCRDInfoFor(crdName, version, new CRDInfo(crdInfo.getCrdName(),
converted.addCRDInfoFor(crdName, version, new CRDInfo(crdName,
version, filePath, crdInfo.getDependentClassNames()));
});
});
Expand Down

0 comments on commit dbce5ad

Please sign in to comment.