Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

aggregating YAMLs doesn't work for OpenShift with FMP 4.0.0 #1607

Closed
Ladicek opened this issue Apr 1, 2019 · 10 comments
Closed

aggregating YAMLs doesn't work for OpenShift with FMP 4.0.0 #1607

Ladicek opened this issue Apr 1, 2019 · 10 comments

Comments

@Ladicek
Copy link
Contributor

Ladicek commented Apr 1, 2019

Description

The fmp-dependency enricher (DependencyEnricher class) can aggregate multiple YAMLs available on classpath. In FMP version 4.0.0, this doesn't work for OpenShift -- the aggregated files are identical to the Kubernetes YAMLs.

It's probably easiest for me to explain it on an example. Steps to reproduce:

  1. git clone -b update-to-2.4.0 https://github.com/Ladicek/thorntail-circuit-breaker.git
  2. cd thorntail-circuit-breaker
  3. mvn clean verify -Popenshift,openshift-it
  4. observe error Could not resolve route: thorntail-circuit-breaker-name. Available routes: []

At this point, look into tests/target/classes/META-INF/fabric8/. The kubernetes directory and kubernetes.yml file are OK, exactly what I'd expect. However, the openshift directory and openshift.yml file are identical to kubernetes / kubernetes.yml, which is definitely not what I expect. I expect the aggregate to be, well, an aggregate of the OpenShift files from the name-service and greeting-service modules.

This works fine in 4.0.0-M2. I was able to track the issue down to this change: 9b648cf#diff-c7c605106d3e8005f2161d83dce35592

Info

  • f-m-p version : 4.0.0
  • Maven version (mvn -v) :
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /home/lthon/software/apache-maven
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-oracle/jre
Default locale: cs_CZ, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-46-generic", arch: "amd64", family: "unix"
@juangon
Copy link

juangon commented Apr 1, 2019

This problem affects some aggregated test we are using too. As @Ladicek said, it worked fine on 4.0.0.M2.
Itr would be great if this could be reviewed and released.

Thanks in advance.

@rohanKanojia
Copy link
Member

@juangon @Ladicek : Thanks a lot for finding issue and pushing a fix, This would be merged and be available in 4.1.0, which is gonna be released within a week :-)

@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 3, 2019

Great, thanks!

@rohanKanojia
Copy link
Member

rohanKanojia commented Apr 3, 2019

@Ladicek : Just to understand your issue. Is your issue these duplicate files in openshift/ directory:

~/work/repos/thorntail-circuit-breaker/tests/target/classes/META-INF/fabric8/kubernetes : $ ls
thorntail-circuit-breaker-greeting-deployment.yml  thorntail-circuit-breaker-name-deployment.yml
thorntail-circuit-breaker-greeting-service.yml     thorntail-circuit-breaker-name-service.yml
~/work/repos/thorntail-circuit-breaker/tests/target/classes/META-INF/fabric8/kubernetes : $ ls
thorntail-circuit-breaker-greeting-deployment.yml  thorntail-circuit-breaker-name-deployment.yml
thorntail-circuit-breaker-greeting-service.yml     thorntail-circuit-breaker-name-service.yml
~/work/repos/thorntail-circuit-breaker/tests/target/classes/META-INF/fabric8/kubernetes : $ cd ..
~/work/repos/thorntail-circuit-breaker/tests/target/classes/META-INF/fabric8 : $ cd openshift/
~/work/repos/thorntail-circuit-breaker/tests/target/classes/META-INF/fabric8/openshift : $ ls
thorntail-circuit-breaker-greeting-deployment.yml  thorntail-circuit-breaker-name-deployment.yml
thorntail-circuit-breaker-greeting-service.yml     thorntail-circuit-breaker-name-service.yml
~/work/repos/thorntail-circuit-breaker/tests/target/classes/META-INF/fabric8/openshift : $ 

@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 3, 2019

The issue is that the openshift directory contains Kubernetes resources. It should contain OpenShift resources.

What do you mean by "test your repository on SNAPSHOT version"? If you mean SNAPSHOT version of FMP, then just update the version.fabric8-maven-plugin property in /pom.xml.

Just to be sure, again highlighting that the update-to-2.4.0 branch is required.

@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 3, 2019

Also, in addition to openshift directory, same applies to the openshift.yml aggregate file. Again it contains the Kubernetes resources instead of OpenShift resources.

@rohanKanojia
Copy link
Member

Yeah, I figured that out 😆 . Testing your change now

@rohanKanojia
Copy link
Member

@Ladicek : okay, it works! . Just tested your change and it seems to generate openshift resources in openshift/ directory. But I'm wondering why they're getting generated twice

@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 3, 2019

I don't think they're generated twice. They are just copied from the -classes.jar artifacts of the dependencies. Or I totally misunderstood :-)

@rohanKanojia
Copy link
Member

Hm, okay

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants