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 support for 'all namespaces' option #166

Closed
2 tasks done
AlanGreene opened this issue May 17, 2019 · 10 comments
Closed
2 tasks done

Add support for 'all namespaces' option #166

AlanGreene opened this issue May 17, 2019 · 10 comments

Comments

@AlanGreene
Copy link
Member

AlanGreene commented May 17, 2019

Current UI only displays resources from a single namespace at a time, controlled by the namespace dropdown in the side nav.

We should add an 'all namespaces' option to the dropdown so that a user can choose to view all resources of a given type (e.g. Pipeline, TaskRun, etc.) defined in the cluster regardless of namespace.

  • Option 1:
    • front end makes an API call per namespace to get the requested resources
    • will need to handle loading / error states for multiple in-flight requests for a single resource type (not currently supported)
  • Option 2:

Regardless of which option we pursue there are some front end changes that will need to be made:

  • 'success' actions should no longer include the namespace directly in the payload as results could come from multiple namespaces
  • reducers should read the namespace directly from the resource's metadata when processing
@steveodonovan
Copy link
Member

Backend api will be .../v1/namespaces/*/<resource>

However one issue here .../v1/namespaces/*/<resource>/<resourceName> will be invalid. A namespace must be provided when requesting a specific resource by name. The above will return an 404 and the message an empty namespace may not be set when a resource name is provided This is coming from the pipelineClient, not our application. Queryparameter filtering will still work though /pipelineRuns?name=pipelinename for example.

@AlanGreene
Copy link
Member Author

Updated description to include example of how this is handled by the kube API server.

@vtereso
Copy link
Contributor

vtereso commented May 22, 2019

The all namespaces option should be specific to get all CRD routes?

@vtereso
Copy link
Contributor

vtereso commented May 23, 2019

I favor anything except for the additional routes option where we (drop the /namespaces/{name})

@vtereso
Copy link
Contributor

vtereso commented May 24, 2019

Updates @steveodonovan @AlanGreene ?

@AlanGreene
Copy link
Member Author

@vtereso we're going with the * approach for now to unblock the front end work and to avoid making multiple requests from the browser. #174

@ncskier
Copy link
Member

ncskier commented Jun 6, 2019

@AlanGreene @steveodonovan the latest PR for this issue has broken the "Import Tekton resources" page. When the "All Namespaces" option is selected, we can't allow the user to create any Tekton resources (because they fail to be created). Right now the "Import Tekton resource" page does not provide the user with any feedback in this failure case. We could solve this problem by displaying an error message such as "Please select a namespace from the left navigation menu." What do you think? (I will also have to update my Create PipelineRun paneling code to address the "all namespaces" option, and @carlos-logro will have to update his Create Secret paneling.)

Also, are you going to fix this problem with the "Import Tekton resource" page under your issue here, or should I create a new issue for it?

@AlanGreene
Copy link
Member Author

The import page should have a namespace dropdown, that was the approach we discussed for this and other panels including the extensions. I missed its absence during reviews, my bad.

I've already discussed this with Carlos in relation to the secrets work and changes needed to the APIs to support 'all namespaces'.

@ncskier
Copy link
Member

ncskier commented Jun 6, 2019

Ok, thanks for the clarification. So the namespaces dropdown in the Side Nav is only for Read operations? Then each Create operation page will need to have its own namespace dropdown?

@AlanGreene
Copy link
Member Author

Exactly, that was the reason for the creation of the NamespacesDropdown component.
The dropdowns used elsewhere can default to the value selected in nav where that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants