Skip to content

Centralize logic for scorecard CI image replacement #3912

@joelanford

Description

@joelanford

We currently repeat the same image replacement code for the scorecard-test image in three places:

  1. testutils.ReplaceRegexInFile(
    filepath.Join(tc.Dir, "config", "scorecard", "patches", "basic.config.yaml"),
    "quay.io/operator-framework/scorecard-test:.*",
    "quay.io/operator-framework/scorecard-test:dev",
    )
    testutils.ReplaceRegexInFile(
    filepath.Join(tc.Dir, "config", "scorecard", "patches", "olm.config.yaml"),
    "quay.io/operator-framework/scorecard-test:.*",
    "quay.io/operator-framework/scorecard-test:dev",
    )
  2. testutils.ReplaceRegexInFile(
    filepath.Join(tc.Dir, "config", "scorecard", "patches", "basic.config.yaml"),
    "quay.io/operator-framework/scorecard-test:.*",
    "quay.io/operator-framework/scorecard-test:dev",
    )
    testutils.ReplaceRegexInFile(
    filepath.Join(tc.Dir, "config", "scorecard", "patches", "olm.config.yaml"),
    "quay.io/operator-framework/scorecard-test:.*",
    "quay.io/operator-framework/scorecard-test:dev",
    )
  3. testutils.ReplaceRegexInFile(
    filepath.Join(tc.Dir, "config", "scorecard", "patches", "basic.config.yaml"),
    "quay.io/operator-framework/scorecard-test:.*",
    "quay.io/operator-framework/scorecard-test:dev",
    )
    testutils.ReplaceRegexInFile(
    filepath.Join(tc.Dir, "config", "scorecard", "patches", "olm.config.yaml"),
    "quay.io/operator-framework/scorecard-test:.*",
    "quay.io/operator-framework/scorecard-test:dev",
    )

We should centralize this into a shared utility function in ./test/internal/, (perhaps rename scorecard-custom-patch.go to scorecard.go and add it there?)

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions