-
Notifications
You must be signed in to change notification settings - Fork 31
feat(redundancy): add redundancy level configuration for smoke check #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e63ce38
08d39c4
199b519
a00ad6c
0dae27d
a9b0600
e801457
c14ea9b
5d5d384
1420fcf
47f4a1f
5581575
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import ( | |
| "reflect" | ||
| "time" | ||
|
|
||
| beeRedundancy "github.com/ethersphere/bee/v2/pkg/file/redundancy" | ||
| "github.com/ethersphere/beekeeper/pkg/beekeeper" | ||
| "github.com/ethersphere/beekeeper/pkg/check/act" | ||
| "github.com/ethersphere/beekeeper/pkg/check/balances" | ||
|
|
@@ -418,6 +419,7 @@ var Checks = map[string]CheckType{ | |
| RxOnErrWait *time.Duration `yaml:"rx-on-err-wait"` | ||
| NodesSyncWait *time.Duration `yaml:"nodes-sync-wait"` | ||
| Duration *time.Duration `yaml:"duration"` | ||
| RLevel *uint8 `yaml:"r-level"` | ||
|
akrem-chabchoub marked this conversation as resolved.
Outdated
|
||
| }) | ||
|
|
||
| if err := check.Options.Decode(checkOpts); err != nil { | ||
|
|
@@ -745,6 +747,19 @@ func applyCheckConfig(global CheckGlobalConfig, local, opts any) (err error) { | |
| ov.FieldByName(fieldName).Set(fieldValue) | ||
| } | ||
| } | ||
| case "RLevel": | ||
| if !lv.Field(i).IsNil() { // set locally | ||
| fieldValue := lv.FieldByName(fieldName).Elem() | ||
| level := uint8(fieldValue.Uint()) | ||
| rLevel := beeRedundancy.Level(level) | ||
| ft, ok := ot.FieldByName(fieldName) | ||
| if ok { | ||
| v := reflect.ValueOf(rLevel) | ||
| if v.Type().AssignableTo(ft.Type) { | ||
| ov.FieldByName(fieldName).Set(v) | ||
| } | ||
| } | ||
| } | ||
|
||
| default: | ||
| if lv.Field(i).IsNil() { | ||
| fmt.Printf("field %s not set, using default value\n", fieldName) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.