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

Sockets subscribe to all resources instead of required namespace filter #7919

Closed
richard-cox opened this issue Jan 13, 2023 · 4 comments · Fixed by #8182
Closed

Sockets subscribe to all resources instead of required namespace filter #7919

richard-cox opened this issue Jan 13, 2023 · 4 comments · Fixed by #8182

Comments

@richard-cox
Copy link
Member

Setup

  • Rancher version: 2.7.-head
  • Browser type & version:

Describe the bug
Sockets subscriptions for resources should be limited by the same attributes as their initial fetch request (id, selector, ns). It doesn't look like this is working for namespaces

To Reproduce

  • Enabling the Required Namespace Filter Performance feature and set the threshold to something low
  • Navigate to a list with resources over the threshold
  • Select a single namespace
  • Refresh the browser
  • Notice that the http request contains the selected namespace, but the websocket subscribe message does not supply it

Expected Result

  • socket sub should contain namespace
@ghost
Copy link

ghost commented Jan 18, 2023

blocked by rancher/rancher#40196

@gaktive
Copy link
Member

gaktive commented Jan 24, 2023

Should be unblocked now via PRs:
rancher/apiserver#20
rancher/steve#73
rancher/rancher#40238

@cmurphy let me know if I'm mistaken.

@cmurphy
Copy link

cmurphy commented Jan 24, 2023

@gaktive yes the rancher PR is merged so this is ready to use.

@floatingman
Copy link

Setup

Bring up a single node Rancher instance based on the latest RC version
Create a workload of various deployments in different namespaces

This script will create 10 nginx deployments in 10 namespaces.

#!/bin/bash

# Create 10 namespaces
for i in {1..10}
do
  kubectl create namespace nginx-namespace-$i
done

# Create 10 Nginx deployments in each namespace
for i in {1..10}
do
  for j in {1..10}
  do
    kubectl create deployment nginx-$j --image=nginx --namespace=nginx-namespace-$i
  done
done

In Rancher Manager, In Global Settings under Performance,
Enable required namespace filtering and set a low threshold like 5.

Testing

  1. Browse to Rancher Manager
  2. Open Dev tools in your browser and click on the Network tab.
  3. In the local cluster, click on the Workloads
  4. Observe the message asking you to filter by a specific namespace.
  5. Select one of the namespaces you created in the filter tab and observe that the namespace is listed in the HTTP request and the WebSocket.

@zube zube bot closed this as completed Mar 6, 2023
@zube zube bot removed the [zube]: Done label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants