Skip to content

Commit 330db27

Browse files
glpeska-nogikh
authored andcommitted
syz-ci: manager dash value is nil if dashboard is nil
The introduction of the ManagerDashapi interface unintentionally overrode the nil checks on the manager's dashboard value. This change sets the interface value only if there is a valid dashboard.
1 parent db79ee4 commit 330db27

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

syz-ci/manager.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,15 @@ func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{},
154154
repo: repo,
155155
mgrcfg: mgrcfg,
156156
managercfg: mgrcfg.managercfg,
157-
dash: dash,
158157
storage: assetStorage,
159158
debugStorage: !cfg.AssetStorage.IsEmpty() && cfg.AssetStorage.Debug,
160159
stop: stop,
161160
debug: debug,
162161
}
162+
// Leave the dashboard interface value as nil if it does not wrap a valid dashboard pointer.
163+
if dash != nil {
164+
mgr.dash = dash
165+
}
163166

164167
os.RemoveAll(mgr.currentDir)
165168
return mgr, nil

syz-ci/syz-ci.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ type ManagerConfig struct {
180180
// and rename managers/foo to managers/ci-foo. Then this instance can be moved
181181
// to another ci along with managers/ci-foo dir.
182182
Name string `json:"name"`
183-
Disabled string `json:"disabled"` // If not empty, don't build/start this manager.
184-
DashboardClient string `json:"dashboard_client"`
185-
DashboardKey string `json:"dashboard_key"`
183+
Disabled string `json:"disabled"` // If not empty, don't build/start this manager.
184+
DashboardClient string `json:"dashboard_client"` // Optional.
185+
DashboardKey string `json:"dashboard_key"` // Optional.
186186
Repo string `json:"repo"`
187187
// Short name of the repo (e.g. "linux-next"), used only for reporting.
188188
RepoAlias string `json:"repo_alias"`

0 commit comments

Comments
 (0)