Skip to content

Commit f817282

Browse files
Jeff McCormickcamilamacedo86
andauthored
add scorecard bundle validation feature (#2326)
* add scorecard bundle validation feature * tweaks from PR reviews * Update doc/test-framework/scorecard.md Co-Authored-By: Camila Macedo <[email protected]>
1 parent 92cfdf3 commit f817282

File tree

19 files changed

+368
-147
lines changed

19 files changed

+368
-147
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
### Added
55

6+
- Added new `--bundle` flag to the `operator-sdk scorecard` command to support bundle validation testing using the validation API (https://github.com/operator-framework/api). ([#1916](https://github.com/operator-framework/operator-sdk/pull/1916)
7+
- Added new `log` field to the `operator-sdk scorecard` v1alpha2 output to support tests that produce logging. ([#1916](https://github.com/operator-framework/operator-sdk/pull/1916)
8+
- Added new `bundle validation` test to the `operator-sdk scorecard` OLM tests. ([#1916](https://github.com/operator-framework/operator-sdk/pull/1916)
69

710
### Changed
811

cmd/operator-sdk/scorecard/cmd.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func NewCmd() *cobra.Command {
4141
scorecardCmd.Flags().String(schelpers.VersionOpt, schelpers.DefaultScorecardVersion, "scorecard version. Valid values: v1alpha1, v1alpha2")
4242
scorecardCmd.Flags().StringP(scorecard.SelectorOpt, "l", "", "selector (label query) to filter tests on (only valid when version is v1alpha2)")
4343
scorecardCmd.Flags().BoolP(scorecard.ListOpt, "L", false, "If true, only print the test names that would be run based on selector filtering (only valid when version is v1alpha2)")
44+
scorecardCmd.Flags().StringP(scorecard.BundleOpt, "b", "", "OLM bundle directory path, when specified runs bundle validation")
4445

4546
// TODO: make config file global and make this a top level flag
4647
if err := viper.BindPFlag(scorecard.ConfigOpt, scorecardCmd.Flags().Lookup(scorecard.ConfigOpt)); err != nil {
@@ -61,5 +62,8 @@ func NewCmd() *cobra.Command {
6162
if err := viper.BindPFlag("scorecard."+scorecard.ListOpt, scorecardCmd.Flags().Lookup(scorecard.ListOpt)); err != nil {
6263
log.Fatalf("Unable to add list :%v", err)
6364
}
65+
if err := viper.BindPFlag("scorecard."+scorecard.BundleOpt, scorecardCmd.Flags().Lookup(scorecard.BundleOpt)); err != nil {
66+
log.Fatalf("Unable to add bundle :%v", err)
67+
}
6468
return scorecardCmd
6569
}

doc/cli/operator-sdk_scorecard.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ operator-sdk scorecard [flags]
1414
### Options
1515

1616
```
17+
-b, --bundle string OLM bundle directory path, when specified runs bundle validation
1718
--config string config file (default is '<project_dir>/.osdk-scorecard'; the config file's extension and format can be .yaml, .json, or .toml)
1819
-h, --help help for scorecard
1920
--kubeconfig string Path to kubeconfig of custom resource created in cluster

0 commit comments

Comments
 (0)