Unverified Commit 58227af1 authored by WangXiang's avatar WangXiang Committed by GitHub
Browse files

PhysicalMachineChaos: update stress options type (#3347)


* update stress options type
Signed-off-by: default avatarxiang <xiang13225080@163.com>

* update change log
Signed-off-by: default avatarxiang <xiang13225080@163.com>
Co-authored-by: default avatarTi Chi Robot <ti-community-prow-bot@tidb.io>
Showing with 278 additions and 90 deletions
+278 -90
......@@ -46,6 +46,8 @@ For more information and how-to, see [RFC: Keep A Changelog](https://github.com/
- SC2166: Use || or && rather than -o or -a [#3235](https://github.com/chaos-mesh/chaos-mesh/pull/3235)
- SC2206: Use quote to prevent word splitting/globbing [#3234](https://github.com/chaos-mesh/chaos-mesh/pull/3234)
- SC2004: Remove unnecessary $ on arithmetic variables [#3247](https://github.com/chaos-mesh/chaos-mesh/pull/3247)
- PhysicalMachineChaos: update stress options type [#3347](https://github.com/chaos-mesh/chaos-mesh/pull/3347)
### Security
......
......@@ -231,7 +231,7 @@ type StressCPUSpec struct {
// specifies N workers to apply the stressor.
Workers int `json:"workers,omitempty"`
// extend stress-ng options
Options string `json:"options,omitempty"`
Options []string `json:"options,omitempty"`
}
type StressMemorySpec struct {
......@@ -239,7 +239,7 @@ type StressMemorySpec struct {
// One can specify the size as % of total available memory or in units of B, KB/KiB, MB/MiB, GB/GiB, TB/TiB..
Size string `json:"size,omitempty"`
// extend stress-ng options
Options string `json:"options,omitempty"`
Options []string `json:"options,omitempty"`
}
type DiskFileSpec struct {
......
......@@ -1039,12 +1039,12 @@ func (in *ExpInfo) DeepCopyInto(out *ExpInfo) {
if in.StressCPU != nil {
in, out := &in.StressCPU, &out.StressCPU
*out = new(StressCPUSpec)
**out = **in
(*in).DeepCopyInto(*out)
}
if in.StressMemory != nil {
in, out := &in.StressMemory, &out.StressMemory
*out = new(StressMemorySpec)
**out = **in
(*in).DeepCopyInto(*out)
}
if in.DiskReadPayload != nil {
in, out := &in.DiskReadPayload, &out.DiskReadPayload
......@@ -3800,6 +3800,11 @@ func (in *StatusCheckStatus) DeepCopy() *StatusCheckStatus {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StressCPUSpec) DeepCopyInto(out *StressCPUSpec) {
*out = *in
if in.Options != nil {
in, out := &in.Options, &out.Options
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressCPUSpec.
......@@ -3946,6 +3951,11 @@ func (in *StressInstance) DeepCopy() *StressInstance {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StressMemorySpec) DeepCopyInto(out *StressMemorySpec) {
*out = *in
if in.Options != nil {
in, out := &in.Options, &out.Options
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressMemorySpec.
......
......@@ -554,7 +554,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -563,7 +565,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size as %
......
......@@ -2211,7 +2211,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2220,7 +2222,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -5113,7 +5117,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -5122,7 +5128,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can
......@@ -7717,7 +7725,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -7727,7 +7737,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......
......@@ -2232,7 +2232,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2241,7 +2243,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -4644,7 +4648,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -4653,7 +4659,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -7627,7 +7635,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -7637,7 +7647,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......@@ -10322,7 +10334,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply
the stressor.
......@@ -10332,7 +10346,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed
per vm worker, default is the total available
......@@ -2329,7 +2329,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2338,7 +2340,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -4858,7 +4862,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -4867,7 +4873,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can
......
......@@ -554,7 +554,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -563,7 +565,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size as %
......
......@@ -2211,7 +2211,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2220,7 +2222,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -5113,7 +5117,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -5122,7 +5128,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can
......@@ -7717,7 +7725,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -7727,7 +7737,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......
......@@ -2232,7 +2232,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2241,7 +2243,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -4644,7 +4648,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -4653,7 +4659,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -7627,7 +7635,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -7637,7 +7647,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......@@ -10322,7 +10334,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply
the stressor.
......@@ -10332,7 +10346,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed
per vm worker, default is the total available
......@@ -2329,7 +2329,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2338,7 +2340,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -4858,7 +4862,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -4867,7 +4873,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can
......
......@@ -3546,7 +3546,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -3555,7 +3557,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default is
the total available memory. One can specify the size as % of total
......@@ -6896,7 +6900,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -6905,7 +6911,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size as
......@@ -9742,7 +9750,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -9751,7 +9761,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -12290,7 +12302,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -12300,7 +12314,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm
worker, default is the total available memory.
......@@ -19464,7 +19480,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -19473,7 +19491,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size as
......@@ -21840,7 +21860,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -21849,7 +21871,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -24761,7 +24785,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -24771,7 +24797,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm
worker, default is the total available memory.
......@@ -27398,7 +27426,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply
the stressor.
......@@ -27408,7 +27438,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......@@ -37190,7 +37222,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -37199,7 +37233,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -39665,7 +39701,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -39674,7 +39712,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -3568,7 +3568,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -3577,7 +3579,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size as %
......@@ -6927,7 +6931,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -6936,7 +6942,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -9829,7 +9837,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -9838,7 +9848,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can
......@@ -12433,7 +12445,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -12443,7 +12457,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......@@ -19713,7 +19729,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -19722,7 +19740,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker, default
is the total available memory. One can specify the size
......@@ -22125,7 +22145,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -22134,7 +22156,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -25108,7 +25132,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the
stressor.
......@@ -25118,7 +25144,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per
vm worker, default is the total available
......@@ -27803,7 +27831,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply
the stressor.
......@@ -27813,7 +27843,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed
per vm worker, default is the total available
......@@ -37819,7 +37851,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -37828,7 +37862,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can specify
......@@ -40348,7 +40384,9 @@ spec:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -40357,7 +40395,9 @@ spec:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: specifies N bytes consumed per vm worker,
default is the total available memory. One can
......@@ -4908,7 +4908,10 @@ var doc = `{
},
"options": {
"description": "extend stress-ng options",
"type": "string"
"type": "array",
"items": {
"type": "string"
}
},
"workers": {
"description": "specifies N workers to apply the stressor.",
......@@ -4959,7 +4962,10 @@ var doc = `{
"properties": {
"options": {
"description": "extend stress-ng options",
"type": "string"
"type": "array",
"items": {
"type": "string"
}
},
"size": {
"description": "specifies N bytes consumed per vm worker, default is the total available memory.\nOne can specify the size as % of total available memory or in units of B, KB/KiB, MB/MiB, GB/GiB, TB/TiB..",
......
......@@ -4892,7 +4892,10 @@
},
"options": {
"description": "extend stress-ng options",
"type": "string"
"type": "array",
"items": {
"type": "string"
}
},
"workers": {
"description": "specifies N workers to apply the stressor.",
......@@ -4943,7 +4946,10 @@
"properties": {
"options": {
"description": "extend stress-ng options",
"type": "string"
"type": "array",
"items": {
"type": "string"
}
},
"size": {
"description": "specifies N bytes consumed per vm worker, default is the total available memory.\nOne can specify the size as % of total available memory or in units of B, KB/KiB, MB/MiB, GB/GiB, TB/TiB..",
......
......@@ -2512,7 +2512,9 @@ definitions:
type: integer
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
workers:
description: specifies N workers to apply the stressor.
type: integer
......@@ -2574,7 +2576,9 @@ definitions:
properties:
options:
description: extend stress-ng options
type: string
items:
type: string
type: array
size:
description: |-
specifies N bytes consumed per vm worker, default is the total available memory.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment