-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Fix klusterlet-info
command and update hub-info
output.
#453
Changes from all commits
c776493
d3cd9ba
750e384
ad43749
5511482
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ package check | |
|
||
import ( | ||
"fmt" | ||
|
||
"k8s.io/apimachinery/pkg/api/errors" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
clusterclient "open-cluster-management.io/api/client/cluster/clientset/versioned" | ||
|
@@ -79,3 +78,12 @@ func findResource(list *metav1.APIResourceList, resourceName string) bool { | |
} | ||
return false | ||
} | ||
|
||
func IsFeatureEnabled(featureGates []operatorv1.FeatureGate, feature string) bool { | ||
for _, fg := range featureGates { | ||
if fg.Feature == feature && fg.Mode == operatorv1.FeatureGateModeTypeEnable { | ||
return true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still does not fit the add-on manager case, because it is enabled by default.
example: https://github.com/open-cluster-management-io/ocm/blob/865ae069b3e5eab72faf3c1bcd2eb52bb7c1b8c6/pkg/registration/spoke/spokeagent.go#L419 |
||
} | ||
} | ||
return false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not have a work controller component on the hub side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I enable the
ManifestWorkReplicaSet
feature, then the work controller gets deployed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I think we should print the work-controller only when the ManifestWorkReplicaSet feature is enabled.
BTW, the
cluster-manager-addon-manager-controller
is in the same situation. if theAddonManagement
feature is enabled, we should print the addon-manager info.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated code to print each controller only when its feature is enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add some tests or paste some test result because when I try to use the command to get info, I got:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found even there is no
addOnManagerConfiguration
configured in the clustermanager.spec, the addon-manager is enabled by default.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so maybe we need to refactor the
IsFeatureEnabled
func.references: