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

Generators - not honouring JAVA_OPTIONS #957

Open
kameshsampath opened this issue Jun 1, 2017 · 8 comments
Open

Generators - not honouring JAVA_OPTIONS #957

kameshsampath opened this issue Jun 1, 2017 · 8 comments
Labels
cat/bug Bug which needs fixing group/generator Generator related prio/p1 Normal priority size/s Small status/never-stale Pin this issue to get never marked as stale by stale-bot

Comments

@kameshsampath
Copy link
Contributor

kameshsampath commented Jun 1, 2017

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"
@kameshsampath
Copy link
Contributor Author

closing this for #937

@rhuss
Copy link
Contributor

rhuss commented Jun 1, 2017

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

@kameshsampath kameshsampath reopened this Jun 1, 2017
@kameshsampath
Copy link
Contributor Author

yes @rhuss - after our discussion i feel its different

@kameshsampath
Copy link
Contributor Author

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 kameshsampath changed the title Vert.x Generator - not honouring JAVA_OPTIONS Generators - not honouring JAVA_OPTIONS Jun 11, 2017
@stale
Copy link

stale bot commented Oct 4, 2018

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 stale bot added the status/stale Issue/PR considered to be stale label Oct 4, 2018
@rhuss
Copy link
Contributor

rhuss commented Oct 5, 2018

This can be still an issue and should be checked.

@stale stale bot removed the status/stale Issue/PR considered to be stale label Oct 5, 2018
@rhuss rhuss added group/generator Generator related prio/p1 Normal priority size/s Small labels Oct 5, 2018
@lordofthejars
Copy link
Contributor

lordofthejars commented Nov 19, 2018

@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?

@stale
Copy link

stale bot commented Feb 17, 2019

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 stale bot added the status/stale Issue/PR considered to be stale label Feb 17, 2019
@stale stale bot closed this as completed Feb 24, 2019
@rohanKanojia rohanKanojia reopened this Feb 25, 2019
@stale stale bot removed the status/stale Issue/PR considered to be stale label Feb 25, 2019
@rohanKanojia rohanKanojia added the status/never-stale Pin this issue to get never marked as stale by stale-bot label Feb 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cat/bug Bug which needs fixing group/generator Generator related prio/p1 Normal priority size/s Small status/never-stale Pin this issue to get never marked as stale by stale-bot
Projects
None yet
Development

No branches or pull requests

4 participants