diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-09-28 16:20:12 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-10-04 11:03:59 +0200 |
| commit | 37f7ec75a3672de8b3280d0b59ef2d4c97e5097d (patch) | |
| tree | 9b0925c248dfbb8dc6f78f7f50623fe72e7775b2 /pkg/mgrconfig | |
| parent | ab1e139258d1e091f58bff6ffbc42b138a3d4cb8 (diff) | |
all: introduce asset storage config to syz-manager
Let users set the asset storage config in the syz-manager config.
When running under syz-ci, pass the asset storage config from the syz-ci.
Create an asset storage instance on the start of syz-manager.
Refactor some of syz-manager code to make it less complex.
Diffstat (limited to 'pkg/mgrconfig')
| -rw-r--r-- | pkg/mgrconfig/config.go | 12 | ||||
| -rw-r--r-- | pkg/mgrconfig/load.go | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/pkg/mgrconfig/config.go b/pkg/mgrconfig/config.go index 46270ab0c..68242faf8 100644 --- a/pkg/mgrconfig/config.go +++ b/pkg/mgrconfig/config.go @@ -5,6 +5,8 @@ package mgrconfig import ( "encoding/json" + + "github.com/google/syzkaller/pkg/asset" ) type Config struct { @@ -191,6 +193,16 @@ type Config struct { // Parameters for concrete types are in Config type in vm/TYPE/TYPE.go, e.g. vm/qemu/qemu.go. VM json.RawMessage `json:"vm"` + // Asset storage configuration. There can be specified the upload location and crash assets + // to upload. + // A sample config: + // { + // "upload_to": "gs://bucket", + // "public_access": true + // } + // More details can be found in pkg/asset/config.go. + AssetStorage *asset.Config `json:"asset_storage"` + // Implementation details beyond this point. Filled after parsing. Derived `json:"-"` } diff --git a/pkg/mgrconfig/load.go b/pkg/mgrconfig/load.go index f1063ed17..bef05faa4 100644 --- a/pkg/mgrconfig/load.go +++ b/pkg/mgrconfig/load.go @@ -182,6 +182,15 @@ func Complete(cfg *Config) error { if err != nil { return err } + if !cfg.AssetStorage.IsEmpty() { + if cfg.DashboardClient == "" { + return fmt.Errorf("asset storage also requires dashboard client") + } + err = cfg.AssetStorage.Validate() + if err != nil { + return err + } + } cfg.initTimeouts() return nil } |
