From 93e48668519652c3d206ab3e62b312c7dcf63403 Mon Sep 17 00:00:00 2001 From: Rokibul Hasan Date: Mon, 28 Oct 2024 08:31:01 +0600 Subject: [PATCH] Update addon-manager detection Signed-off-by: Rokibul Hasan --- pkg/cmd/get/hubinfo/exec.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/get/hubinfo/exec.go b/pkg/cmd/get/hubinfo/exec.go index a35f5b41..c35db4b6 100644 --- a/pkg/cmd/get/hubinfo/exec.go +++ b/pkg/cmd/get/hubinfo/exec.go @@ -119,10 +119,8 @@ func (o *Options) printComponents() error { o.printer.Write(printer.LEVEL_0, "Components:\n") - if cmgr.Spec.AddOnManagerConfiguration != nil && 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 @@ -166,6 +164,9 @@ func (o *Options) printPlacement(cmgr *v1.ClusterManager) error { } func (o *Options) printAddOnManager(cmgr *v1.ClusterManager) error { + if cmgr.Spec.AddOnManagerConfiguration != nil && !check.IsFeatureEnabled(cmgr.Spec.AddOnManagerConfiguration.FeatureGates, string(feature.AddonManagement)) { + return nil + } o.printer.Write(printer.LEVEL_1, "AddOn Manager:\n") return printer.PrintComponentsDeploy(o.printer, o.kubeClient, cmgr.Status.RelatedResources, componentNameAddOnManagerController) }