fabric8-maven-plugin icon indicating copy to clipboard operation
fabric8-maven-plugin copied to clipboard

Generators - not honouring JAVA_OPTIONS

Open kameshsampath opened this issue 7 years ago • 8 comments

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

kameshsampath avatar Jun 01 '17 11:06 kameshsampath

closing this for #937

kameshsampath avatar Jun 01 '17 12:06 kameshsampath

wanted to have a look at your sample project but it does not match the issue here.

rhuss avatar Jun 01 '17 13:06 rhuss

yes @rhuss - after our discussion i feel its different

kameshsampath avatar Jun 01 '17 15:06 kameshsampath

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.

kameshsampath avatar Jun 11 '17 11:06 kameshsampath

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!

stale[bot] avatar Oct 04 '18 13:10 stale[bot]

This can be still an issue and should be checked.

rhuss avatar Oct 05 '18 13:10 rhuss

@rhuss I think we are not honoring JAVA_OPTIONScorrectly. 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?

lordofthejars avatar Nov 19 '18 14:11 lordofthejars

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!

stale[bot] avatar Feb 17 '19 15:02 stale[bot]