From e37519151b1d589e11b8fe1a4f3e16cff0945bf5 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Sat, 13 Mar 2021 01:16:58 +0100 Subject: [PATCH] initialize capabilities unit test --- pkg/capabilities/capabilities_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/capabilities/capabilities_test.go b/pkg/capabilities/capabilities_test.go index ea4434d06184b..54311d7682bdd 100644 --- a/pkg/capabilities/capabilities_test.go +++ b/pkg/capabilities/capabilities_test.go @@ -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{