Skip to content

Commit

Permalink
Merge pull request #196 from trifork/java17-compatability
Browse files Browse the repository at this point in the history
Add java 17 compatability options
  • Loading branch information
pegtrifork authored Feb 2, 2024
2 parents a276159 + cef5986 commit 7d5a562
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 34 deletions.
1 change: 1 addition & 0 deletions charts/flink-job/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Read more about Flink and highly available job-managers [here](https://nightlies
| dnsForKubernetesHost | bool | `true` | Whether to set KUBERNETES_SERVICE_HOST=kubernetes.default.svc.cluster.local instead of relying on the kubernetes provided value For use in an environment where egress to kubeAPI is managed via DNS rather than IP addresses |
| localNetworkConfiguration.enabled | bool | `false` | Whether to generate Netic LocalNetworkConfig allowing traffic between job and taskmanager. For use in a deny-all environment |
| image-automation.enabled | bool | `false` | Whether to enable the image-automation subchart. Image-automation is not possible when using image-sha as a tagging strategy. Any other configuration given here, is passed to it |
| java17Compatability | bool | `true` | Whether to add Java 17 compatability options. For details see https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/deployment/java_compatibility/#jdk-modularization and https://github.com/apache/flink/blob/release-1.18/flink-dist/src/main/resources/flink-conf.yaml#L19-L21 |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
12 changes: 12 additions & 0 deletions charts/flink-job/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Calculate the flinkConfiguration
{{- $configs = fromJson (include "flink-job.storageConfiguration" (dict "configs" $configs "global" $.Values "fullname" $fullname)) -}}
{{- $configs = fromJson (include "flink-job.istioConfiguration" (dict "configs" $configs "global" $.Values "fullname" $fullname)) -}}
{{- $configs = fromJson (include "flink-job.sslConfiguration" (dict "configs" $configs "global" $.Values "fullname" $fullname)) -}}
{{- $configs = fromJson (include "flink-job.java17CompatibilityConfiguration" (dict "configs" $configs "global" $.Values "fullname" $fullname)) -}}
{{ toYaml $configs }}
{{- end -}}

Expand Down Expand Up @@ -236,6 +237,17 @@ Add necessary configuration for running in HA mode
{{- $configs | toJson -}}
{{- end -}}

{{/*
Add necessary java 17 compatibility configuration
*/}}
{{- define "flink-job.java17CompatibilityConfiguration" -}}
{{- $configs := .configs -}}
{{- if .global.java17Compatability -}}
{{- $configs = fromJson (include "flink-job._dictSet" (list $configs "env.java.opts.all" "--add-exports=java.base/sun.net.util=ALL-UNNAMED --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED")) -}}
{{- end -}}
{{- $configs | toJson -}}
{{- end -}}

{{/*
Validate the configuration
*/}}
Expand Down
Loading

0 comments on commit 7d5a562

Please sign in to comment.