Skip to content

Commit 49e4e10

Browse files
authored
doc/test-framework/scorecard: add config file section (#1026)
* doc/test-framework/scorecard: add config file section
1 parent 5f3c3a5 commit 49e4e10

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

doc/test-framework/scorecard.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ use. For example:
3636
$ operator-sdk scorecard --cr-manifest deploy/crds/app_operator_cr.yaml --csv-path deploy/app_operator-0.0.2.yaml
3737
```
3838

39+
## Config File
40+
41+
The scorecard supports the use of a config file instead of or in addition to flags for configuration. By default, the scorecard will look
42+
for a file called `.osdk-scorecard` with either a `.yaml`, `.json`, or `.toml` file extension. You can also
43+
specify a different config file with the `--config` flag. The configuration options in the config file match the flags.
44+
For instance, for the flags `--cr-manifest "deploy/crds/cache_v1alpha1_memcached_cr.yaml" --init-timeout 60 --csv-path "deploy/memcachedoperator.0.0.2.csv.yaml"`, the corresponding yaml config file would contain:
45+
46+
```yaml
47+
cr-manifest: "deploy/crds/cache_v1alpha1_memcached_cr.yaml"
48+
init-timeout: 60
49+
csv-path: "deploy/memcachedoperator.0.0.2.csv.yaml"
50+
```
51+
52+
The hierarchy of config methods from highest priority to least is: flag->file->default.
53+
54+
The config file support is provided by the `viper` package. For more info on how viper
55+
configuration works, see [`viper`'s README][viper].
56+
3957
## What Each Test Does
4058

4159
There are 8 tests the scorecard can run:
@@ -83,4 +101,5 @@ the CSV. This test has a maximum score equal to the number of fields in the stat
83101
[cli-reference]: ../sdk-cli-reference.md#scorecard
84102
[writing-tests]: ./writing-e2e-tests.md
85103
[owned-crds]: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md#owned-crds
86-
[alm-examples]: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md#crd-templates
104+
[alm-examples]: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/Documentation/design/building-your-csv.md#crd-templates
105+
[viper]: https://github.com/spf13/viper/blob/master/README.md

0 commit comments

Comments
 (0)