Skip to content

Commit 3ba9712

Browse files
Check if HostedModeInfoFunc is nil before setting install mode (#318)
Signed-off-by: Jian Qiu <[email protected]> Co-authored-by: Jian Qiu <[email protected]>
1 parent f0710ee commit 3ba9712

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/addonmanager/controllers/agentdeploy/healthcheck_sync.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ func (s *healthCheckSyncer) probeAddonStatusByWorks(
131131

132132
var addonManifestWorks []*workapiv1.ManifestWork
133133
var err error
134-
installMode, _ := s.agentAddon.GetAgentAddonOptions().HostedModeInfoFunc(addon, cluster)
134+
installMode := constants.InstallModeDefault
135+
if s.agentAddon.GetAgentAddonOptions().HostedModeInfoFunc != nil {
136+
installMode, _ = s.agentAddon.GetAgentAddonOptions().HostedModeInfoFunc(addon, cluster)
137+
}
135138
if installMode == constants.InstallModeHosted {
136139
addonManifestWorks, err = s.getWorkByHostedAddon(addon.Name, addon.Namespace)
137140
} else {

0 commit comments

Comments
 (0)