fabric8-maven-plugin
fabric8-maven-plugin copied to clipboard
Generators - not honouring JAVA_OPTIONS
f### Description
The generators is not honouring the JAVA_OPTIONS
that are passed as part of the resource fragments deployment.yml
if the generator classes overrides the getExtraJavaOptions
method and add some options via it.
Sample deployment.yml
---
spec:
replicas: ${replicas}
template:
spec:
containers:
- env:
- name: JAVA_OPTIONS
value: "-Xms128m -Xmx512m -Djava.net.preferIPv4Stack=true"
- name: OPENSHIFT_KUBE_PING_LABELS
value: "project=${project.artifactId}"
- name: OPENSHIFT_KUBE_PING_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
Info
- f-m-p version : 3.4.1
- Maven version (
mvn -v
) : 3.5.0
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T01:09:06+05:30)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_92, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.5", arch: "x86_64", family: "mac"
- Kubernetes / OpenShift setup and version : minishift v1.0.0
- Sample project : https://github.com/kameshsampath/the-deploy-master/tree/master/demo-vertx
closing this for #937
wanted to have a look at your sample project but it does not match the issue here.
yes @rhuss - after our discussion i feel its different
This is true with all generators which overridesgetExtraJavaOptions
, when that is overriden and add parameters that goes to JAVA_OPTIONS
then the ones given from the generator alone is honoured and other JAVA_OPTIONS
set via resource fragments are ignored.
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
This can be still an issue and should be checked.
@rhuss I think we are not honoring JAVA_OPTIONS
correctly. Look: https://github.com/fabric8io/fabric8-maven-plugin/blob/master/generator/java-exec/src/main/java/io/fabric8/maven/generator/javaexec/JavaExecGenerator.java#L166 it is returning an empty list. Then let's see how it is used in SB Generator: https://github.com/fabric8io/fabric8-maven-plugin/blob/master/generator/spring-boot/src/main/java/io/fabric8/maven/generator/springboot/SpringBootGenerator.java#L104
You see that JAVA_OPTIONS is not honored, and even fully rewritten: https://github.com/fabric8io/fabric8-maven-plugin/blob/master/generator/java-exec/src/main/java/io/fabric8/maven/generator/javaexec/JavaExecGenerator.java#L161
So I think we should implement JavaExecGenerator
correctly by returning the current values defined in yaml, and then check for duplication.
WDYT?
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!