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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@
**/testdata/reports/contacts/**
**/testdata/reports/deprecate-all/**
**/testdata/reports/deprecate-green/**
**/testdata/reports/deprecate-json/**
**compare.json**
41 changes: 8 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,37 +101,12 @@ generate-dashboards:
## todo: remove after 4.9-GA
## @Helpers - Deprecated implementations

.PHONY: all-deprecated ## run all reports that we are using to gathering the data to help out
all-deprecated: install
make generate-deprecate-green
make generate-deprecate-all
make generate-pkgs
make generate-ivs-report

.PHONY: generate-deprecate-green ## This method should be remove soon. It is only an internal helper
generate-deprecate-green: install ## ensure that you have update the the date of the report.
go run ./hack/scripts/deprecated-bundles-repo/deprecate-green/deprecated_index.go --image=testdata/reports/redhat_certified_operator_index/bundles_registry.redhat.io_redhat_certified_operator_index_v4.9_2021-09-05.json
go run ./hack/scripts/deprecated-bundles-repo/deprecate-green/deprecated_index.go --image=testdata/reports/redhat_redhat_marketplace_index/bundles_registry.redhat.io_redhat_redhat_marketplace_index_v4.9_2021-09-05.json
go run ./hack/scripts/deprecated-bundles-repo/deprecate-green/deprecated_index.go --image=testdata/reports/redhat_redhat_operator_index/bundles_registry.redhat.io_redhat_redhat_operator_index_v4.9_2021-09-05.json

.PHONY: generate-deprecate-all ## This method should be remove soon. It is only an internal helper
generate-deprecate-all: install ## ensure that you have update the the date of the report.
go run ./hack/scripts/deprecated-bundles-repo/deprecate-all/deprecated_index.go --image=testdata/reports/redhat_certified_operator_index/bundles_registry.redhat.io_redhat_certified_operator_index_v4.9_2021-09-05.json
go run ./hack/scripts/deprecated-bundles-repo/deprecate-all/deprecated_index.go --image=testdata/reports/redhat_redhat_marketplace_index/bundles_registry.redhat.io_redhat_redhat_marketplace_index_v4.9_2021-09-05.json
go run ./hack/scripts/deprecated-bundles-repo/deprecate-all/deprecated_index.go --image=testdata/reports/redhat_redhat_operator_index/bundles_registry.redhat.io_redhat_redhat_operator_index_v4.9_2021-09-05.json

.PHONY: generate-pkgs ## This method should be remove soon. It is only an internal helper
generate-pkgs: ## ensure that you have update the the date of the report.
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_certified_operator_index/bundles_registry.redhat.io_redhat_certified_operator_index_v4.8_2021-09-04.json
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_redhat_marketplace_index/bundles_registry.redhat.io_redhat_redhat_marketplace_index_v4.8_2021-09-04.json
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_redhat_operator_index/bundles_registry.redhat.io_redhat_redhat_operator_index_v4.8_2021-09-04.json
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_community_operator_index/bundles_registry.redhat.io_redhat_community_operator_index_v4.8_2021-09-05.json
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_certified_operator_index/bundles_registry.redhat.io_redhat_certified_operator_index_v4.9_2021-09-05.json
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_redhat_marketplace_index/bundles_registry.redhat.io_redhat_redhat_marketplace_index_v4.9_2021-09-05.json
go run ./hack/scripts/packages/generate.go --image=testdata/reports/redhat_redhat_operator_index/bundles_registry.redhat.io_redhat_redhat_operator_index_v4.9_2021-09-05.json

.PHONY: generate-ivs-report ## This method should be remove soon. It is only an internal helper
generate-ivs-report: ## ensure that you have the mongo json file and update the the date of the report.
go run hack/scripts/ivs-emails/generate.go --mongo=hack/scripts/ivs-emails/mongo-query-join-results-prod.json --image=testdata/reports/redhat_certified_operator_index/bundles_registry.redhat.io_redhat_certified_operator_index_v4.9_2021-09-05.json
go run hack/scripts/ivs-emails/generate.go --mongo=hack/scripts/ivs-emails/mongo-query-join-results-prod.json --image=testdata/reports/redhat_redhat_marketplace_index/bundles_registry.redhat.io_redhat_redhat_marketplace_index_v4.9_2021-09-05.json
.PHONY: generate-helpers ## run all reports that we are using to gathering the data to help out
generate-helpers:
go run ./hack/scripts/generate_helpers.go

.PHONY: generate-all ## Generate all testdata
generate-all:
make generate-testdata
make generate-dashboards
make generate-helpers
59 changes: 1 addition & 58 deletions cmd/custom/maxocp/template.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<main>

<h1>Max OCP version for 4.9 Dashboard </h1>
<p>The audit tool output for the following packages were obtained by checking the image and the bundle manifests distributed. This report aims to try to identify the package distributions that can impact the users on 4.9.</p>
<p>The audit tool output for the following packages were obtained by checking the image and the bundle manifests distributed. This report aims to try to identify the package distributions that are missing the max ocp version as <= 4.8 because we can find the usage of these APIs in the manifests shipped.</p>

<div class="container-fluid themed-container">
<h5 class="display-12 fw-bold">Data from the image used</h5>
Expand All @@ -100,11 +100,6 @@
<li>Ensure that any distribution which requires any deprecated API(s) in the OCP catalogs are configured with the Max OpenShift Version compatible (`olm.openShiftMaxVersion`) so it will only be distributed on OCP version(s) <= 4.8. Also, control which version the bundle is deployed to from OLM via the annotation/label `com.redhat.openshift.versions`. More info see: <a href="https://github.com/operator-framework/community-operators/blob/master/docs/packaging-required-criteria-ocp.md"> OKD/OpenShift Catalogs criteria and options </a></li>
<li>OpenShift 4.8 introduces two new alerts that fire when an API that will be removed in the next release is in use. Check the event alerts of your Operators running on 4.8 and ensure that you do not find any warning about these API(s) still being used by it</li>
</ul>
<h5 class="display-12 fw-bold">3. What does it mean for a package to be in red, amber or green?</h5>
<ul>
<li> <b>(Green) Complying:</b> these are packages that has all bundles which uses the removed APIs in 1.22 with max ocp version set <=4.8 </li>
<li> <b>(Amber) Not complying:</b> these are the packages that we could find at least one scenario missing the max ocp version when should have</li>
</ul>
</div>

<div class="container-fluid themed-container">
Expand Down Expand Up @@ -158,58 +153,6 @@
</tbody>
</table>
</div>

<div class="container-fluid themed-container">
<h5 class="display-12 fw-bold">Have Max OCP version when required or does not need it at all</h5>
<table id="ok" class="minimalistBlack" style="background-color:#3FA91E;width:98%">
<thead>
<tr>
<th>Package Name</th>
<th>Kinds to migrate</th>
<th>Channels</th>
<th>Bundles uses API(s)</th>
<th>Bundles Migrated</th>
</tr>
</thead>
<tbody>
{{ with .OK }}
{{ range . }}
<tr>
<th>{{ .Name }}</th>
<th>
<ul>
{{ range .Kinds }}
<li>{{ . }}</li>
{{ end }}
</ul>
</th>
<th>
<ul>
{{ range .Channels }}
<li>{{ . }}</li>
{{ end }}
</ul>
</th>
<th>
<ul>
{{ range .Bundles }}
<li>{{ . }}</li>
{{ end }}
</ul>
</th>
<th>
<ul>
{{ range .BundlesMigrated }}
<li>{{ . }}</li>
{{ end }}
</ul>
</th>
</tr>
{{ end }}
{{ end }}
</tbody>
</table>
</div>
</main>

</body>
Expand Down
3 changes: 2 additions & 1 deletion hack/grade/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ func main() {
// Ignore the tag images 4.6 and 4.7
if strings.Contains(info.Name(), "v4.7") ||
strings.Contains(info.Name(), "v4.6") ||
strings.Contains(info.Name(), "v4.8") {
strings.Contains(info.Name(), "v4.8") ||
strings.Contains(info.Name(), "operatorhubio") {
return nil
}

Expand Down
9 changes: 7 additions & 2 deletions hack/report/bundles/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ func main() {
//"registry.redhat.io/redhat/community-operator-index:v4.9": "https://registry.redhat.io",
"registry.redhat.io/redhat/redhat-marketplace-index:v4.9": "https://registry.redhat.io",
"registry.redhat.io/redhat/redhat-operator-index:v4.9": "https://registry.redhat.io",
"registry.redhat.io/redhat/community-operator-index:v4.8": "https://registry.redhat.io",
"quay.io/operatorhubio/catalog:latest": "https://registry.connect.redhat.com",
}

indexReportKinds := []string{"bundles"}
Expand Down Expand Up @@ -102,11 +100,18 @@ func main() {
"registry.redhat.io/redhat/redhat-marketplace-index:v4.8": "https://registry.redhat.io",
"registry.redhat.io/redhat/redhat-operator-index:v4.8": "https://registry.redhat.io",
"registry.redhat.io/redhat/certified-operator-index:v4.8": "https://registry.redhat.io",
"registry.redhat.io/redhat/community-operator-index:v4.8": "https://registry.redhat.io",
"quay.io/operatorhubio/catalog:latest": "https://registry.connect.redhat.com",
}

indexReportKinds = []string{"bundles"}
for image, registry := range images {
reportPathName := filepath.Join(reportPath, hack.GetImageNameToCreateDir(image))

// Create the dir if does not exist
command := exec.Command("mkdir", reportPathName)
_, _ = pkg.RunCommand(command)

command = exec.Command("docker", "login", registry)
_, err = pkg.RunCommand(command)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,15 @@ func main() {
log.Fatal(err)
}

defaultOutputPath := "hack/scripts/deprecated-bundles-repo/deprecate-all"

var outputPath string
var jsonFile string

flag.StringVar(&outputPath, "output", defaultOutputPath, "Inform the path for output the report, if not informed it will be generated at hack/scripts/deprecated-bundles-repo/deprecate-green.")
flag.StringVar(&jsonFile, "image", "", "Inform the path for the JSON result which will be used to generate the report. ")
flag.StringVar(&outputPath, "output", currentPath, "Inform the path for output the report, if not informed it will be generated at hack/scripts/deprecated-bundles-repo/deprecate-green.")
flag.StringVar(&jsonFile, "file", "", "Inform the path for the JSON result which will be used to generate the report. ")

flag.Parse()

byteValue, err := pkg.ReadFile(filepath.Join(currentPath, jsonFile))
byteValue, err := pkg.ReadFile(jsonFile)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -223,11 +221,7 @@ func main() {

}

reportPath = filepath.Join(currentPath, hack.ReportsPath, "deprecate-json")
command = exec.Command("mkdir", reportPath)
_, _ = pkg.RunCommand(command)

fp = filepath.Join(reportPath, pkg.GetReportName(apiDashReport.ImageName, "deprecate-all", "json"))
fp = filepath.Join(outputPath, pkg.GetReportName(apiDashReport.ImageName, "deprecate-all", "json"))
f, err = os.Create(fp)
if err != nil {
log.Fatal(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"flag"
"log"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
Expand Down Expand Up @@ -71,17 +70,15 @@ func main() {
log.Fatal(err)
}

defaultOutputPath := "hack/scripts/deprecated-bundles-repo/deprecate-green"

var outputPath string
var jsonFile string

flag.StringVar(&outputPath, "output", defaultOutputPath, "Inform the path for output the report, if not informed it will be generated at hack/scripts/deprecated-bundles-repo/deprecate-green.")
flag.StringVar(&jsonFile, "image", "", "Inform the path for the JSON result which will be used to generate the report. ")
flag.StringVar(&outputPath, "output", currentPath, "Inform the path for output the report, if not informed it will be generated at hack/scripts/deprecated-bundles-repo/deprecate-green.")
flag.StringVar(&jsonFile, "file", "", "Inform the path for the JSON result which will be used to generate the report. ")

flag.Parse()

byteValue, err := pkg.ReadFile(filepath.Join(currentPath, jsonFile))
byteValue, err := pkg.ReadFile(jsonFile)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -228,11 +225,7 @@ func main() {
return allDeprecated[i].PackageName < allDeprecated[j].PackageName
})

reportPath := filepath.Join(currentPath, hack.ReportsPath, "deprecate-green")
command := exec.Command("mkdir", reportPath)
_, _ = pkg.RunCommand(command)

fp := filepath.Join(reportPath, pkg.GetReportName(apiDashReport.ImageName, "deprecated", "yml"))
fp := filepath.Join(outputPath, pkg.GetReportName(apiDashReport.ImageName, "deprecated", "yml"))
f, err := os.Create(fp)
if err != nil {
log.Fatal(err)
Expand All @@ -255,11 +248,7 @@ func main() {

}

reportPath = filepath.Join(currentPath, hack.ReportsPath, "deprecate-json")
command = exec.Command("mkdir", reportPath)
_, _ = pkg.RunCommand(command)

fp = filepath.Join(reportPath, pkg.GetReportName(apiDashReport.ImageName, "deprecate-green", "json"))
fp = filepath.Join(outputPath, pkg.GetReportName(apiDashReport.ImageName, "deprecate-green", "json"))
f, err = os.Create(fp)
if err != nil {
log.Fatal(err)
Expand Down
Loading