Skip to content

Commit

Permalink
Merge pull request #121 from lack/addon-tools-readme
Browse files Browse the repository at this point in the history
CNF-15059: Add READMEs for all addon-tools
  • Loading branch information
openshift-merge-bot[bot] authored Oct 25, 2024
2 parents fe0fa93 + 0d54114 commit c88803d
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ archives:
- goos: windows
format: zip
files:
- src: addon-tools/README.md
dst: README.md
- src: addon-tools/helm-convert/README.md
dst: README_helm-convert.md
# TODO: No readme for report-creator yet
# - src: addon-tools/report-creator/README.md
# dst: README_report-creator.md
- src: addon-tools/report-creator/README.md
dst: README_report-creator.md
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
IMAGE_NAME=kube-compare

PACKAGE_NAME := github.com/openshift/kube-compare
GOLANG_CROSS_VERSION ?= v1.22.3
GOLANG_CROSS_VERSION ?= v1.22.7

# Default values for GOOS and GOARCH
GOOS ?= linux
Expand Down Expand Up @@ -60,7 +60,7 @@ test-report-creator:

.PHONY: build-report-creator
build-report-creator:
go build ./addon-tools/report-creator/create-report.go
go build ./addon-tools/report-creator/report-creator.go

.PHONY: build-helm-convert
build-helm-convert:
Expand Down
14 changes: 14 additions & 0 deletions addon-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Addon-tools

These tools were written as helpers to the main cluster-compare plugin, and are
not supported but are provided for convenience.

## helm-convert

This utility converts a cluster-compare metadata.yaml reference to a helm
chart, which can then be used to deploy the CRs or render the CRs locally.

## report-creator

This utilitiy consumes the output.json from cluster-compare and creates a
junit.xml that matches, for integration in pipelines that like junit.xml
3 changes: 1 addition & 2 deletions addon-tools/helm-convert/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
github.com/openshift/kube-compare v0.1.1 h1:jWTTtd2fBCuPnTkXcedRulcSIPGvZQv7Me8iLEmjaCw=
github.com/openshift/kube-compare v0.1.1/go.mod h1:4uykk9QkJVdW+bh+aoDhC3jpsbqhEJabnmeHYXGjvBg=
github.com/openshift/kube-compare v0.2.0 h1:c/OUdV4rS0GxZLXpDR3LfuCU/aAXNLtQeQjU9mlFyzc=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
35 changes: 35 additions & 0 deletions addon-tools/report-creator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# report-creator add-on

report-creator is a CLI tool that allows creating a JUnit test report from the
output of the 'kubectl cluster-compare' plugin. The command uses the JSON
format output of the 'kubectl cluster-compare' plugin. This tol can be handy in
automatic test environments.

The tool divides the result of the cluster compare into 3 test suites:

1. Diff test suite - Each test in the suite represents a CR that is matched and
diffed to a reference CR. The test will be reported as failed if there are
differences between the cluster cr and the expected CR. The full diff will
be included in the test case failure message. In case there are no
differences for the CR, the test will be marked as successful.
2. Missing CRs test suite - Each test in this suite represents a missing CR
from the cluster that appeared in the reference and was expected to appear
in the cluster but wasn't found/identified. If there are no missing CRs,
this test suite will contain one successful test indicating that the cluster
contains all the expected CRs.
3. Unmatched CRs test suite - This suite includes all the CRs in the cluster
that were not matched to any reference. Each unmatched CR will be
represented as a test case that failed. If there are no unmatched CRs, then
this suite will include one successful test case representing that there are
no unmatched CRs.

## Usage

```txt
report-creator -j <COMPARE_JSON_OUTPUT_PATH> [flags]
Flags
-h, --help help for report-creator
-j, --json string Path to the file including the json output of the cluster-compare command
-o, --output string Path to save the report (default "report.xml")
```
3 changes: 1 addition & 2 deletions addon-tools/report-creator/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
github.com/openshift/kube-compare v0.1.1 h1:jWTTtd2fBCuPnTkXcedRulcSIPGvZQv7Me8iLEmjaCw=
github.com/openshift/kube-compare v0.1.1/go.mod h1:4uykk9QkJVdW+bh+aoDhC3jpsbqhEJabnmeHYXGjvBg=
github.com/openshift/kube-compare v0.2.0 h1:c/OUdV4rS0GxZLXpDR3LfuCU/aAXNLtQeQjU9mlFyzc=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
File renamed without changes.

0 comments on commit c88803d

Please sign in to comment.