-
Notifications
You must be signed in to change notification settings - Fork 53
✨ feature : count the number of kubeflex control plane contexts #495
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
base: main
Are you sure you want to change the base?
✨ feature : count the number of kubeflex control plane contexts #495
Conversation
Signed-off-by: redpinecube <[email protected]>
Signed-off-by: redpinecube <[email protected]>
Signed-off-by: redpinecube <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @redpinecube. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
| func CountKubeflexControlPlaneContexts(kconf clientcmdapi.Config) int { | ||
| count := 0 | ||
|
|
||
| for _, ctx := range kconf.Contexts { | ||
| ext := ctx.Extensions | ||
| if ext == nil { | ||
| continue | ||
| } | ||
|
|
||
| runtimeObj, ok := ext[ExtensionKubeflexKey] | ||
| if !ok { | ||
| continue | ||
| } | ||
|
|
||
| var extData RuntimeKubeflexExtension | ||
| if err := ConvertRuntimeObjectToRuntimeExtension(runtimeObj, &extData); err != nil { | ||
| continue | ||
| } | ||
|
|
||
| if cpName, ok := extData.Data[ExtensionControlPlaneName]; ok && cpName != "" { | ||
| count++ | ||
| } | ||
| } | ||
|
|
||
| return count | ||
| } |
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.
Please review all comments listed on this PR #493
rxinui
left a comment
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.
Changes to do
| return DiagnosisStatusOK | ||
| } | ||
|
|
||
| func CountKubeflexControlPlaneContexts(kconf clientcmdapi.Config) int { |
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.
What is the point of counting cp?
|
@redpinecube can you please confirm we need to merge this set of PRs in the following order: #495 (this one) Could you also please look into rebasing ? |
I'll put all updates in one PR. It should close the parent issue |
|
@redpinecube: are you still working on this? |
|
@redpinecube do you wish to continue working on this? |
|
Isn't context counting already available from the output of |
|
/ok-to-test |
|
Hi @redpinecube 👋 This PR has merge conflicts that need to be resolved. You can do this with: git fetch origin
git rebase origin/main
# Resolve any conflicts in your editor
git add .
git rebase --continue
git push --force-with-leaseOnce rebased, the CI checks will run again. Let us know if you need any help! |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
Implements CountKubeflexControlPlaneContexts to count the number of control plane contexts.
Related issue(s)
#388
redpinecube#22