diff --git a/pkg/cmd/get/hubinfo/exec.go b/pkg/cmd/get/hubinfo/exec.go index eab93388..4e7b14a3 100644 --- a/pkg/cmd/get/hubinfo/exec.go +++ b/pkg/cmd/get/hubinfo/exec.go @@ -118,10 +118,9 @@ func (o *Options) printComponents() error { } o.printer.Write(printer.LEVEL_0, "Components:\n") - if check.IsFeatureEnabled(cmgr.Spec.AddOnManagerConfiguration.FeatureGates, string(feature.AddonManagement)) { - if err := o.printAddOnManager(cmgr); err != nil { - return err - } + + if err := o.printAddOnManager(cmgr); err != nil { + return err } if err := o.printRegistration(cmgr); err != nil { return err @@ -150,7 +149,7 @@ func (o *Options) printRegistration(cmgr *v1.ClusterManager) error { func (o *Options) printWork(cmgr *v1.ClusterManager) error { o.printer.Write(printer.LEVEL_1, "Work:\n") - if check.IsFeatureEnabled(cmgr.Spec.WorkConfiguration.FeatureGates, string(feature.ManifestWorkReplicaSet)) { + if cmgr.Spec.WorkConfiguration != nil && check.IsFeatureEnabled(cmgr.Spec.WorkConfiguration.FeatureGates, string(feature.ManifestWorkReplicaSet)) { err := printer.PrintComponentsDeploy(o.printer, o.kubeClient, cmgr.Status.RelatedResources, componentNameWorkController) if err != nil { return err