From fb49ba5becdb10c38dd65040ba3e3e161e7ff18d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:28:09 -0600 Subject: [PATCH 01/14] Bump google.golang.org/api from 0.214.0 to 0.215.0 (#2671) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.214.0 to 0.215.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.214.0...v0.215.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index fa6c1a0d1..c8c0ef367 100644 --- a/go.mod +++ b/go.mod @@ -103,7 +103,7 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.14.0 // indirect + github.com/googleapis/gax-go/v2 v2.14.1 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gosuri/uitable v0.0.4 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect @@ -199,10 +199,10 @@ require ( golang.org/x/time v0.8.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect google.golang.org/grpc v1.67.1 // indirect - google.golang.org/protobuf v1.35.2 // indirect + google.golang.org/protobuf v1.36.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -246,7 +246,7 @@ require ( github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20241211152839-f787b66d23c7 github.com/robert-nix/ansihtml v1.0.1 golang.org/x/term v0.28.0 - google.golang.org/api v0.214.0 + google.golang.org/api v0.215.0 k8s.io/kubectl v0.32.0 k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 ) diff --git a/go.sum b/go.sum index 8fae69b48..04f7ea804 100644 --- a/go.sum +++ b/go.sum @@ -263,8 +263,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= -github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= -github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= +github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= +github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= @@ -707,18 +707,18 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= -google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= +google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= +google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= -google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= +google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= -google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= -google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 661e9a54da23be38c6d641826b46d0305eb866f3 Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Wed, 8 Jan 2025 02:38:56 -0600 Subject: [PATCH 02/14] Update GolangCI-lint to v1.63.3 (#2667) Update GolangCI-lint to v1.63.3 --- .github/workflows/pre-main.yaml | 2 +- .golangci.yml | 2 +- Makefile | 2 +- tests/accesscontrol/suite.go | 2 -- tests/networking/suite.go | 1 - webserver/webserver.go | 1 - 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pre-main.yaml b/.github/workflows/pre-main.yaml index 2e44cf720..398589537 100644 --- a/.github/workflows/pre-main.yaml +++ b/.github/workflows/pre-main.yaml @@ -73,7 +73,7 @@ jobs: - name: Golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 with: - version: v1.60 + version: v1.63 args: --timeout 10m0s - name: Checkmake diff --git a/.golangci.yml b/.golangci.yml index 38b387305..584d5865f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -127,6 +127,6 @@ issues: # golangci.com configuration # https://github.com/golangci/golangci/wiki/Configuration service: - golangci-lint-version: 1.62.x # use the fixed version to not introduce new linters unexpectedly + golangci-lint-version: 1.63.x # use the fixed version to not introduce new linters unexpectedly prepare: - echo "here I can run custom commands, but no preparation needed for this repo" diff --git a/Makefile b/Makefile index 72fda1038..d7517552f 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ GIT_COMMIT=$(shell script/create-version-files.sh) GIT_RELEASE=$(shell script/get-git-release.sh) GIT_PREVIOUS_RELEASE=$(shell script/get-git-previous-release.sh) CLAIM_FORMAT_VERSION=$(shell script/get-claim-version.sh) -GOLANGCI_VERSION=v1.62.2 +GOLANGCI_VERSION=v1.63.3 LINKER_CERTSUITE_RELEASE_FLAGS=-X github.com/redhat-best-practices-for-k8s/certsuite/pkg/versions.GitCommit=${GIT_COMMIT} LINKER_CERTSUITE_RELEASE_FLAGS+= -X github.com/redhat-best-practices-for-k8s/certsuite/pkg/versions.GitRelease=${GIT_RELEASE} LINKER_CERTSUITE_RELEASE_FLAGS+= -X github.com/redhat-best-practices-for-k8s/certsuite/pkg/versions.GitPreviousRelease=${GIT_PREVIOUS_RELEASE} diff --git a/tests/accesscontrol/suite.go b/tests/accesscontrol/suite.go index 08415839c..5d3c182cb 100644 --- a/tests/accesscontrol/suite.go +++ b/tests/accesscontrol/suite.go @@ -577,8 +577,6 @@ func testPodServiceAccount(check *checksdb.Check, env *provider.TestEnvironment) } // testPodRoleBindings verifies that the pod utilizes a valid role binding that does not cross non-CNF namespaces -// -//nolint:funlen func testPodRoleBindings(check *checksdb.Check, env *provider.TestEnvironment) { var compliantObjects []*testhelper.ReportObject var nonCompliantObjects []*testhelper.ReportObject diff --git a/tests/networking/suite.go b/tests/networking/suite.go index 2be84dee0..260561e90 100644 --- a/tests/networking/suite.go +++ b/tests/networking/suite.go @@ -328,7 +328,6 @@ func testDualStackServices(check *checksdb.Check, env *provider.TestEnvironment) check.SetResult(compliantObjects, nonCompliantObjects) } -//nolint:funlen func testNetworkPolicyDenyAll(check *checksdb.Check, env *provider.TestEnvironment) { var compliantObjects []*testhelper.ReportObject var nonCompliantObjects []*testhelper.ReportObject diff --git a/webserver/webserver.go b/webserver/webserver.go index e6bd4e265..4cc3fde20 100644 --- a/webserver/webserver.go +++ b/webserver/webserver.go @@ -121,7 +121,6 @@ type ResponseData struct { Message string `json:"message"` } -//nolint:funlen func installReqHandlers() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { // Set the content type to "text/html". From 6ce3d2b952e18e5264382cbc1fa0f4f656a5406a Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Wed, 8 Jan 2025 09:36:02 -0600 Subject: [PATCH 03/14] provider: prevent fatal log when no operatorGroups (#2672) --- pkg/provider/operators.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/provider/operators.go b/pkg/provider/operators.go index b105d0ea2..085687629 100644 --- a/pkg/provider/operators.go +++ b/pkg/provider/operators.go @@ -36,6 +36,7 @@ import ( "github.com/redhat-openshift-ecosystem/openshift-preflight/artifacts" plibRuntime "github.com/redhat-openshift-ecosystem/openshift-preflight/certification" plibOperator "github.com/redhat-openshift-ecosystem/openshift-preflight/operator" + k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -349,12 +350,18 @@ func GetAllOperatorGroups() ([]*olmv1.OperatorGroup, error) { client := clientsholder.GetClientsHolder() list, err := client.OlmClient.OperatorsV1().OperatorGroups("").List(context.TODO(), metav1.ListOptions{}) - if err != nil { + if err != nil && !k8serrors.IsNotFound(err) { return nil, err } + if k8serrors.IsNotFound(err) { + log.Warn("No OperatorGroup(s) found in the cluster") + return nil, nil + } + if len(list.Items) == 0 { - return nil, errors.New("no OperatorGroup found") + log.Warn("OperatorGroup API resource found but no OperatorGroup(s) found in the cluster") + return nil, nil } // Collect all OperatorGroup pointers From 3a617a779dcd25c84d488ad8b1a5b9d8532ce291 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:51:13 -0600 Subject: [PATCH 04/14] Bump ubi9/python-39 in /.github/actions/documentation (#2674) Bumps ubi9/python-39 from `dde5068` to `9c3fbaa`. --- updated-dependencies: - dependency-name: ubi9/python-39 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/actions/documentation/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/documentation/Dockerfile b/.github/actions/documentation/Dockerfile index 81f97209c..34a47b2ee 100644 --- a/.github/actions/documentation/Dockerfile +++ b/.github/actions/documentation/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/python-39:9.5@sha256:dde5068ba8fd81eef41a9128ddad2b99e2e02e5869ffe925c605b609a0ad7bbb +FROM registry.access.redhat.com/ubi9/python-39:9.5@sha256:9c3fbaa5af85700cd2a1c298332d8c7edbf7cca02f02b3977bf67752f141044b # Pin versions in pip. # hadolint ignore=DL3013 From 7c0514712f8e32d387d55ff0672bbe2a04ad585a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 13:29:10 -0600 Subject: [PATCH 05/14] Bump ubi9/ubi from `38791b2` to `53d6c19` (#2676) Bumps ubi9/ubi from `38791b2` to `53d6c19`. --- updated-dependencies: - dependency-name: ubi9/ubi dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8a6e426c9..6c3aa6387 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/ubi:9.5@sha256:38791b293262ac2169eca2717e68e626a047d2b89fbd1da544db24ed0204efeb AS build +FROM registry.access.redhat.com/ubi9/ubi:9.5@sha256:53d6c19d664f4f418ce5c823d3a33dbb562a2550ea249cf07ef10aa063ace38f AS build ENV CERTSUITE_DIR=/usr/certsuite ENV \ CERTSUITE_SRC_DIR=${CERTSUITE_DIR}/src \ From 09fca3422b1f033167905c2d2bb969b1bf90fbf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:07:27 -0600 Subject: [PATCH 06/14] Bump ubi9/ubi-minimal from `daa61d6` to `b870979` (#2675) Bumps ubi9/ubi-minimal from `daa61d6` to `b870979`. --- updated-dependencies: - dependency-name: ubi9/ubi-minimal dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6c3aa6387..141ca174f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ FROM quay.io/redhat-best-practices-for-k8s/oct:latest AS db # Copy the state into a new flattened image to reduce size. # TODO run as non-root -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5@sha256:daa61d6103e98bccf40d7a69a0d4f8786ec390e2204fd94f7cc49053e9949360 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5@sha256:b87097994ed62fbf1de70bc75debe8dacf3ea6e00dd577d74503ef66452c59d6 ENV \ CERTSUITE_DIR=/usr/certsuite \ From 2e6a875e45344d4920b2622c7fb8481383a68d5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:07:56 -0600 Subject: [PATCH 07/14] Bump google.golang.org/api from 0.215.0 to 0.216.0 (#2677) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.215.0 to 0.216.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.215.0...v0.216.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 18 +++++++++--------- go.sum | 40 ++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index c8c0ef367..73489580e 100644 --- a/go.mod +++ b/go.mod @@ -180,28 +180,28 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xlab/treeprint v1.2.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel v1.31.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect - go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel/metric v1.31.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect + go.opentelemetry.io/otel/trace v1.31.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go4.org v0.0.0-20200104003542-c7e774b10ea0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/oauth2 v0.24.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.8.0 // indirect + golang.org/x/time v0.9.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect - google.golang.org/grpc v1.67.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect + google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -246,7 +246,7 @@ require ( github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20241211152839-f787b66d23c7 github.com/robert-nix/ansihtml v1.0.1 golang.org/x/term v0.28.0 - google.golang.org/api v0.215.0 + google.golang.org/api v0.216.0 k8s.io/kubectl v0.32.0 k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 ) diff --git a/go.sum b/go.sum index 04f7ea804..86fde97ac 100644 --- a/go.sum +++ b/go.sum @@ -587,8 +587,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= +go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 h1:jd0+5t/YynESZqsSyPz+7PAFdEop0dlN0+PkyHYo8oI= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0/go.mod h1:U707O40ee1FpQGyhvqnzmCJm1Wh6OX6GGBVn0E6Uyyk= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0 h1:bflGWrfYyuulcdxf14V6n9+CoQcu5SAAdHmDPAJnlps= @@ -605,14 +605,14 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 h1:dEZWPjVN22urgY go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0/go.mod h1:sTt30Evb7hJB/gEk27qLb1+l9n4Tb8HvHkR0Wx3S6CU= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 h1:VhlEQAPp9R1ktYfrPk5SOryw1e9LDDTZCbIPFrho0ec= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0/go.mod h1:kB3ufRbfU+CQ4MlUcqtW8Z7YEOBeK2DJ6CmR5rYYF3E= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= -go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= -go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= -go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= +go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= +go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= +go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= +go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -649,8 +649,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= -golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -690,8 +690,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -707,16 +707,16 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/api v0.215.0 h1:jdYF4qnyczlEz2ReWIsosNLDuzXyvFHJtI5gcr0J7t0= -google.golang.org/api v0.215.0/go.mod h1:fta3CVtuJYOEdugLNWm6WodzOS8KdFckABwN4I40hzY= +google.golang.org/api v0.216.0 h1:xnEHy+xWFrtYInWPy8OdGFsyIfWJjtVnO39g7pz2BFY= +google.golang.org/api v0.216.0/go.mod h1:K9wzQMvWi47Z9IU7OgdOofvZuw75Ge3PPITImZR/UyI= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d h1:xJJRGY7TJcvIlpSrN3K6LAWgNFUILlO+OMAqtg9aqnw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= From 23d8d48abd7df3324529655680a1dd1290e58e56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:51:28 -0600 Subject: [PATCH 08/14] Bump github.com/redhat-best-practices-for-k8s/oct from 0.0.30 to 0.0.31 (#2681) Bumps [github.com/redhat-best-practices-for-k8s/oct](https://github.com/redhat-best-practices-for-k8s/oct) from 0.0.30 to 0.0.31. - [Release notes](https://github.com/redhat-best-practices-for-k8s/oct/releases) - [Commits](https://github.com/redhat-best-practices-for-k8s/oct/compare/v0.0.30...v0.0.31) --- updated-dependencies: - dependency-name: github.com/redhat-best-practices-for-k8s/oct dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 73489580e..c323106ed 100644 --- a/go.mod +++ b/go.mod @@ -241,7 +241,7 @@ require ( github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.5 github.com/k8snetworkplumbingwg/sriov-network-operator v1.4.0 github.com/manifoldco/promptui v0.9.0 - github.com/redhat-best-practices-for-k8s/oct v0.0.30 + github.com/redhat-best-practices-for-k8s/oct v0.0.31 github.com/redhat-best-practices-for-k8s/privileged-daemonset v1.0.44 github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20241211152839-f787b66d23c7 github.com/robert-nix/ansihtml v1.0.1 diff --git a/go.sum b/go.sum index 86fde97ac..f47a36601 100644 --- a/go.sum +++ b/go.sum @@ -472,8 +472,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/redhat-best-practices-for-k8s/certsuite-claim v1.0.52 h1:lYegIlsbTrSJcKl5ArvB4A9H7MKJutjDhRlJWhPp+vs= github.com/redhat-best-practices-for-k8s/certsuite-claim v1.0.52/go.mod h1:0ffZ5t3Kk/6mJu0DhUrl3LSGzPXdFbZATiKcbOEhNHs= -github.com/redhat-best-practices-for-k8s/oct v0.0.30 h1:XPCi2DiQXuGDB0CiBbcDWiSMcY73rlNsjZ0oJiHjqns= -github.com/redhat-best-practices-for-k8s/oct v0.0.30/go.mod h1:3/XMjlvc6uiGs5ShI4JWveN1+D3UxAgCiyH5Ib/ZZsE= +github.com/redhat-best-practices-for-k8s/oct v0.0.31 h1:9J7nIANCgaGLvA47zwKJ0YL9sLOUeWZOkrK+ZnEAdxE= +github.com/redhat-best-practices-for-k8s/oct v0.0.31/go.mod h1:3/XMjlvc6uiGs5ShI4JWveN1+D3UxAgCiyH5Ib/ZZsE= github.com/redhat-best-practices-for-k8s/privileged-daemonset v1.0.44 h1:mgD7WRZpC2xbS/5nqzRxsXeyaF04Y10OrQdFdVjf9Ek= github.com/redhat-best-practices-for-k8s/privileged-daemonset v1.0.44/go.mod h1:XVI9IK9DKYKz21XYxBcRYJMeN8Meily8meHOz1Yxcyw= github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20241211152839-f787b66d23c7 h1:zfL9KPgdJ5m0KuEUg283u2eQjJ++nm916W+dGj1cbRk= From 1983dba4f8209914241f8f298d70a0971d67918b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Jan 2025 02:45:06 +0200 Subject: [PATCH 09/14] Update RHCOS to OCP version map (#2682) Co-authored-by: sebrandon1 <4563082+sebrandon1@users.noreply.github.com> --- tests/platform/operatingsystem/files/rhcos_version_map | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/platform/operatingsystem/files/rhcos_version_map b/tests/platform/operatingsystem/files/rhcos_version_map index 0ea201d78..1ae68aa28 100644 --- a/tests/platform/operatingsystem/files/rhcos_version_map +++ b/tests/platform/operatingsystem/files/rhcos_version_map @@ -398,6 +398,7 @@ 4.15.40 / 415.92.202412022228-0 4.15.41 / 415.92.202412022228-0 4.15.42 / 415.92.202412171121-0 +4.15.43 / 415.92.202501080724-0 4.15.5 / 415.92.202403191241-0 4.15.6 / 415.92.202403270524-0 4.15.7 / 415.92.202403270524-0 @@ -441,6 +442,7 @@ 4.16.28 / 416.94.202412170927-0 4.16.29 / 416.94.202412301627-0 4.16.3 / 416.94.202407081958-0 +4.16.30 / 416.94.202501030250-0 4.16.4 / 416.94.202407171205-0 4.16.5 / 416.94.202407231922-0 4.16.6 / 416.94.202407251849-0 @@ -461,6 +463,7 @@ 4.17.1 / 417.94.202410090854-0 4.17.10 / 417.94.202412180008-0 4.17.11 / 417.94.202412250812-0 +4.17.12 / 417.94.202501071621-0 4.17.2 / 417.94.202410160352-0 4.17.3 / 417.94.202410211619-0 4.17.4 / 417.94.202411050056-0 From 0f733e028d31269c2857978fd0133f9ce603b42a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 01:19:33 +0200 Subject: [PATCH 10/14] Update RHCOS to OCP version map (#2683) Co-authored-by: sebrandon1 <4563082+sebrandon1@users.noreply.github.com> --- tests/platform/operatingsystem/files/rhcos_version_map | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/platform/operatingsystem/files/rhcos_version_map b/tests/platform/operatingsystem/files/rhcos_version_map index 1ae68aa28..68449286a 100644 --- a/tests/platform/operatingsystem/files/rhcos_version_map +++ b/tests/platform/operatingsystem/files/rhcos_version_map @@ -481,6 +481,7 @@ 4.18.0-rc.1 / 418.94.202412050001-0 4.18.0-rc.2 / 418.94.202412120450-0 4.18.0-rc.3 / 418.94.202412172234-0 +4.18.0-rc.4 / 418.94.202501072146-0 4.4.0 / 44.81.202004260825-0 4.4.0-rc.0 / 44.81.202003110830-0 4.4.0-rc.1 / 44.81.202003130330-0 From da3787d86df1cb2c08d4ab4ba1f208ba06681102 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:29:44 -0600 Subject: [PATCH 11/14] Update RHCOS to OCP version map (#2684) Co-authored-by: sebrandon1 <4563082+sebrandon1@users.noreply.github.com> --- tests/platform/operatingsystem/files/rhcos_version_map | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/platform/operatingsystem/files/rhcos_version_map b/tests/platform/operatingsystem/files/rhcos_version_map index 68449286a..8436edbd7 100644 --- a/tests/platform/operatingsystem/files/rhcos_version_map +++ b/tests/platform/operatingsystem/files/rhcos_version_map @@ -75,7 +75,6 @@ 4.10.65 / 410.84.202308011635-0 4.10.66 / 410.84.202308031410-0 4.10.67 / 410.84.202308291254-0 -4.10.7 / 410.84.202203290245-0 4.10.8 / 410.84.202203290245-0 4.10.9 / 410.84.202204050541-0 4.11.0 / 411.86.202208031059-0 @@ -716,7 +715,6 @@ 4.7.7 / 47.83.202104090345-0 4.7.8 / 47.83.202104161442-0 4.7.9 / 47.83.202104250838-0 -4.8.0 / 48.84.202107040900-0 4.8.0-fc.0 / 48.84.202104151145-0 4.8.0-fc.1 / 48.84.202104222319-0 4.8.0-fc.2 / 48.84.202104291601-0 From 8ade1f65db8facf7a865742b1ba7fbd696f2a23e Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Mon, 13 Jan 2025 08:30:40 -0600 Subject: [PATCH 12/14] Catalogsource unit testing (#2680) * Update openshift-api library * Add operator object unit tests --- go.mod | 16 +- go.sum | 24 +- pkg/autodiscover/autodiscover.go | 14 +- pkg/autodiscover/autodiscover_operators.go | 30 +- .../autodiscover_operators_test.go | 301 ++++++++++++++++++ 5 files changed, 344 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index c323106ed..557b40480 100644 --- a/go.mod +++ b/go.mod @@ -17,9 +17,9 @@ require k8s.io/client-go v0.32.0 require ( github.com/mittwald/go-helm-client v0.12.16 github.com/openshift/api v3.9.0+incompatible - github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f + github.com/openshift/client-go v0.0.0-20250106104058-89709a455e2a github.com/operator-framework/api v0.27.0 - github.com/operator-framework/operator-lifecycle-manager v0.30.0 + github.com/operator-framework/operator-lifecycle-manager v0.22.0 github.com/pkg/errors v0.9.1 // indirect helm.sh/helm/v3 v3.16.4 k8s.io/api v0.32.0 @@ -189,9 +189,9 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go4.org v0.0.0-20200104003542-c7e774b10ea0 // indirect - golang.org/x/crypto v0.31.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect - golang.org/x/net v0.33.0 // indirect + golang.org/x/net v0.34.0 // indirect golang.org/x/oauth2 v0.25.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.29.0 // indirect @@ -223,7 +223,7 @@ require ( sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect sigs.k8s.io/kustomize/api v0.18.0 // indirect sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) @@ -248,9 +248,11 @@ require ( golang.org/x/term v0.28.0 google.golang.org/api v0.216.0 k8s.io/kubectl v0.32.0 - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 + k8s.io/utils v0.0.0-20241210054802-24370beab758 ) replace github.com/redhat-openshift-ecosystem/openshift-preflight => github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20241211152839-f787b66d23c7 -replace github.com/openshift/api => github.com/openshift/api v0.0.0-20241024191314-684b2b1679ba +replace github.com/openshift/api => github.com/openshift/api v0.0.0-20250108172834-78bd56dba39b + +replace github.com/operator-framework/operator-lifecycle-manager => github.com/operator-framework/operator-lifecycle-manager v0.30.0 diff --git a/go.sum b/go.sum index f47a36601..d3aef4dce 100644 --- a/go.sum +++ b/go.sum @@ -419,10 +419,10 @@ github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQ github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/openshift/api v0.0.0-20241024191314-684b2b1679ba h1:jyeZlKhyeR9mdbQKbTl5oP5nz0vAoy1Q+xn+1PwgODE= -github.com/openshift/api v0.0.0-20241024191314-684b2b1679ba/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo= -github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f h1:FRc0bVNWprihWS0GqQWzb3dY4dkCwpOP3mDw5NwSoR4= -github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f/go.mod h1:KiZi2mJRH1TOJ3FtBDYS6YvUL30s/iIXaGSUrSa36mo= +github.com/openshift/api v0.0.0-20250108172834-78bd56dba39b h1:Nt4V9k5pyw2CiUL2L5IFlstvURf+12Z7uSzi/v30UpE= +github.com/openshift/api v0.0.0-20250108172834-78bd56dba39b/go.mod h1:Shkl4HanLwDiiBzakv+con/aMGnVE2MAGvoKp5oyYUo= +github.com/openshift/client-go v0.0.0-20250106104058-89709a455e2a h1:8lwO4lGTwHuVXsIeFoW3t7AEBROW5quMj5YjH9jF+98= +github.com/openshift/client-go v0.0.0-20250106104058-89709a455e2a/go.mod h1:34qRf2MsrJKXKAL8qxIkxZ3O5G+YhOB7foCR04H26JE= github.com/openshift/library-go v0.0.0-20231020125025-211b32f1a1f2 h1:TWG/YVRhSvjYq8iIwJ2Wpoopgg0zuh+ZAl1RSm4J8Z0= github.com/openshift/library-go v0.0.0-20231020125025-211b32f1a1f2/go.mod h1:ZFwNwC3opc/7aOvzUbU95zp33Lbxet48h80ryH3p6DY= github.com/openshift/machine-config-operator v0.0.1-0.20231024085435-7e1fb719c1ba h1:WM6K+m2xMAwbQDetKGhV/Rd8yukF3AsU1z74cqoWrz0= @@ -628,8 +628,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -647,8 +647,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -769,8 +769,8 @@ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= k8s.io/kubectl v0.32.0 h1:rpxl+ng9qeG79YA4Em9tLSfX0G8W0vfaiPVrc/WR7Xw= k8s.io/kubectl v0.32.0/go.mod h1:qIjSX+QgPQUgdy8ps6eKsYNF+YmFOAO3WygfucIqFiE= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= +k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw= modernc.org/libc v1.37.6/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= @@ -793,7 +793,7 @@ sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U= sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E= sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/autodiscover/autodiscover.go b/pkg/autodiscover/autodiscover.go index 948020fa3..17a990234 100644 --- a/pkg/autodiscover/autodiscover.go +++ b/pkg/autodiscover/autodiscover.go @@ -163,16 +163,16 @@ func DoAutoDiscover(config *configuration.TestConfiguration) DiscoveredTestData if err != nil { log.Fatal("Cannot get namespaces, err: %v", err) } - data.AllSubscriptions = findSubscriptions(oc.OlmClient, []string{""}) - data.AllCsvs, err = getAllOperators(oc.OlmClient) + data.AllSubscriptions = findSubscriptions(oc.OlmClient.OperatorsV1alpha1(), []string{""}) + data.AllCsvs, err = getAllOperators(oc.OlmClient.OperatorsV1alpha1()) if err != nil { log.Error("Cannot get operators, err: %v", err) } - data.AllInstallPlans = getAllInstallPlans(oc.OlmClient) - data.AllCatalogSources = getAllCatalogSources(oc.OlmClient) + data.AllInstallPlans = getAllInstallPlans(oc.OlmClient.OperatorsV1alpha1()) + data.AllCatalogSources = getAllCatalogSources(oc.OlmClient.OperatorsV1alpha1()) log.Info("Collected %d catalog sources during autodiscovery", len(data.AllCatalogSources)) - data.AllPackageManifests = getAllPackageManifests(oc.OlmPkgClient) + data.AllPackageManifests = getAllPackageManifests(oc.OlmPkgClient.PackageManifests("")) data.Namespaces = namespacesListToStringList(config.TargetNameSpaces) data.Pods, data.AllPods = findPodsByLabels(oc.K8sClient.CoreV1(), podsUnderTestLabelsObjects, data.Namespaces) @@ -201,8 +201,8 @@ func DoAutoDiscover(config *configuration.TestConfiguration) DiscoveredTestData data.Crds = FindTestCrdNames(data.AllCrds, config.CrdFilters) data.ScaleCrUnderTest = GetScaleCrUnderTest(data.Namespaces, data.Crds) - data.Csvs = findOperatorsByLabels(oc.OlmClient, operatorsUnderTestLabelsObjects, config.TargetNameSpaces) - data.Subscriptions = findSubscriptions(oc.OlmClient, data.Namespaces) + data.Csvs = findOperatorsByLabels(oc.OlmClient.OperatorsV1alpha1(), operatorsUnderTestLabelsObjects, config.TargetNameSpaces) + data.Subscriptions = findSubscriptions(oc.OlmClient.OperatorsV1alpha1(), data.Namespaces) data.HelmChartReleases = getHelmList(oc.RestConfig, data.Namespaces) // Get all operator pods diff --git a/pkg/autodiscover/autodiscover_operators.go b/pkg/autodiscover/autodiscover_operators.go index a55040cd8..6fd2079e9 100644 --- a/pkg/autodiscover/autodiscover_operators.go +++ b/pkg/autodiscover/autodiscover_operators.go @@ -22,7 +22,7 @@ import ( helmclient "github.com/mittwald/go-helm-client" olmv1Alpha "github.com/operator-framework/api/pkg/operators/v1alpha1" - clientOlm "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned" + "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/typed/operators/v1alpha1" "github.com/redhat-best-practices-for-k8s/certsuite/internal/log" "github.com/redhat-best-practices-for-k8s/certsuite/pkg/configuration" @@ -64,11 +64,11 @@ func isIstioServiceMeshInstalled(appClient appv1client.AppsV1Interface, allNs [] return true } -func findOperatorsMatchingAtLeastOneLabel(olmClient clientOlm.Interface, labels []labelObject, namespace configuration.Namespace) *olmv1Alpha.ClusterServiceVersionList { +func findOperatorsMatchingAtLeastOneLabel(olmClient v1alpha1.OperatorsV1alpha1Interface, labels []labelObject, namespace configuration.Namespace) *olmv1Alpha.ClusterServiceVersionList { csvList := &olmv1Alpha.ClusterServiceVersionList{} for _, l := range labels { log.Debug("Searching CSVs in namespace %q with label %q", namespace, l) - csv, err := olmClient.OperatorsV1alpha1().ClusterServiceVersions(namespace.Name).List(context.TODO(), metav1.ListOptions{ + csv, err := olmClient.ClusterServiceVersions(namespace.Name).List(context.TODO(), metav1.ListOptions{ LabelSelector: l.LabelKey + "=" + l.LabelValue, }) if err != nil { @@ -80,7 +80,7 @@ func findOperatorsMatchingAtLeastOneLabel(olmClient clientOlm.Interface, labels return csvList } -func findOperatorsByLabels(olmClient clientOlm.Interface, labels []labelObject, namespaces []configuration.Namespace) (csvs []*olmv1Alpha.ClusterServiceVersion) { +func findOperatorsByLabels(olmClient v1alpha1.OperatorsV1alpha1Interface, labels []labelObject, namespaces []configuration.Namespace) (csvs []*olmv1Alpha.ClusterServiceVersion) { const nsAnnotation = "olm.operatorNamespace" // Helper namespaces map to do quick search of the operator's controller namespace. @@ -98,7 +98,7 @@ func findOperatorsByLabels(olmClient clientOlm.Interface, labels []labelObject, // If labels are not provided in the namespace under test, they are tested by the CNF suite log.Debug("Searching CSVs in namespace %s without label", ns) var err error - csvList, err = olmClient.OperatorsV1alpha1().ClusterServiceVersions(ns.Name).List(context.TODO(), metav1.ListOptions{}) + csvList, err = olmClient.ClusterServiceVersions(ns.Name).List(context.TODO(), metav1.ListOptions{}) if err != nil { log.Error("Error when listing csvs in namespace %q , err: %v", ns, err) continue @@ -135,10 +135,10 @@ func getAllNamespaces(oc corev1client.CoreV1Interface) (allNs []string, err erro } return allNs, nil } -func getAllOperators(olmClient clientOlm.Interface) ([]*olmv1Alpha.ClusterServiceVersion, error) { +func getAllOperators(olmClient v1alpha1.OperatorsV1alpha1Interface) ([]*olmv1Alpha.ClusterServiceVersion, error) { csvs := []*olmv1Alpha.ClusterServiceVersion{} - csvList, err := olmClient.OperatorsV1alpha1().ClusterServiceVersions("").List(context.TODO(), metav1.ListOptions{}) + csvList, err := olmClient.ClusterServiceVersions("").List(context.TODO(), metav1.ListOptions{}) if err != nil { return nil, fmt.Errorf("error when listing CSVs in all namespaces, err: %v", err) } @@ -152,7 +152,7 @@ func getAllOperators(olmClient clientOlm.Interface) ([]*olmv1Alpha.ClusterServic return csvs, nil } -func findSubscriptions(olmClient clientOlm.Interface, namespaces []string) []olmv1Alpha.Subscription { +func findSubscriptions(olmClient v1alpha1.OperatorsV1alpha1Interface, namespaces []string) []olmv1Alpha.Subscription { subscriptions := []olmv1Alpha.Subscription{} for _, ns := range namespaces { displayNs := ns @@ -160,7 +160,7 @@ func findSubscriptions(olmClient clientOlm.Interface, namespaces []string) []olm displayNs = "All Namespaces" } log.Debug("Searching subscriptions in namespace %q", displayNs) - subscription, err := olmClient.OperatorsV1alpha1().Subscriptions(ns).List(context.TODO(), metav1.ListOptions{}) + subscription, err := olmClient.Subscriptions(ns).List(context.TODO(), metav1.ListOptions{}) if err != nil { log.Error("Error when listing subscriptions in namespace %q", ns) continue @@ -200,8 +200,8 @@ func getHelmList(restConfig *rest.Config, namespaces []string) map[string][]*rel } // getAllInstallPlans is a helper function to get the all the installPlans in a cluster. -func getAllInstallPlans(olmClient clientOlm.Interface) (out []*olmv1Alpha.InstallPlan) { - installPlanList, err := olmClient.OperatorsV1alpha1().InstallPlans("").List(context.TODO(), metav1.ListOptions{}) +func getAllInstallPlans(olmClient v1alpha1.OperatorsV1alpha1Interface) (out []*olmv1Alpha.InstallPlan) { + installPlanList, err := olmClient.InstallPlans("").List(context.TODO(), metav1.ListOptions{}) if err != nil { log.Error("Unable get installplans in cluster, err: %v", err) return out @@ -213,8 +213,8 @@ func getAllInstallPlans(olmClient clientOlm.Interface) (out []*olmv1Alpha.Instal } // getAllCatalogSources is a helper function to get the all the CatalogSources in a cluster. -func getAllCatalogSources(olmClient clientOlm.Interface) (out []*olmv1Alpha.CatalogSource) { - catalogSourcesList, err := olmClient.OperatorsV1alpha1().CatalogSources("").List(context.TODO(), metav1.ListOptions{}) +func getAllCatalogSources(olmClient v1alpha1.OperatorsV1alpha1Interface) (out []*olmv1Alpha.CatalogSource) { + catalogSourcesList, err := olmClient.CatalogSources("").List(context.TODO(), metav1.ListOptions{}) if err != nil { log.Error("Unable get CatalogSources in cluster, err: %v", err) return out @@ -226,8 +226,8 @@ func getAllCatalogSources(olmClient clientOlm.Interface) (out []*olmv1Alpha.Cata } // getAllPackageManifests is a helper function to get the all the PackageManifests in a cluster. -func getAllPackageManifests(olmPkgClient olmpkgclient.OperatorsV1Interface) (out []*olmpkgv1.PackageManifest) { - packageManifestsList, err := olmPkgClient.PackageManifests("").List(context.TODO(), metav1.ListOptions{}) +func getAllPackageManifests(olmPkgClient olmpkgclient.PackageManifestInterface) (out []*olmpkgv1.PackageManifest) { + packageManifestsList, err := olmPkgClient.List(context.TODO(), metav1.ListOptions{}) if err != nil { log.Error("Unable get Package Manifests in cluster, err: %v", err) return out diff --git a/pkg/autodiscover/autodiscover_operators_test.go b/pkg/autodiscover/autodiscover_operators_test.go index 2c6969e10..01bdd8459 100644 --- a/pkg/autodiscover/autodiscover_operators_test.go +++ b/pkg/autodiscover/autodiscover_operators_test.go @@ -5,11 +5,18 @@ package autodiscover import ( "testing" + "github.com/redhat-best-practices-for-k8s/certsuite/pkg/configuration" "github.com/stretchr/testify/assert" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" + + olmv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + fakeolmv1alpha1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/fake" + olmpkgv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1" + fakeolmpkgv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/clientset/versioned/fake" ) func TestGetAllNamespaces(t *testing.T) { @@ -53,3 +60,297 @@ func TestGetAllNamespaces(t *testing.T) { assert.Equal(t, tc.expectedNamespaces, namespaces) } } + +func TestGetAllCatalogSources(t *testing.T) { + generateCatalogSource := func(name string) *olmv1alpha1.CatalogSource { + return &olmv1alpha1.CatalogSource{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + } + + testCases := []struct { + testCatalogSources []string + }{ + { + testCatalogSources: []string{"cs1"}, + }, + { + testCatalogSources: []string{"cs1", "cs2"}, + }, + { + testCatalogSources: []string{}, + }, + } + + for _, tc := range testCases { + // Generate the catalog sources for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testCatalogSources { + testRuntimeObjects = append(testRuntimeObjects, generateCatalogSource(n)) + } + + client := fakeolmv1alpha1.NewSimpleClientset(testRuntimeObjects...) + catalogSources := getAllCatalogSources(client.OperatorsV1alpha1()) + assert.Equal(t, len(tc.testCatalogSources), len(catalogSources)) + for i := range catalogSources { + assert.Equal(t, tc.testCatalogSources[i], catalogSources[i].Name) + } + } +} + +func TestGetAllInstallPlans(t *testing.T) { + generateInstallPlan := func(name string) *olmv1alpha1.InstallPlan { + return &olmv1alpha1.InstallPlan{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + } + + testCases := []struct { + testInstallPlans []string + }{ + { + testInstallPlans: []string{"ip1"}, + }, + { + testInstallPlans: []string{"ip1", "ip2"}, + }, + { + testInstallPlans: []string{}, + }, + } + + for _, tc := range testCases { + // Generate the install plans for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testInstallPlans { + testRuntimeObjects = append(testRuntimeObjects, generateInstallPlan(n)) + } + + client := fakeolmv1alpha1.NewSimpleClientset(testRuntimeObjects...) + installPlans := getAllInstallPlans(client.OperatorsV1alpha1()) + assert.Equal(t, len(tc.testInstallPlans), len(installPlans)) + for i := range installPlans { + assert.Equal(t, tc.testInstallPlans[i], installPlans[i].Name) + } + } +} + +func TestGetAllPackageManifests(t *testing.T) { + generatePackageManifest := func(name string) *olmpkgv1.PackageManifest { + return &olmpkgv1.PackageManifest{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + } + + testCases := []struct { + testPackageManifests []string + }{ + {testPackageManifests: []string{"pm1"}}, + {testPackageManifests: []string{"pm1", "pm2"}}, + {testPackageManifests: []string{}}, + } + + for _, tc := range testCases { + // Generate the package manifests for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testPackageManifests { + testRuntimeObjects = append(testRuntimeObjects, generatePackageManifest(n)) + } + + client := fakeolmpkgv1.NewSimpleClientset(testRuntimeObjects...) + packageManifests := getAllPackageManifests(client.OperatorsV1().PackageManifests("")) + assert.Equal(t, len(tc.testPackageManifests), len(packageManifests)) + for i := range packageManifests { + assert.Equal(t, tc.testPackageManifests[i], packageManifests[i].Name) + } + } +} + +func TestFindSubscriptions(t *testing.T) { + generateSubscription := func(name, namespace string) *olmv1alpha1.Subscription { + return &olmv1alpha1.Subscription{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + } + } + + testCases := []struct { + testSubscriptions []string + }{ + {testSubscriptions: []string{"sub1"}}, + {testSubscriptions: []string{"sub1", "sub2"}}, + {testSubscriptions: []string{}}, + } + + for _, tc := range testCases { + // Generate the subscriptions for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testSubscriptions { + testRuntimeObjects = append(testRuntimeObjects, generateSubscription(n, "default")) + } + + client := fakeolmv1alpha1.NewSimpleClientset(testRuntimeObjects...) + subscriptions := findSubscriptions(client.OperatorsV1alpha1(), []string{""}) + assert.Equal(t, len(tc.testSubscriptions), len(subscriptions)) + for i := range subscriptions { + assert.Equal(t, tc.testSubscriptions[i], subscriptions[i].Name) + } + } +} + +func TestGetAllOperators(t *testing.T) { + generateClusterServiceVersion := func(name string) *olmv1alpha1.ClusterServiceVersion { + return &olmv1alpha1.ClusterServiceVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + } + + testCases := []struct { + testClusterServiceVersions []string + }{ + {testClusterServiceVersions: []string{"csv1"}}, + {testClusterServiceVersions: []string{"csv1", "csv2"}}, + {testClusterServiceVersions: []string{}}, + } + + for _, tc := range testCases { + // Generate the cluster service versions for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testClusterServiceVersions { + testRuntimeObjects = append(testRuntimeObjects, generateClusterServiceVersion(n)) + } + + client := fakeolmv1alpha1.NewSimpleClientset(testRuntimeObjects...) + clusterServiceVersions, err := getAllOperators(client.OperatorsV1alpha1()) + assert.Nil(t, err) + assert.Equal(t, len(tc.testClusterServiceVersions), len(clusterServiceVersions)) + for i := range clusterServiceVersions { + assert.Equal(t, tc.testClusterServiceVersions[i], clusterServiceVersions[i].Name) + } + } +} + +func TestIsIstioServiceMeshInstalled(t *testing.T) { + generateDeployment := func(name, namespace string) *appsv1.Deployment { + return &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + } + } + + testCases := []struct { + testDeployment *appsv1.Deployment + expectedResult bool + }{ + { + testDeployment: generateDeployment("istiod", "istio-system"), + expectedResult: true, + }, + { + testDeployment: generateDeployment("istiod", "default"), + expectedResult: false, + }, + } + + for _, tc := range testCases { + // Generate the deployment for the test + clientSet := fake.NewSimpleClientset(tc.testDeployment) + result := isIstioServiceMeshInstalled(clientSet.AppsV1(), []string{"istio-system"}) + assert.Equal(t, tc.expectedResult, result) + } + + result := isIstioServiceMeshInstalled(nil, []string{"not-istio-system"}) + assert.False(t, result) +} + +func TestFindOperatorsMatchingAtLeastOneLabel(t *testing.T) { + generateClusterServiceVersion := func(name, namespace string) *olmv1alpha1.ClusterServiceVersion { + return &olmv1alpha1.ClusterServiceVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + Labels: map[string]string{ + "key": "value", + }, + }, + } + } + + testCases := []struct { + testClusterServiceVersions []string + }{ + {testClusterServiceVersions: []string{"csv1"}}, + {testClusterServiceVersions: []string{"csv1", "csv2"}}, + {testClusterServiceVersions: []string{}}, + } + + for _, tc := range testCases { + // Generate the cluster service versions for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testClusterServiceVersions { + testRuntimeObjects = append(testRuntimeObjects, generateClusterServiceVersion(n, "default")) + } + + client := fakeolmv1alpha1.NewSimpleClientset(testRuntimeObjects...) + labels := []labelObject{{LabelKey: "key", LabelValue: "value"}} + clusterServiceVersions := findOperatorsMatchingAtLeastOneLabel(client.OperatorsV1alpha1(), labels, configuration.Namespace{Name: "default"}) + assert.Equal(t, len(tc.testClusterServiceVersions), len(clusterServiceVersions.Items)) + for i := range clusterServiceVersions.Items { + assert.Equal(t, tc.testClusterServiceVersions[i], clusterServiceVersions.Items[i].Name) + } + } +} + +func TestFindOperatorsByLabels(t *testing.T) { + generateClusterServiceVersion := func(name, namespace string) *olmv1alpha1.ClusterServiceVersion { + return &olmv1alpha1.ClusterServiceVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: namespace, + Annotations: map[string]string{ + "olm.operatorNamespace": "default", + }, + Labels: map[string]string{ + "key": "value", + }, + }, + } + } + + testCases := []struct { + testClusterServiceVersions []string + }{ + {testClusterServiceVersions: []string{"csv1"}}, + {testClusterServiceVersions: []string{"csv1", "csv2"}}, + {testClusterServiceVersions: []string{}}, + } + + for _, tc := range testCases { + // Generate the cluster service versions for the test + var testRuntimeObjects []runtime.Object + for _, n := range tc.testClusterServiceVersions { + testRuntimeObjects = append(testRuntimeObjects, generateClusterServiceVersion(n, "default")) + } + + client := fakeolmv1alpha1.NewSimpleClientset(testRuntimeObjects...) + labels := []labelObject{{LabelKey: "key", LabelValue: "value"}} + namespaces := []configuration.Namespace{{Name: "default"}} + clusterServiceVersions := findOperatorsByLabels(client.OperatorsV1alpha1(), labels, namespaces) + assert.Equal(t, len(tc.testClusterServiceVersions), len(clusterServiceVersions)) + for i := range clusterServiceVersions { + assert.Equal(t, tc.testClusterServiceVersions[i], clusterServiceVersions[i].Name) + } + } +} From ab9bf6356778f3b6057a5bc54c6b719d661d297e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:38:18 -0600 Subject: [PATCH 13/14] Bump ubi9/python-39 in /.github/actions/documentation (#2686) Bumps ubi9/python-39 from `9c3fbaa` to `36ae153`. --- updated-dependencies: - dependency-name: ubi9/python-39 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/actions/documentation/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/documentation/Dockerfile b/.github/actions/documentation/Dockerfile index 34a47b2ee..93dc7c0d1 100644 --- a/.github/actions/documentation/Dockerfile +++ b/.github/actions/documentation/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/python-39:9.5@sha256:9c3fbaa5af85700cd2a1c298332d8c7edbf7cca02f02b3977bf67752f141044b +FROM registry.access.redhat.com/ubi9/python-39:9.5@sha256:36ae15329ade62cc7082d44db67f94494bf3836edb8b7cf733f7519168a6e9de # Pin versions in pip. # hadolint ignore=DL3013 From 6862c9458ee2b744513a99c75a0a7d26ad4d5c20 Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Mon, 13 Jan 2025 12:38:34 -0600 Subject: [PATCH 14/14] Add compliant object for listening port test (#2685) --- tests/networking/suite.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/networking/suite.go b/tests/networking/suite.go index 260561e90..6f61cd94d 100644 --- a/tests/networking/suite.go +++ b/tests/networking/suite.go @@ -219,6 +219,8 @@ func testUndeclaredContainerPortsUsage(check *checksdb.Check, env *provider.Test } if len(listeningPorts) == 0 { check.LogInfo("None of the containers of %q have any listening port.", put) + compliantObjects = append(compliantObjects, + testhelper.NewPodReportObject(put.Namespace, put.Name, "None of the containers have any listening ports", true)) continue }