Skip to content
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

feat: allow hiding "All namespaces" in namespaces dropdown list #9547

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

avanish23
Copy link
Contributor

@avanish23 avanish23 commented Oct 17, 2024

Closes #8894
With this PR a new option is enabled in the global setting to hide the all-namespaces option in the namespaces dropdown menu in UI.
Briefly explain why this is required
Hides all namespace fields in the namespace selection dropbox to avoid accidental selection in large clusters and prevent OOM errors.

/kind feature

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 17, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @avanish23!

It looks like this is your first PR to kubernetes/dashboard 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/dashboard has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 17, 2024
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 35.93%. Comparing base (4b66aa1) to head (c224e63).
Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9547      +/-   ##
==========================================
- Coverage   35.94%   35.93%   -0.01%     
==========================================
  Files         301      301              
  Lines       14479    14481       +2     
  Branches      183      183              
==========================================
  Hits         5204     5204              
- Misses       9051     9053       +2     
  Partials      224      224              

@floreks
Copy link
Member

floreks commented Oct 17, 2024

This feels like a hacky workaround. We are working on introducing a dynamic cache that should greatly improve responsiveness in large clusters. However, storing cached data will probably require greater memory limits.

@avanish23
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

@avanish23: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions 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.

@avanish23 avanish23 changed the title Allow hiding "All namespaces" in namespaces dropdown list feat: allow hiding "All namespaces" in namespaces dropdown list Oct 17, 2024
@avanish23
Copy link
Contributor Author

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 17, 2024
@avanish23
Copy link
Contributor Author

This feels like a hacky workaround. We are working on introducing a dynamic cache that should greatly improve responsiveness in large clusters. However, storing cached data will probably require greater memory limits.

Yes, I agree. This could be treated as a temporary workaround until we have the fix you are talking about.
Do you have any potential issues/concerns this could bring up?

@floreks
Copy link
Member

floreks commented Oct 17, 2024

Ye, I don't like introducing temporary flags that will be deprecated and removed shortly after being introduced. It can be confusing. Also, we are trying to avoid container flags that directly manipulate the UI. It should probably be done in a different way. Possibly via settings.

@avanish23
Copy link
Contributor Author

avanish23 commented Oct 17, 2024

Ok, this makes sense to be using setting instead. I think it should be added as part of the global setting.
Let me do it that way.

Update: I have made changes to use the settings instead of the container flags.
@floreks looking for reviews.
Thanks!

@avanish23 avanish23 force-pushed the disable-all-namespaces branch from 6f420b7 to 526683e Compare October 17, 2024 13:27
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 17, 2024
@avanish23 avanish23 force-pushed the disable-all-namespaces branch from 2fba2b8 to 4bd48b6 Compare October 17, 2024 19:14
@k8s-ci-robot k8s-ci-robot added language/de Updates or issues for German translations. language/fr Updates or issues for French translations. language/ja Updates or issues for Japanese translations. language/ko Updates or issues for Korean translations. language/zh Updates or issues for Chinese translations. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 21, 2024
@floreks
Copy link
Member

floreks commented Oct 22, 2024

For some reason namespace switch on settings view is always set to false even after switching to true and saving. Probably the value read from settings config map is not properly propagated to it.

@avanish23
Copy link
Contributor Author

avanish23 commented Oct 22, 2024

Oh, I see.
Thanks for the update @floreks, let me take a look at this.

Update:
@floreks, I think I have identified the problem and fixed it.
Can you please check if it works fine now?

@avanish23 avanish23 force-pushed the disable-all-namespaces branch from 6b87ba3 to a68ab27 Compare October 22, 2024 14:15
@avanish23 avanish23 force-pushed the disable-all-namespaces branch from a68ab27 to 0d5f653 Compare October 22, 2024 15:44
(cherry picked from commit 534a365efcf56aa7b3592b55e0885d021f97688c)

added translation; bumped up charts version;fixed lint

revert chart version bumpup

add hideAllNamespaces in externalSettings func

fix conflict
@avanish23 avanish23 force-pushed the disable-all-namespaces branch from 6fa243c to c224e63 Compare October 22, 2024 15:47
Copy link
Member

@floreks floreks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avanish23, floreks

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 31, 2024
@floreks floreks merged commit 36b08ee into kubernetes:master Oct 31, 2024
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. language/de Updates or issues for German translations. language/fr Updates or issues for French translations. language/ja Updates or issues for Japanese translations. language/ko Updates or issues for Korean translations. language/zh Updates or issues for Chinese translations. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow hiding "All namespaces" in namespaces dropdown list
3 participants