Skip to content

Commit

Permalink
Ensure that Dekorate logs are not written since they are too noisy.
Browse files Browse the repository at this point in the history
Resolves: quarkusio#8798
  • Loading branch information
geoand committed May 13, 2020
1 parent e3d40e3 commit f592fa1
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

class KubernetesProcessor {

private static final Logger log = Logger.getLogger(KubernetesDeployer.class);
private static final Logger log = Logger.getLogger(KubernetesProcessor.class);

private static final String OUTPUT_ARTIFACT_FORMAT = "%s%s.jar";
public static final String DEFAULT_HASH_ALGORITHM = "SHA-256";
Expand Down Expand Up @@ -251,7 +251,7 @@ public void build(ApplicationInfoBuildItem applicationInfo,
final SessionWriter sessionWriter = new SimpleFileWriter(root, false);
Project project = createProject(applicationInfo, artifactPath);
sessionWriter.setProject(project);
final Session session = Session.getSession();
final Session session = Session.getSession(new io.dekorate.logger.NoopLogger());
session.setWriter(sessionWriter);

session.feed(Maps.fromProperties(config));
Expand Down Expand Up @@ -293,6 +293,7 @@ public void build(ApplicationInfoBuildItem applicationInfo,
// write the generated resources to the filesystem
generatedResourcesMap = session.close();

List<String> generatedFileNames = new ArrayList<>(generatedResourcesMap.size());
for (Map.Entry<String, String> resourceEntry : generatedResourcesMap.entrySet()) {
String fileName = resourceEntry.getKey().replace(root.toAbsolutePath().toString(), "");
String relativePath = resourceEntry.getKey().replace(root.toAbsolutePath().toString(), KUBERNETES);
Expand All @@ -308,13 +309,19 @@ public void build(ApplicationInfoBuildItem applicationInfo,
}
}

generatedFileNames.add(fileName.replace("/", ""));
generatedResourceProducer.produce(
new GeneratedFileSystemResourceBuildItem(
// we need to make sure we are only passing the relative path to the build item
relativePath,
resourceEntry.getValue().getBytes(StandardCharsets.UTF_8)));
}

if (!generatedFileNames.isEmpty()) {
log.infof("Generated the Kubernetes manifests: '%s' in '%s'", String.join(",", generatedFileNames),
outputTarget.getOutputDirectory() + File.separator + KUBERNETES);
}

try {
if (root != null && root.toFile().exists()) {
FileUtil.deleteDirectory(root);
Expand Down

0 comments on commit f592fa1

Please sign in to comment.