Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: '1.16'
- name: Perform the test
run: make test
coverage:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: '1.16'
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
**/bin
**/tmp


# skip .out files (coverage tests)
*.out

14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,17 @@ generate-samples:
go run ./hack/samples/generate_samples.go

.PHONY: generate-testdata ## Generate the full testdata directory
generate-testdata:
generate-testdata: docker-login
make install
go run ./hack/report/full.go
go run ./hack/samples/generate_samples.go
go run ./hack/backport/backport.go

go run ./hack/report/full.go
make generate-index

.PHONY: docker-login ## Login to redhat registries to get the latest versions
docker-login:
docker login https://registry.connect.redhat.com
docker login https://registry.redhat.io

.PHONY: generate-index ## Generate index.html
generate-index:
go run ./hack/index/generate.go
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ docker login https://registry.redhat.io
Now, you can audit all operator bundles of an image catalog with:

```sh
audit-tool bundles --index-image=registry.redhat.io/redhat/redhat--operator-index:v4.7 --head-only --output-path=testdata/xls
audit-tool index bundles --index-image=registry.redhat.io/redhat/redhat--operator-index:v4.7 --head-only --output-path=testdata/xls
```

Now, you can audit all packages of an image catalog with:

```sh
audit-tool packages --index-image=registry.redhat.io/redhat/redhat--operator-index:v4.7 --output-path=testdata/xls
audit-tool index packages --index-image=registry.redhat.io/redhat/redhat--operator-index:v4.7 --output-path=testdata/xls
```

Note that you can also output the results in JSON format:

```sh
audit-tool bundles index \
audit-tool index bundles \
--index-image=registry.redhat.io/redhat/redhat-operator-index:v4.7 \
--limit=3 \
--head-only \
Expand All @@ -81,7 +81,7 @@ audit-tool bundles index \
Use the `--help` flag to check the options and the further information about its commands. Following an example:

```sh
$ audit-tool bundles --help
$ audit-tool index bundles --help
Provides reports with the details of all bundles operators ship in the index image informed according to the criteria defined via the flags.

**When this report is useful?**
Expand All @@ -92,34 +92,24 @@ Usage:
audit-tool bundles [flags]

Flags:
--disable-scorecard if set, will disable the scorecard tests
--disable-validators if set, will disable the validators tests
--filter string filter by the packages names which are like *filter*
--head-only if set, will just check the operator bundle which are head of the channels
-h, --help help for bundles
--index-image string index image and tag which will be audit
--label string filter by bundles which has index images where contains *label*
--label-value string filter by bundles which has index images where contains *label=label-value*. This option can only be used with the --label flag.
--limit int32 limit the num of operator bundles to be audit
--output string inform the output format. [Flags: xls, json]. (Default: xls) (default "xls")
--output-path string inform the path of the directory to output the report. (Default: current directory) (default "/Users/camilamacedo/go/src/github.com/operator-framework/audit-1")
...
```

### Filtering results by names

See that you can use the `--filter` --flag to filter the results by the package name:

```sh
./bin/audit audit [bundles|packages|channels] --index-image=registry.redhat.io/redhat/redhat-operator-index:v4.5 --filter="mypackagename"
audit-tool index [bundles|packages|channels] --index-image=registry.redhat.io/redhat/redhat-operator-index:v4.5 --filter="mypackagename"
```

## Reports

| Report Type | Command | Description |
| ------ | ----- | ------ |
| bundles | `audit bundle --index-image [OPTIONS]` | Audit all Bundles |
| packages | `audit packages --index-image [OPTIONS]` | Audit all Packages |
| channels | `audit channels --index-image [OPTIONS]` | Audit all Channels |
| bundles | `audit index bundle --index-image [OPTIONS]` | Audit all Bundles |
| packages | `audit index packages --index-image [OPTIONS]` | Audit all Packages |
| channels | `audit index channels --index-image [OPTIONS]` | Audit all Channels |

## Testdata

Expand Down
Loading