You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add selector flag to the scorecard subcommand (#2096)
* add dry-run and selector flags to the scorecard subcommand
* make default selector flag value empty string
* add selector implementation and remove dryrun which will be added later
* remove dryrun from CHANGELOG since that is not in this PR
* update scorecard doc to include selector flag
* refactor to delete tests based on selector
* remove weights in test suite as part of removing a test when using selector flag, update sdk scorecard docs to include selector flag and v1alpha2 output instead of v1alpha1 output
* add validation for v1alpha2 to not allow external plugins, add test for this validation
* Update internal/scorecard/config.go
Co-Authored-By: Joe Lanford <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@
37
37
- Added the Go version, OS, and architecture to the output of `operator-sdk version` ([#1863](https://github.com/operator-framework/operator-sdk/pull/1863))
38
38
- Added support for `ppc64le-linux` for the `operator-sdk` binary and the Helm operator base image. ([#1533](https://github.com/operator-framework/operator-sdk/pull/1533))
39
39
- Added new `--version` flag to the `operator-sdk scorecard` command to support a new output format for the scorecard. ([#1916](https://github.com/operator-framework/operator-sdk/pull/1916)
40
+
- Added new `--selector` flag to the `operator-sdk scorecard` command to support filtering scorecard tests based on labels added to each test. ([#1916](https://github.com/operator-framework/operator-sdk/pull/1916)
scorecardCmd.Flags().String(scorecard.ConfigOpt, "", fmt.Sprintf("config file (default is '<project_dir>/%s'; the config file's extension and format can be .yaml, .json, or .toml)", scorecard.DefaultConfigFile))
38
38
scorecardCmd.Flags().String(scplugins.KubeconfigOpt, "", "Path to kubeconfig of custom resource created in cluster")
39
39
scorecardCmd.Flags().StringP(scorecard.OutputFormatOpt, "o", scorecard.TextOutputFormat, fmt.Sprintf("Output format for results. Valid values: %s, %s", scorecard.TextOutputFormat, scorecard.JSONOutputFormat))
40
-
scorecardCmd.Flags().String(schelpers.VersionOpt, schelpers.DefaultScorecardVersion, fmt.Sprintf("scorecard version (tech preview version is '%s'", schelpers.LatestScorecardVersion))
Operator actions are reflected in status: 1/1 points
434
-
Writing into CRs has an effect: 1/1 points
435
-
OLM Integration:
436
-
Provided APIs have validation: 1/1
437
-
Owned CRDs have resources listed: 1/1 points
438
-
CRs have at least 1 example: 0/1 points
439
-
Spec fields with descriptors: 1/1 points
440
-
Status fields with descriptors: 0/1 points
441
-
442
-
Total Score: 84%
443
-
SUGGESTION: Add an alm-examples annotation to your CSV to pass the CRs have at least 1 example test
444
-
SUGGESTION: Add a status descriptor for nodes
430
+
$ operator-sdk scorecard --cr-manifest deploy/crds/cache.example.com_v1alpha1_memcached_cr.yaml --csv-path deploy/olm-catalog/memcached-operator/0.0.2/memcached-operator.v0.0.2.clusterserviceversion.yaml -o text
431
+
basic:
432
+
Writing into CRs has an effect : pass
433
+
Spec Block Exists : pass
434
+
Status Block Exists : pass
435
+
olm:
436
+
Spec fields with descriptors : pass
437
+
Status fields with descriptors : pass
438
+
Provided APIs have validation : fail
439
+
Owned CRDs have resources listed : pass
440
+
CRs have at least 1 example : pass
441
+
SUGGESTION: Add CRD validation for Memcached/v1alpha1
442
+
SUGGESTION: If it would be helpful to an end-user to understand or troubleshoot your CR, consider adding resources [deployments/v1 services/v1 configmaps/v1 memcacheds/v1alpha1 replicasets/v1] to the resources section for owned CRD Memcached
Copy file name to clipboardExpand all lines: doc/test-framework/scorecard.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,8 @@ While most configuration is done via a config file, there are a few important ar
106
106
| `--config` | string | Path to config file (default `<project_dir>/.osdk-scorecard`; file type and extension can be any of `.yaml`, `.json`, or `.toml`). If a config file is not provided and a config file is not found at the default location, the scorecard will exit with an error. |
107
107
| `--output`, `-o` | string | Output format. Valid options are: `text`and `json`. The default format is `text`, which is designed to be a simpler human readable format. The `json` format uses the JSON schema output format used for plugins defined later in this document. |
108
108
| `--kubeconfig`, `-o` | string | path to kubeconfig. It sets the kubeconfig internally for internal plugins and sets the `KUBECONFIG` env var to the provided value for external plugins. If an external plugin specifically sets the `KUBECONFIG` env var, the kubeconfig from the specified env var will be used for that plugin instead. |
109
-
| `--version` | string | The version of scorecard to run, v1alpha1 is the default, whereas v1alpha2 is the tech preview. |
109
+
| `--version` | string | The version of scorecard to run, v1alpha2 is the default, valid values are v1alpha and v1alpha2. |
110
+
| `--selector`, `-l` | string | The label selector to filter tests on, only valid in version v1alpha2. |
0 commit comments