diff --git a/api/v1/coherence_types.go b/api/v1/coherence_types.go index 72568802b..28eb2a385 100644 --- a/api/v1/coherence_types.go +++ b/api/v1/coherence_types.go @@ -1691,12 +1691,6 @@ type JvmGarbageCollectorSpec struct { // +listType=atomic // +optional Args []string `json:"args,omitempty"` - // Enable the following GC logging args -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps - // -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime - // -XX:+PrintGCApplicationConcurrentTime - // Default is true - // +optional - Logging *bool `json:"logging,omitempty"` } // CreateEnvVars creates the GC environment variables for the Coherence container. @@ -1714,13 +1708,6 @@ func (in *JvmGarbageCollectorSpec) CreateEnvVars() []corev1.EnvVar { envVars = append(envVars, corev1.EnvVar{Name: EnvVarJvmGcCollector, Value: *in.Collector}) } - // Enable or disable GC logging - if in != nil && in.Logging != nil { - envVars = append(envVars, corev1.EnvVar{Name: EnvVarJvmGcLogging, Value: BoolPtrToString(in.Logging)}) - } else { - envVars = append(envVars, corev1.EnvVar{Name: EnvVarJvmGcLogging, Value: "false"}) - } - return envVars } diff --git a/api/v1/common_test.go b/api/v1/common_test.go index e8bf465c7..25f126b6d 100644 --- a/api/v1/common_test.go +++ b/api/v1/common_test.go @@ -9,6 +9,11 @@ package v1_test import ( "encoding/json" "fmt" + "os" + "sort" + "strings" + "testing" + "github.com/go-test/deep" . "github.com/onsi/gomega" coh "github.com/oracle/coherence-operator/api/v1" @@ -20,10 +25,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" - "os" - "sort" - "strings" - "testing" ) const ( @@ -344,10 +345,6 @@ func createMinimalExpectedPodSpec(deployment coh.CoherenceResource) corev1.PodTe Name: "COHERENCE_WKA", Value: deployment.GetWKA(), }, - { - Name: "JVM_GC_LOGGING", - Value: "false", - }, { Name: "JVM_USE_CONTAINER_LIMITS", Value: "true", diff --git a/api/v1/constants.go b/api/v1/constants.go index 1279f7dca..48eef3d75 100644 --- a/api/v1/constants.go +++ b/api/v1/constants.go @@ -291,7 +291,6 @@ const ( EnvVarJvmDebugAttach = "JVM_DEBUG_ATTACH" EnvVarJvmGcArgs = "JVM_GC_ARGS" EnvVarJvmGcCollector = "JVM_GC_COLLECTOR" - EnvVarJvmGcLogging = "JVM_GC_LOGGING" EnvVarJvmMemoryHeap = "JVM_HEAP_SIZE" EnvVarJvmMemoryInitialHeap = "JVM_INITIAL_HEAP_SIZE" EnvVarJvmMemoryMaxHeap = "JVM_MAX_HEAP_SIZE" diff --git a/api/v1/create_job_jvmspec_test.go b/api/v1/create_job_jvmspec_test.go index 474e821b1..b7111b644 100644 --- a/api/v1/create_job_jvmspec_test.go +++ b/api/v1/create_job_jvmspec_test.go @@ -7,9 +7,10 @@ package v1_test import ( + "testing" + coh "github.com/oracle/coherence-operator/api/v1" corev1 "k8s.io/api/core/v1" - "testing" ) func TestCreateJobWithEmptyJvmSpec(t *testing.T) { @@ -241,8 +242,7 @@ func TestCreateJobWithJvmSpecWithGarbageCollectorArgs(t *testing.T) { spec := coh.CoherenceResourceSpec{ JVM: &coh.JVMSpec{ Gc: &coh.JvmGarbageCollectorSpec{ - Args: []string{"-XX:GC-ArgOne", "-XX:GC-ArgTwo"}, - Logging: nil, + Args: []string{"-XX:GC-ArgOne", "-XX:GC-ArgTwo"}, }, }, } @@ -257,46 +257,6 @@ func TestCreateJobWithJvmSpecWithGarbageCollectorArgs(t *testing.T) { assertJobCreation(t, deployment, jobExpected) } -func TestCreateJobWithJvmSpecWithGarbageCollectorLoggingFalse(t *testing.T) { - - spec := coh.CoherenceResourceSpec{ - JVM: &coh.JVMSpec{ - Gc: &coh.JvmGarbageCollectorSpec{ - Logging: boolPtr(false), - }, - }, - } - - // Create the test deployment - deployment := createTestCoherenceJob(spec) - // Create expected Job - jobExpected := createMinimalExpectedJob(deployment) - addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_GC_LOGGING", Value: "false"}) - - // assert that the Job is as expected - assertJobCreation(t, deployment, jobExpected) -} - -func TestCreateJobWithJvmSpecWithGarbageCollectorLoggingTrue(t *testing.T) { - - spec := coh.CoherenceResourceSpec{ - JVM: &coh.JVMSpec{ - Gc: &coh.JvmGarbageCollectorSpec{ - Logging: boolPtr(true), - }, - }, - } - - // Create the test deployment - deployment := createTestCoherenceJob(spec) - // Create expected Job - jobExpected := createMinimalExpectedJob(deployment) - addEnvVarsToAllJobContainers(jobExpected, corev1.EnvVar{Name: "JVM_GC_LOGGING", Value: "true"}) - - // assert that the Job is as expected - assertJobCreation(t, deployment, jobExpected) -} - func TestCreateJobWithJvmSpecWithDiagnosticsVolume(t *testing.T) { hostPath := &corev1.HostPathVolumeSource{Path: "/home/root/debug"} diff --git a/api/v1/create_statefulset_jvmspec_test.go b/api/v1/create_statefulset_jvmspec_test.go index 9588a35b5..2ed382924 100644 --- a/api/v1/create_statefulset_jvmspec_test.go +++ b/api/v1/create_statefulset_jvmspec_test.go @@ -7,9 +7,10 @@ package v1_test import ( + "testing" + coh "github.com/oracle/coherence-operator/api/v1" corev1 "k8s.io/api/core/v1" - "testing" ) func TestCreateStatefulSetWithEmptyJvmSpec(t *testing.T) { @@ -236,67 +237,6 @@ func TestCreateStatefulSetWithJvmSpecWithGarbageCollector(t *testing.T) { assertStatefulSetCreation(t, deployment, stsExpected) } -func TestCreateStatefulSetWithJvmSpecWithGarbageCollectorArgs(t *testing.T) { - - spec := coh.CoherenceResourceSpec{ - JVM: &coh.JVMSpec{ - Gc: &coh.JvmGarbageCollectorSpec{ - Args: []string{"-XX:GC-ArgOne", "-XX:GC-ArgTwo"}, - Logging: nil, - }, - }, - } - - // Create the test deployment - deployment := createTestDeployment(spec) - // Create expected StatefulSet - stsExpected := createMinimalExpectedStatefulSet(deployment) - addEnvVarsToAll(stsExpected, corev1.EnvVar{Name: "JVM_GC_ARGS", Value: "-XX:GC-ArgOne -XX:GC-ArgTwo"}) - - // assert that the StatefulSet is as expected - assertStatefulSetCreation(t, deployment, stsExpected) -} - -func TestCreateStatefulSetWithJvmSpecWithGarbageCollectorLoggingFalse(t *testing.T) { - - spec := coh.CoherenceResourceSpec{ - JVM: &coh.JVMSpec{ - Gc: &coh.JvmGarbageCollectorSpec{ - Logging: boolPtr(false), - }, - }, - } - - // Create the test deployment - deployment := createTestDeployment(spec) - // Create expected StatefulSet - stsExpected := createMinimalExpectedStatefulSet(deployment) - addEnvVarsToAll(stsExpected, corev1.EnvVar{Name: "JVM_GC_LOGGING", Value: "false"}) - - // assert that the StatefulSet is as expected - assertStatefulSetCreation(t, deployment, stsExpected) -} - -func TestCreateStatefulSetWithJvmSpecWithGarbageCollectorLoggingTrue(t *testing.T) { - - spec := coh.CoherenceResourceSpec{ - JVM: &coh.JVMSpec{ - Gc: &coh.JvmGarbageCollectorSpec{ - Logging: boolPtr(true), - }, - }, - } - - // Create the test deployment - deployment := createTestDeployment(spec) - // Create expected StatefulSet - stsExpected := createMinimalExpectedStatefulSet(deployment) - addEnvVarsToAll(stsExpected, corev1.EnvVar{Name: "JVM_GC_LOGGING", Value: "true"}) - - // assert that the StatefulSet is as expected - assertStatefulSetCreation(t, deployment, stsExpected) -} - func TestCreateStatefulSetWithJvmSpecWithDiagnosticsVolume(t *testing.T) { hostPath := &corev1.HostPathVolumeSource{Path: "/home/root/debug"} diff --git a/docs/about/04_coherence_spec.adoc b/docs/about/04_coherence_spec.adoc index eb40cdf91..7dde6460a 100644 --- a/docs/about/04_coherence_spec.adoc +++ b/docs/about/04_coherence_spec.adoc @@ -604,7 +604,6 @@ JvmGarbageCollectorSpec is options for managing the JVM garbage collector. | Field | Description | Type | Required m| collector | The name of the JVM garbage collector to use. G1 - adds the -XX:+UseG1GC option CMS - adds the -XX:+UseConcMarkSweepGC option Parallel - adds the -XX:+UseParallelGC Default - use the JVMs default collector The field value is case insensitive If not set G1 is used. If set to a value other than those above then the default collector for the JVM will be used. m| *string | false m| args | Args specifies the GC options to pass to the JVM. m| []string | false -m| logging | Enable the following GC logging args -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime Default is true m| *bool | false |=== <