1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 07:26:55 +00:00

fix: update CLI to use store for fetching regclient (#9345)

* fix: update CLI to use store for fetching regclient

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: nil

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: pass the rclient

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
This commit is contained in:
Vishal Choudhary 2024-01-05 14:14:39 +05:30 committed by GitHub
parent 42a6b4b545
commit 8a13ec1bba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,6 +125,10 @@ func runTest(out io.Writer, testCase test.TestCase, auditWarn bool) ([]engineapi
}
validPolicies = append(validPolicies, pol)
}
rclient := store.GetRegistryClient()
if rclient == nil {
rclient = registryclient.NewOrDie()
}
// execute engine
var engineResponses []engineapi.EngineResponse
var resultCounts processor.ResultCounts
@ -142,7 +146,7 @@ func runTest(out io.Writer, testCase test.TestCase, auditWarn bool) ([]engineapi
Client: dClient,
Subresources: vars.Subresources(),
Out: out,
RegistryClient: registryclient.NewOrDie(),
RegistryClient: rclient,
}
ers, err := processor.ApplyPoliciesOnResource()
if err != nil {