Skip to content

Commit

Permalink
adding PyxisHost value to ContainerCheckConfig for ubi check initiali…
Browse files Browse the repository at this point in the history
…zation

Signed-off-by: Adam D. Cornett <adc@redhat.com>
  • Loading branch information
acornett21 committed Nov 18, 2024
1 parent ed06ae7 commit 0184783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions container/check_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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})),
Expand All @@ -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})),
Expand Down

0 comments on commit 0184783

Please sign in to comment.