From b2481f01a5d39d9281bc6c07b2fafcc1a9169fa1 Mon Sep 17 00:00:00 2001 From: David Elie-Dit-Cosaque Date: Tue, 5 Dec 2023 15:13:01 -0600 Subject: [PATCH] fix tests --- container/check_container.go | 2 +- errors/errors.go | 1 - operator/check_operator.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/container/check_container.go b/container/check_container.go index f78a09740..62a12f7b3 100644 --- a/container/check_container.go +++ b/container/check_container.go @@ -40,7 +40,7 @@ func NewCheck(image string, opts ...Option) *containerCheck { func (c *containerCheck) Run(ctx context.Context) (certification.Results, error) { pol, checks, err := c.List(ctx) if err != nil { - return certification.Results{}, fmt.Errorf("%w: %s", preflighterr.ErrCannotListChecks, err) + return certification.Results{}, err } cfg := runtime.Config{ diff --git a/errors/errors.go b/errors/errors.go index c58c4cde5..91b48e832 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -9,5 +9,4 @@ var ( ErrImageEmpty = errors.New("image is empty") ErrCannotResolvePolicyException = errors.New("cannot resolve policy exception") ErrCannotInitializeChecks = errors.New("unable to initialize checks") - ErrCannotListChecks = errors.New("unable to list checks") ) diff --git a/operator/check_operator.go b/operator/check_operator.go index 6cad71ad2..2aae24cf5 100644 --- a/operator/check_operator.go +++ b/operator/check_operator.go @@ -38,7 +38,7 @@ func NewCheck(image, indeximage string, kubeconfig []byte, opts ...Option) *oper func (c operatorCheck) Run(ctx context.Context) (certification.Results, error) { _, checks, err := c.List(ctx) if err != nil { - return certification.Results{}, fmt.Errorf("%w: %s", preflighterr.ErrCannotListChecks, err) + return certification.Results{}, err } cfg := runtime.Config{