Merge pull request #100203 from aojea/countcap

initialise capabilities unit test
This commit is contained in:
Kubernetes Prow Robot 2021-03-13 03:41:04 -08:00 committed by GitHub
commit 980b79c857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,10 +18,17 @@ package capabilities
import (
"reflect"
"sync"
"testing"
)
func TestGet(t *testing.T) {
defer func() {
capInstance.lock.Lock()
defer capInstance.lock.Unlock()
capInstance.capabilities = nil
capInstance.once = sync.Once{}
}()
defaultCap := Capabilities{
AllowPrivileged: false,
PrivilegedSources: PrivilegedSources{