✨ feature : count the number of kubeflex control plane contexts#495
✨ feature : count the number of kubeflex control plane contexts#495redpinecube wants to merge 3 commits intokubestellar:mainfrom
Conversation
Signed-off-by: redpinecube <tara.chakkithara@icloud.com>
Signed-off-by: redpinecube <tara.chakkithara@icloud.com>
Signed-off-by: redpinecube <tara.chakkithara@icloud.com>
|
[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.
Please review all comments listed on this PR #493
| return DiagnosisStatusOK | ||
| } | ||
|
|
||
| func CountKubeflexControlPlaneContexts(kconf clientcmdapi.Config) int { |
There was a problem hiding this comment.
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