mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
fix(kubernetes): Namespace access permission changes role bindings not created [R8S-366] (#826)
This commit is contained in:
parent
150d986179
commit
b7e906701a
10 changed files with 95 additions and 17 deletions
22
api/kubernetes/cli/client_test.go
Normal file
22
api/kubernetes/cli/client_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package cli
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestClearUserClientCache(t *testing.T) {
|
||||
factory, _ := NewClientFactory(nil, nil, nil, "", "", "")
|
||||
kcl := &KubeClient{}
|
||||
factory.endpointProxyClients.Set("12.1", kcl, 0)
|
||||
factory.endpointProxyClients.Set("12.12", kcl, 0)
|
||||
factory.endpointProxyClients.Set("12", kcl, 0)
|
||||
|
||||
factory.ClearUserClientCache("12")
|
||||
|
||||
if len(factory.endpointProxyClients.Items()) != 2 {
|
||||
t.Errorf("Incorrect clients cached after clearUserClientCache;\ngot=\n%d\nwant=\n%d", len(factory.endpointProxyClients.Items()), 2)
|
||||
}
|
||||
if _, ok := factory.GetProxyKubeClient("12", "12"); ok {
|
||||
t.Errorf("Expected not to find client cache for user after clear")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue