1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

fix(kubernetes): fix data-race in GetKubeClient() EE-4436 (#8498)

This commit is contained in:
andres-portainer 2023-03-14 20:11:28 -03:00 committed by GitHub
parent 347f66b1f1
commit 2b17cb9104
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 40 deletions

View file

@ -12,8 +12,8 @@ import (
// NamespaceAccessPoliciesDeleteNamespace removes stored policies associated with a given namespace
func (kcl *KubeClient) NamespaceAccessPoliciesDeleteNamespace(ns string) error {
kcl.lock.Lock()
defer kcl.lock.Unlock()
kcl.mu.Lock()
defer kcl.mu.Unlock()
policies, err := kcl.GetNamespaceAccessPolicies()
if err != nil {
@ -42,6 +42,7 @@ func (kcl *KubeClient) GetNamespaceAccessPolicies() (map[string]portainer.K8sNam
if err != nil {
return nil, err
}
return policies, nil
}