From b292f97632c558fec7bd45af73017d4db4abba29 Mon Sep 17 00:00:00 2001 From: "Adam D. Cornett" Date: Fri, 8 Nov 2024 15:00:38 -0700 Subject: [PATCH] adding PyxisHost value to ContainerCheckConfig for ubi check initialization Signed-off-by: Adam D. Cornett --- container/check_container.go | 1 + internal/engine/engine.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/container/check_container.go b/container/check_container.go index eafab42a..77bde6c0 100644 --- a/container/check_container.go +++ b/container/check_container.go @@ -96,6 +96,7 @@ func (c *containerCheck) resolve(ctx context.Context) error { DockerConfig: c.dockerconfigjson, PyxisAPIToken: c.pyxisToken, CertificationProjectID: c.certificationProjectID, + PyxisHost: c.pyxisHost, }) if err != nil { return fmt.Errorf("%w: %s", preflighterr.ErrCannotInitializeChecks, err) diff --git a/internal/engine/engine.go b/internal/engine/engine.go index 76e81ea2..98d4ac3f 100644 --- a/internal/engine/engine.go +++ b/internal/engine/engine.go @@ -753,7 +753,7 @@ func InitializeOperatorChecks(ctx context.Context, p policy.Policy, cfg Operator // ContainerCheckConfig contains configuration relevant to an individual check's execution. type ContainerCheckConfig struct { - DockerConfig, PyxisAPIToken, CertificationProjectID string + DockerConfig, PyxisAPIToken, CertificationProjectID, PyxisHost string } // InitializeContainerChecks returns the appropriate checks for policy p given cfg. @@ -769,7 +769,7 @@ func InitializeContainerChecks(ctx context.Context, p policy.Policy, cfg Contain &containerpol.RunAsNonRootCheck{}, &containerpol.HasModifiedFilesCheck{}, containerpol.NewBasedOnUbiCheck(pyxis.NewPyxisClient( - check.DefaultPyxisHost, + cfg.PyxisHost, cfg.PyxisAPIToken, cfg.CertificationProjectID, &http.Client{Timeout: 60 * time.Second})), @@ -783,7 +783,7 @@ func InitializeContainerChecks(ctx context.Context, p policy.Policy, cfg Contain &containerpol.HasRequiredLabelsCheck{}, &containerpol.HasModifiedFilesCheck{}, containerpol.NewBasedOnUbiCheck(pyxis.NewPyxisClient( - check.DefaultPyxisHost, + cfg.PyxisHost, cfg.PyxisAPIToken, cfg.CertificationProjectID, &http.Client{Timeout: 60 * time.Second})),