Skip to content

Commit 9fa3c5c

Browse files
committed
Use resource.Quantity for RAM percentage and tracing ratio CRD fields
1 parent 26058b8 commit 9fa3c5c

13 files changed

+3943
-3881
lines changed

deploy/crds/coherence.oracle.com_coherence_crd.yaml

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,6 +3837,9 @@ spec:
38373837
tracing functionality.
38383838
properties:
38393839
ratio:
3840+
anyOf:
3841+
- type: integer
3842+
- type: string
38403843
description: "Ratio is the tracing sampling-ratio, which controls
38413844
the likelihood of a tracing span being collected. For instance,
38423845
a value of 1.0 will result in all tracing spans being collected,
@@ -3850,12 +3853,11 @@ spec:
38503853
tracing spans. \n A value of -1 disables tracing completely.
38513854
\n The Coherence default is -1 if not overridden. For values
38523855
other than -1, numbers between 0 and 1 are acceptable. \n
3853-
Due to decimal values not being allowed in a CRD field the
3854-
ratio value is held as a string. Consequently there is no
3855-
validation that the value entered is valid and the JVM may
3856-
fail to start properly in an invalid non-numeric value is
3857-
entered."
3858-
type: string
3856+
NOTE: This field is a k8s resource.Quantity value as CRDs
3857+
do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
3858+
for the different formats of number that may be entered."
3859+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
3860+
x-kubernetes-int-or-string: true
38593861
type: object
38603862
wka:
38613863
description: Specify an existing Coherence deployment to be used
@@ -6511,49 +6513,61 @@ spec:
65116513
are used.
65126514
type: string
65136515
initialRAMPercentage:
6516+
anyOf:
6517+
- type: integer
6518+
- type: string
65146519
description: "Set initial heap size as a percentage of total
65156520
memory. \n This option will be ignored if HeapSize is set.
65166521
\n Valid values are decimal numbers between 0 and 100. \n
6517-
This field is a string value as CRDs do not support decimal
6518-
numbers. Consequently, there is no validation on the value
6519-
entered so the JVM may fail to start if an invalid value
6520-
is entered. \n This field maps the the -XX:InitialRAMPercentage
6522+
NOTE: This field is a k8s resource.Quantity value as CRDs
6523+
do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
6524+
for the different formats of number that may be entered.
6525+
\n NOTE: This field maps the the -XX:InitialRAMPercentage
65216526
JVM option and will be incompatible with some JVMs that
65226527
do not have this option (e.g. Java 8)."
6523-
type: string
6528+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6529+
x-kubernetes-int-or-string: true
65246530
maxRAM:
65256531
description: Sets the JVM option `-XX:MaxRAM=N` which sets
65266532
the maximum amount of memory used by the JVM to `n`, where
65276533
`n` is expressed in terms of megabytes (for example, `100m`)
65286534
or gigabytes (for example `2g`).
65296535
type: string
65306536
maxRAMPercentage:
6537+
anyOf:
6538+
- type: integer
6539+
- type: string
65316540
description: "Set maximum heap size as a percentage of total
65326541
memory. \n This option will be ignored if HeapSize is set.
65336542
\n Valid values are decimal numbers between 0 and 100. \n
6534-
This field is a string value as CRDs do not support decimal
6535-
numbers. Consequently, there is no validation on the value
6536-
entered so the JVM may fail to start if an invalid value
6537-
is entered. \n This field maps the the -XX:MaxRAMPercentage
6538-
JVM option and will be incompatible with some JVMs that
6539-
do not have this option (e.g. Java 8)."
6540-
type: string
6543+
NOTE: This field is a k8s resource.Quantity value as CRDs
6544+
do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
6545+
for the different formats of number that may be entered.
6546+
\n NOTE: This field maps the the -XX:MaxRAMPercentage JVM
6547+
option and will be incompatible with some JVMs that do not
6548+
have this option (e.g. Java 8)."
6549+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6550+
x-kubernetes-int-or-string: true
65416551
metaspaceSize:
65426552
description: MetaspaceSize is the min/max metaspace size to
65436553
pass to the JVM. This sets the -XX:MetaspaceSize and -XX:MaxMetaspaceSize=size
65446554
JVM options. If not set the JVM defaults are used.
65456555
type: string
65466556
minRAMPercentage:
6557+
anyOf:
6558+
- type: integer
6559+
- type: string
65476560
description: "Set the minimal JVM Heap size as a percentage
65486561
of the total memory. \n This option will be ignored if HeapSize
65496562
is set. \n Valid values are decimal numbers between 0 and
6550-
100. \n This field is a string value as CRDs do not support
6551-
decimal numbers. Consequently, there is no validation on
6552-
the value entered so the JVM may fail to start if an invalid
6553-
value is entered. \n This field maps the the -XX:MinRAMPercentage
6554-
JVM option and will be incompatible with some JVMs that
6555-
do not have this option (e.g. Java 8)."
6556-
type: string
6563+
100. \n NOTE: This field is a k8s resource.Quantity value
6564+
as CRDs do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
6565+
for the different formats of number that may be entered.
6566+
\n NOTE: This field maps the the -XX:MinRAMPercentage JVM
6567+
option and will be incompatible with some JVMs that do not
6568+
have this option (e.g. Java 8)."
6569+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6570+
x-kubernetes-int-or-string: true
65576571
nativeMemoryTracking:
65586572
description: Adds the -XX:NativeMemoryTracking=mode JVM options
65596573
where mode is on of "off", "summary" or "detail", the default

