Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanKanojia committed Mar 17, 2020
1 parent f8eaa52 commit d988147
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Usage:
* Ported PR fabric8io/fabric8-maven-plugin#1792, NullCheck in FileDataSecretEnricher
* Fix #53: Renamed plugins to openshift/kubernetes-maven-plugin keeping acronym (oc/k8s) for goal
* Fix #97: Port of fabric8io/fabric8-maven-plugin#1794 to fix ImageChange triggers not being set in DeploymentConfig when resource fragments are used
* Ported PR fabric8io/fabric8-maven-plugin#1802, Labels are missing for some objects

### 0.2.0 (05-03-2020)
* Fix #71: script to extract changelog information for notifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@
import org.eclipse.jkube.kit.config.image.build.OpenShiftBuildStrategy;
import org.eclipse.jkube.kit.config.image.build.RegistryAuthConfiguration;
import org.eclipse.jkube.kit.config.resource.BuildRecreateMode;
import org.eclipse.jkube.kit.config.resource.PlatformMode;
import org.eclipse.jkube.kit.config.resource.ProcessorConfig;
import org.eclipse.jkube.kit.config.resource.ResourceConfig;
import org.eclipse.jkube.kit.config.resource.RuntimeMode;
import org.eclipse.jkube.kit.config.service.JKubeServiceHub;
import org.eclipse.jkube.kit.profile.ProfileUtil;
import org.eclipse.jkube.maven.enricher.api.EnricherContext;
import org.eclipse.jkube.maven.enricher.api.JKubeEnricherContext;
import org.eclipse.jkube.maven.plugin.enricher.EnricherManager;
import org.eclipse.jkube.maven.plugin.generator.GeneratorManager;

import org.apache.maven.archiver.MavenArchiveConfiguration;
Expand Down Expand Up @@ -731,6 +735,11 @@ protected org.eclipse.jkube.kit.config.service.BuildService.BuildServiceConfig g
projectHelper.attachArtifact(project, "yml", classifier, destFile);
}
})
.enricherTask(builder -> {
EnricherManager enricherManager = new EnricherManager(resources, getEnricherContext(), MavenUtil.getCompileClasspathElementsIfRequested(project, useProjectClasspath));
enricherManager.enrich(PlatformMode.kubernetes, builder);
enricherManager.enrich(PlatformMode.openshift, builder);
})
.build();
}

Expand Down Expand Up @@ -762,6 +771,17 @@ protected String getLogPrefix() {

// ==================================================================================================

// Get enricher context
public EnricherContext getEnricherContext() throws DependencyResolutionRequiredException {
return new JKubeEnricherContext.Builder()
.project(MavenUtil.convertMavenProjectToJKubeProject(project, session))
.config(extractEnricherConfig())
.images(getResolvedImages())
.resources(resources)
.log(log)
.build();
}

// Get generator context
protected GeneratorContext getGeneratorContext() throws DependencyResolutionRequiredException {
return new GeneratorContext.Builder()
Expand Down

0 comments on commit d988147

Please sign in to comment.