Skip to content

Commit

Permalink
Allow image CLI JVM options to be specified via Infinispan CR #1643
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed Jul 25, 2022
1 parent ed21bcd commit a3fdbb5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/v1/infinispan_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ type InfinispanServiceSpec struct {

// InfinispanContainerSpec specify resource requirements per container
type InfinispanContainerSpec struct {
// +optional
CliExtraJvmOpts string `json:"cliExtraJvmOpts,omitempty"`
// +optional
ExtraJvmOpts string `json:"extraJvmOpts,omitempty"`
// +optional
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/infinispan.org_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ spec:
description: InfinispanContainerSpec specify resource requirements
per container
properties:
cliExtraJvmOpts:
type: string
cpu:
type: string
extraJvmOpts:
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/infinispan.org_infinispans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ spec:
description: InfinispanContainerSpec specify resource requirements
per container
properties:
cliExtraJvmOpts:
type: string
cpu:
type: string
extraJvmOpts:
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/infinispan.org_restores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
description: InfinispanContainerSpec specify resource requirements
per container
properties:
cliExtraJvmOpts:
type: string
cpu:
type: string
extraJvmOpts:
Expand Down
3 changes: 3 additions & 0 deletions controllers/infinispan_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,9 @@ func (r *infinispanRequest) reconcileContainerConf(statefulSet *appsv1.StatefulS
updateStatefulSetEnv(statefulSet, "JAVA_OPTIONS", ispn.GetJavaOptions())
updateNeeded = true
}
if updateStatefulSetEnv(statefulSet, "CLI_JAVA_OPTIONS", ispnContr.CliExtraJvmOpts) {
updateNeeded = true
}

if updateNeeded {
r.reqLogger.Info("updateNeeded")
Expand Down
2 changes: 1 addition & 1 deletion controllers/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"os"

"strconv"
"strings"

Expand Down Expand Up @@ -123,6 +122,7 @@ func PodEnv(i *infinispanv1.Infinispan, systemEnv *[]corev1.EnvVar) []corev1.Env
{Name: "MANAGED_ENV", Value: "TRUE"},
{Name: "JAVA_OPTIONS", Value: i.GetJavaOptions()},
{Name: "EXTRA_JAVA_OPTIONS", Value: i.Spec.Container.ExtraJvmOpts},
{Name: "CLI_JAVA_OPTIONS", Value: i.Spec.Container.CliExtraJvmOpts},
{Name: "DEFAULT_IMAGE", Value: consts.DefaultImageName},
}

Expand Down

0 comments on commit a3fdbb5

Please sign in to comment.