deploy/crds/v1beta1/coherence.oracle.com_coherence_crd.yaml

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,6 +3764,9 @@ spec:
37643764
tracing functionality.
37653765
properties:
37663766
ratio:
3767+
anyOf:
3768+
- type: integer
3769+
- type: string
37673770
description: "Ratio is the tracing sampling-ratio, which controls
37683771
the likelihood of a tracing span being collected. For instance,
37693772
a value of 1.0 will result in all tracing spans being collected,
@@ -3776,12 +3779,12 @@ spec:
37763779
which Coherence will then collect inner tracing spans. \n
37773780
A value of -1 disables tracing completely. \n The Coherence
37783781
default is -1 if not overridden. For values other than -1,
3779-
numbers between 0 and 1 are acceptable. \n Due to decimal
3780-
values not being allowed in a CRD field the ratio value is
3781-
held as a string. Consequently there is no validation that
3782-
the value entered is valid and the JVM may fail to start properly
3783-
in an invalid non-numeric value is entered."
3784-
type: string
3782+
numbers between 0 and 1 are acceptable. \n NOTE: This field
3783+
is a k8s resource.Quantity value as CRDs do not support decimal
3784+
numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
3785+
for the different formats of number that may be entered."
3786+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
3787+
x-kubernetes-int-or-string: true
37853788
type: object
37863789
wka:
37873790
description: Specify an existing Coherence deployment to be used
@@ -6396,49 +6399,61 @@ spec:
63966399
used.
63976400
type: string
63986401
initialRAMPercentage:
6402+
anyOf:
6403+
- type: integer
6404+
- type: string
63996405
description: "Set initial heap size as a percentage of total
64006406
memory. \n This option will be ignored if HeapSize is set.
64016407
\n Valid values are decimal numbers between 0 and 100. \n
6402-
This field is a string value as CRDs do not support decimal
6403-
numbers. Consequently, there is no validation on the value
6404-
entered so the JVM may fail to start if an invalid value is
6405-
entered. \n This field maps the the -XX:InitialRAMPercentage
6406-
JVM option and will be incompatible with some JVMs that do
6407-
not have this option (e.g. Java 8)."
6408-
type: string
6408+
NOTE: This field is a k8s resource.Quantity value as CRDs
6409+
do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
6410+
for the different formats of number that may be entered. \n
6411+
NOTE: This field maps the the -XX:InitialRAMPercentage JVM
6412+
option and will be incompatible with some JVMs that do not
6413+
have this option (e.g. Java 8)."
6414+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6415+
x-kubernetes-int-or-string: true
64096416
maxRAM:
64106417
description: Sets the JVM option `-XX:MaxRAM=N` which sets the
64116418
maximum amount of memory used by the JVM to `n`, where `n`
64126419
is expressed in terms of megabytes (for example, `100m`) or
64136420
gigabytes (for example `2g`).
64146421
type: string
64156422
maxRAMPercentage:
6423+
anyOf:
6424+
- type: integer
6425+
- type: string
64166426
description: "Set maximum heap size as a percentage of total
64176427
memory. \n This option will be ignored if HeapSize is set.
64186428
\n Valid values are decimal numbers between 0 and 100. \n
6419-
This field is a string value as CRDs do not support decimal
6420-
numbers. Consequently, there is no validation on the value
6421-
entered so the JVM may fail to start if an invalid value is
6422-
entered. \n This field maps the the -XX:MaxRAMPercentage JVM
6423-
option and will be incompatible with some JVMs that do not
6424-
have this option (e.g. Java 8)."
6425-
type: string
6429+
NOTE: This field is a k8s resource.Quantity value as CRDs
6430+
do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
6431+
for the different formats of number that may be entered. \n
6432+
NOTE: This field maps the the -XX:MaxRAMPercentage JVM option
6433+
and will be incompatible with some JVMs that do not have this
6434+
option (e.g. Java 8)."
6435+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6436+
x-kubernetes-int-or-string: true
64266437
metaspaceSize:
64276438
description: MetaspaceSize is the min/max metaspace size to
64286439
pass to the JVM. This sets the -XX:MetaspaceSize and -XX:MaxMetaspaceSize=size
64296440
JVM options. If not set the JVM defaults are used.
64306441
type: string
64316442
minRAMPercentage:
6443+
anyOf:
6444+
- type: integer
6445+
- type: string
64326446
description: "Set the minimal JVM Heap size as a percentage
64336447
of the total memory. \n This option will be ignored if HeapSize
64346448
is set. \n Valid values are decimal numbers between 0 and
6435-
100. \n This field is a string value as CRDs do not support
6436-
decimal numbers. Consequently, there is no validation on the
6437-
value entered so the JVM may fail to start if an invalid value
6438-
is entered. \n This field maps the the -XX:MinRAMPercentage
6439-
JVM option and will be incompatible with some JVMs that do
6440-
not have this option (e.g. Java 8)."
6441-
type: string
6449+
100. \n NOTE: This field is a k8s resource.Quantity value
6450+
as CRDs do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity
6451+
for the different formats of number that may be entered. \n
6452+
NOTE: This field maps the the -XX:MinRAMPercentage JVM option
6453+
and will be incompatible with some JVMs that do not have this
6454+
option (e.g. Java 8)."
6455+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
6456+
x-kubernetes-int-or-string: true
64426457
nativeMemoryTracking:
64436458
description: Adds the -XX:NativeMemoryTracking=mode JVM options
64446459
where mode is on of "off", "summary" or "detail", the default

