From 15ca2b4fab974875ed13e88d06cbe8392890c3d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20S=C3=A1rai?= Date: Fri, 19 Jul 2024 18:30:33 +0200 Subject: [PATCH] fix: revert file-retrieval --- pkg/config/check.go | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/pkg/config/check.go b/pkg/config/check.go index 419d55f93..5363d9ec1 100644 --- a/pkg/config/check.go +++ b/pkg/config/check.go @@ -112,29 +112,25 @@ var Checks = map[string]CheckType{ "file-retrieval": { NewAction: fileretrieval.NewCheck, NewOptions: func(checkGlobalConfig CheckGlobalConfig, check Check) (interface{}, error) { - /* - checkOpts := new(struct { - FileName *string `yaml:"file-name"` - FileSize *int64 `yaml:"file-size"` - FilesPerNode *int `yaml:"files-per-node"` - Full *bool `yaml:"full"` - GasPrice *string `yaml:"gas-price"` - PostageAmount *int64 `yaml:"postage-amount"` - PostageLabel *string `yaml:"postage-label"` - Seed *int64 `yaml:"seed"` - UploadNodeCount *int `yaml:"upload-node-count"` - }) - if err := check.Options.Decode(checkOpts); err != nil { - return nil, fmt.Errorf("decoding check %s options: %w", check.Type, err) - } - opts := fileretrieval.NewDefaultOptions() - - if err := applyCheckConfig(checkGlobalConfig, checkOpts, &opts); err != nil { - return nil, fmt.Errorf("applying options: %w", err) - } - */ + checkOpts := new(struct { + FileName *string `yaml:"file-name"` + FileSize *int64 `yaml:"file-size"` + FilesPerNode *int `yaml:"files-per-node"` + Full *bool `yaml:"full"` + GasPrice *string `yaml:"gas-price"` + PostageAmount *int64 `yaml:"postage-amount"` + PostageLabel *string `yaml:"postage-label"` + Seed *int64 `yaml:"seed"` + UploadNodeCount *int `yaml:"upload-node-count"` + }) + if err := check.Options.Decode(checkOpts); err != nil { + return nil, fmt.Errorf("decoding check %s options: %w", check.Type, err) + } opts := fileretrieval.NewDefaultOptions() - return opts, nil + + if err := applyCheckConfig(checkGlobalConfig, checkOpts, &opts); err != nil { + return nil, fmt.Errorf("applying options: %w", err) + } return opts, nil },