Skip to content

Commit

Permalink
Check if generic_plugin is loaded before invoking it
Browse files Browse the repository at this point in the history
  • Loading branch information
pliurh authored and openshift-cherrypick-robot committed Dec 1, 2021
1 parent e7048ef commit 59cbb8b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,14 @@ func (dn *Daemon) nodeStateSyncHandler(generation int64) error {
}

if !reqReboot {
// Apply generic_plugin last
err = dn.LoadedPlugins[GenericPlugin].Apply()
if err != nil {
glog.Errorf("nodeStateSyncHandler(): generic_plugin fail to apply: %v", err)
return err
plugin, ok := dn.LoadedPlugins[GenericPlugin]
if ok {
// Apply generic_plugin last
err = plugin.Apply()
if err != nil {
glog.Errorf("nodeStateSyncHandler(): generic_plugin fail to apply: %v", err)
return err
}
}
}

Expand Down

0 comments on commit 59cbb8b

Please sign in to comment.