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

Add custom resource instances page #2356

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

joaquimrocha
Copy link
Collaborator

(taken from #2226 as the author @Guilamb has no availability to work on it anymore)

This pull request addresses the issue of restricted user access to custom resources and the need to view only the instantiated custom resources (#955 ), by introducing a new CR instances page in Headlamp that displays a list of all instantiated custom resources, that can be filtered by category.

The CR instances page provides users with the capability to view their Resource Status and Definitions without requiring the development of a custom UI. It also allows users to filter namespaces, similar to the existing functionality for Workloads, ensuring restricted permissions are maintained.

Fixes: #1962

Fixes: #1962
Signed-off-by: guilhane <guilhane.bourgoin@orange.com>
as discussed in #2226
Signed-off-by: guilhane <guilhane.bourgoin@orange.com>
Signed-off-by: guilhane <guilhane.bourgoin@orange.com>
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 26, 2024

for (const crd of crds) {
const crClass = crd.makeCRClass();
const [crItems, crError] = await new Promise<[KubeCRD[] | null, any | null]>(resolve => {
Copy link
Contributor

Choose a reason for hiding this comment

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

these requests are made one after another, Promise.all would allow doing them concurrently. Or maybe even using react-query?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. I was modifying just that today 😄
About react-query, I only saw examples of it using a hook, which in this case of iterating through objects is not ideal. I will see if they have a non-hook API.

…resources. Fixes: #1962 Signed-off-by: guilhane <guilhane.bourgoin@orange.com>

NOTE: Add prefix to the base commit title.

Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
Use react-query for fetching the instances of just a plain API fetch.

Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
@joaquimrocha
Copy link
Collaborator Author

@sniok I have done an attempt on adding react-query but I am not sure this is performing more fetches than needed (maybe triggering an infinite loop in some cases). Can you double check?

@sniok sniok force-pushed the add-customResource-instances-page branch 2 times, most recently from e0241d7 to 2bf5ef3 Compare September 30, 2024 13:09
Signed-off-by: Oleksandr Dubenko <oldubenko@microsoft.com>
@sniok sniok force-pushed the add-customResource-instances-page branch from 2bf5ef3 to 38c08c9 Compare September 30, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to pass Cluster Settings via Config for user Groups
3 participants