docs/about/04_coherence_spec.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ A value of -1 disables tracing completely. +
199199
+
200200
The Coherence default is -1 if not overridden. For values other than -1, numbers between 0 and 1 are acceptable. +
201201
+
202-
Due to decimal values not being allowed in a CRD field the ratio value is held as a string. Consequently there is no validation that the value entered is valid and the JVM may fail to start properly in an invalid non-numeric value is entered. m| *string | false
202+
NOTE: This field is a k8s resource.Quantity value as CRDs do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity for the different formats of number that may be entered. m| *resource.Quantity | false
203203
|===
204204
205205
<<Table of Contents,Back to TOC>>
@@ -329,27 +329,27 @@ This option will be ignored if HeapSize is set. +
329329
+
330330
Valid values are decimal numbers between 0 and 100. +
331331
+
332-
This field is a string value as CRDs do not support decimal numbers. Consequently, there is no validation on the value entered so the JVM may fail to start if an invalid value is entered. +
332+
NOTE: This field is a k8s resource.Quantity value as CRDs do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity for the different formats of number that may be entered. +
333333
+
334-
This field maps the the -XX:InitialRAMPercentage JVM option and will be incompatible with some JVMs that do not have this option (e.g. Java 8). m| &#42;string | false
334+
NOTE: This field maps the the -XX:InitialRAMPercentage JVM option and will be incompatible with some JVMs that do not have this option (e.g. Java 8). m| &#42;resource.Quantity | false
335335
m| maxRAMPercentage | Set maximum heap size as a percentage of total memory. +
336336
+
337337
This option will be ignored if HeapSize is set. +
338338
+
339339
Valid values are decimal numbers between 0 and 100. +
340340
+
341-
This field is a string value as CRDs do not support decimal numbers. Consequently, there is no validation on the value entered so the JVM may fail to start if an invalid value is entered. +
341+
NOTE: This field is a k8s resource.Quantity value as CRDs do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity for the different formats of number that may be entered. +
342342
+
343-
This field maps the the -XX:MaxRAMPercentage JVM option and will be incompatible with some JVMs that do not have this option (e.g. Java 8). m| &#42;string | false
343+
NOTE: This field maps the the -XX:MaxRAMPercentage JVM option and will be incompatible with some JVMs that do not have this option (e.g. Java 8). m| &#42;resource.Quantity | false
344344
m| minRAMPercentage | Set the minimal JVM Heap size as a percentage of the total memory. +
345345
+
346346
This option will be ignored if HeapSize is set. +
347347
+
348348
Valid values are decimal numbers between 0 and 100. +
349349
+
350-
This field is a string value as CRDs do not support decimal numbers. Consequently, there is no validation on the value entered so the JVM may fail to start if an invalid value is entered. +
350+
NOTE: This field is a k8s resource.Quantity value as CRDs do not support decimal numbers. See https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity for the different formats of number that may be entered. +
351351
+
352-
This field maps the the -XX:MinRAMPercentage JVM option and will be incompatible with some JVMs that do not have this option (e.g. Java 8). m| &#42;string | false
352+
NOTE: This field maps the the -XX:MinRAMPercentage JVM option and will be incompatible with some JVMs that do not have this option (e.g. Java 8). m| &#42;resource.Quantity | false
353353
m| stackSize | StackSize is the stack size value to pass to the JVM. The format should be the same as that used for Java's -Xss JVM option. If not set the JVM defaults are used. m| &#42;string | false
354354
m| metaspaceSize | MetaspaceSize is the min/max metaspace size to pass to the JVM. This sets the -XX:MetaspaceSize and -XX:MaxMetaspaceSize=size JVM options. If not set the JVM defaults are used. m| &#42;string | false
355355
m| directMemorySize | DirectMemorySize sets the maximum total size (in bytes) of the New I/O (the java.nio package) direct-buffer allocations. This value sets the -XX:MaxDirectMemorySize JVM option. If not set the JVM defaults are used. m| &#42;string | false

0 commit comments

Comments
 (0)