#Allow attaching to custom jdk tools.jar (JVMs other than certified tools.jar) for application

#The custom jdk tools.jar path must be appended with customJdkTools/vendor/vmName/version/tools.jar and mounted using docker image.
#vendor is the case sensitive value for the system property "java.vm.vendor" with all spaces removed.
#vmName is the case sensitive value of the system property "java.vm.name" with all spaces removed.
#version is the case sensitive value of the system property "java.runtime.version" with all spaces removed.
#As an example:  
#For given JVMInfo values like vendorName='Private Build', vmName='OpenJDK 64-Bit Server VM', runtimeVersion='1.7.0_181-b01'
#an append must be "customJdkTools/PrivateBuild/OpenJDK64-BitServerVM/1.7.0_181-b01/tools.jar"

#It is possible to supply multiple custom tools.jar, just need to append with customJdkTools/vendor/vmName/version/tools.jar with all spaces removed as given in example. 
#Autoattach will pick up right one based on the JVM Info available on target attaching application.
#For an example:
#append path1 "customJdkTools/PrivateBuild/OpenJDK64-BitServerVM/1.7.0_181-b01/tools.jar"
#append path2 "customJdkTools/AdoptOpenJDK/OpenJDK64-BitServerVM/1.8.0_222-b10/tools.jar"


#Enabling autoattach to custom jdk tools.jar for an application 
#set "autoattach.java.filter.jvms" property to "false" to have AutoAttach attempt to use mounted custom JDK tools.jar
#It can be done by using "annotations:" overrides in application yaml (tomcat.yaml) like below:
#  annotations:
#    ca.broadcom.com/autoattach.enabled: "true"
#    ca.broadcom.com/autoattach.java.attach.overrides: "autoattach.java.filter.jvms=false"


#Enabling autoattach to custom jdk tools.jar for UMA Installation through the Helm Chart.
#Below values can be set "true" in values.yaml to enable autoattach to custom jdk tools.jar and docker image name which contains custom tools.jar. 
#By default it is set to false to disable this functionality.
#  customJdkTools:
#    enabled: false
#    imageName: custom-jdk-tools:latest

#Enabling autoattach to custom jdk tools.jar for UMA Installation through the Kubernetes Operator.
#Below values can be set "true" in uma-operator/uma_cr.yaml to enable autoattach to custom jdk tools.jar and docker image name which contains custom tools.jar. 
#By default it is set to false to disable this functionality.
#  customJdkTools:
#    enabled: false
#    imageName: custom-jdk-tools:latest


#A yaml file can also be generated by setting below values in helm-chart/uma/values.yaml to install UMA through a yaml file which contain enabled autoattach to custom jdk tools.jar.
#  customJdkTools:
#    enabled: true
#    imageName: custom-jdk-tools:latest 
#command to generate the yaml from helm chart
#helm template -f helm-chart/uma/values.yaml helm-chart/uma/  --namespace dx-uma| tr -d '\r'> ./target/ca-uma-agent.yaml


#Building a docker image
#docker build . -t repo/ custom-jdk-tools:v1
#docker push repo/ custom-jdk-tools:v1


#A sample Dockerfile to supply custom jdk tools.jar

#Base docker image for custom jdk tools.jar
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
USER root
#COPY the custom jdk tools.jar path appended with customJdkTools/vendor/vmName/version/tools.jar to the path “/opt/caapm/agent”
COPY ./customJdkTools /opt/caapm/agent
# Dummy CMD to active the container
CMD ["tail","-f","/dev/null"]




