OCPBUGS-78211,OCPBUGS-78455: Synchronize From Upstream Repositories#682
OCPBUGS-78211,OCPBUGS-78455: Synchronize From Upstream Repositories#682tmshort wants to merge 87 commits intoopenshift:mainfrom
Conversation
Change GetDeploymentConfig() to return (*DeploymentConfig, error) instead of map[string]any, eliminating the intermediate convertToDeploymentConfig() function in provider.go. The caller was immediately converting the map to a DeploymentConfig anyway, so this simplifies the API and removes unnecessary indirection. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…after upgrade (#2578)
Bumps [marocchino/sticky-pull-request-comment](https://github.com/marocchino/sticky-pull-request-comment) from 2 to 3. - [Release notes](https://github.com/marocchino/sticky-pull-request-comment/releases) - [Commits](marocchino/sticky-pull-request-comment@v2...v3) --- updated-dependencies: - dependency-name: marocchino/sticky-pull-request-comment dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Externalize CER phase objects into Secret refs Add support for storing ClusterExtensionRevision phase objects in content-addressable immutable Secrets instead of inline in the CER spec. This removes the etcd object size limit as a constraint on bundle size. API changes: - Add ObjectSourceRef type with name, namespace, and key fields - Make ClusterExtensionRevisionObject.Object optional (omitzero) - Add optional Ref field with XValidation ensuring exactly one is set - Add RefResolutionFailed condition reason - Add RevisionNameKey label for ref Secret association Applier (boxcutter.go): - Add SecretPacker to bin-pack serialized objects into Secrets with gzip compression for objects exceeding 800KiB - Add createExternalizedRevision with crash-safe three-step sequence: create Secrets, create CER with refs, patch ownerReferences - Externalize desiredRevision before SSA comparison so the patch compares refs-vs-refs instead of inline-vs-refs - Add ensureSecretOwnerReferences for crash recovery - Pass SystemNamespace to Boxcutter from main.go CER controller: - Add resolveObjectRef to fetch and decompress objects from Secrets - Handle ref resolution in buildBoxcutterPhases - Add RBAC for Secret get/list/watch E2e tests: - Add scenario verifying refs, immutability, labels, and ownerRefs - Add step definitions for ref Secret validation - Fix listExtensionRevisionResources and ClusterExtensionRevisionObjectsNotFoundOrNotOwned to resolve refs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Address PR #2595 review feedback - Fix duplicate key size inflation in SecretPacker by only incrementing size for new content hash keys - Add io.LimitReader (10 MiB cap) for gzip decompression to prevent gzip bombs in controller and e2e helpers - Add doc comment clarifying ObjectSourceRef.Namespace defaults to OLM system namespace during ref resolution - Fix docs: orphan cleanup uses ownerReference GC, ref resolution failures are retried (not terminal) - Remove unused ClusterExtensionRevisionReasonRefResolutionFailed constant - Add default error branch in e2e listExtensionRevisionResources for objects missing both ref and inline content Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Change gzipThreshold from 800 KiB to 900 KiB Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Adds a new large-crd-operator test bundle containing a ~1MB CRD to verify that the Boxcutter runtime correctly handles large bundle installations. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
… (#2589) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: dtfranz <dfranz@redhat.com> UPSTREAM: <carry>: Update generate-manifests to handle new directory The `default` directory was renamed `base`. Signed-off-by: Todd Short <todd.short@me.com> The `base` directory was moved to `base\operator-controller`. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Drop commitchecker Signed-off-by: Alexander Greene <greene.al1991@gmail.com> UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART Reconciling with https://github.com/openshift/ocp-build-data/tree/4022cd290f00a44d667dda03f2d78d84a488c7ed/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: update owners * Remove alumni from owners * Add m1kola to approvers Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com> UPSTREAM: <carry>: Add pointer to tooling README UPSTREAM: <carry>: Disable Validating Admission Policy APIs downstream Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com> UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART for 4.16 Reconciling with https://github.com/openshift/ocp-build-data/tree/6250d54c4686a708ca5985afb73080e8ca9a1f7f/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: Enable Validating Admission Policy APIs downstream * This reverts commit 3f079c4. * Includes Validating Admission Policy manifests Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com> UPSTREAM: <carry>: manifests: set required-scc for openshift workloads UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART for 4.17 Reconciling with https://github.com/openshift/ocp-build-data/tree/4c1326094222f9209876f06833179a1b9178faf7/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: add everettraven to approvers+reviewers Signed-off-by: everettraven <everettraven@gmail.com> UPSTREAM: <carry>: add openshift kustomize overlay to enable TLS communication with catalogd. Configure the CA certs using the configmap injection method via service-ca-operator Signed-off-by: everettraven <everettraven@gmail.com> UPSTREAM: <carry>: Add tmshort to approvers Also `s/runtime/framework/g` in the DOWNSTREAM_OWNERS Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART for 4.18 Reconciling with https://github.com/openshift/ocp-build-data/tree/dd68246f3237db5db458127566fc7b05b55e1660/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: Properly copy and call kustomize Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: manifests: add hostPath mount for /etc/containers Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Add test-e2e target for downstream Makefile to be run by openshift/release. Signed-off-by: dtfranz <dfranz@redhat.com> UPSTREAM: <carry>: Add downstream verify makefile target Signed-off-by: dtfranz <dfranz@redhat.com> UPSTREAM: <carry>: openshift: template log verbosity to be managed by cluster-olm-operator Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Add global-pull-secret flag Pass global-pull-secret to the manager container. Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com> UPSTREAM: <carry>: Update openshift CAs to operator-controller The /run/secrets/kubernetes.io/serviceaccount/ directory is projected into the pod and contains the following CA certificates: * configmap/kube-root-ca.crt as ca.crt * configmap/openshift-service-ca.crt as service-ca.crt Update the --ca-certs-dir argument to reference the directory. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Add HowTo for origin tests Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Add e2e registry Dockerfile Signed-off-by: dtfranz <dfranz@redhat.com> UPSTREAM: <carry>: add nodeSelector and tolerations to operator-controller deployment via kustomize patch Signed-off-by: everettraven <everettraven@gmail.com> UPSTREAM: <carry>: namespace: use privileged PSA for audit and warn levels Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Enable downstream e2e Signed-off-by: dtfranz <dfranz@redhat.com> UPSTREAM: <carry>: Remove m1kola from owners Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com> UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART for 4.19 Reconciling with https://github.com/openshift/ocp-build-data/tree/a39508c86497b4e5e463d7b2c78e51e577be9e7d/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: generate and mount service-ca server cert Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Add support for proxy trustedCAs Just map the list of trusted ca certs into the deployment Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Fix error to build the image Copy correct (new) executable name for operator-controller Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Fix make verify for mac os envs Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Move operator-controller openshift files to its own dir UPSTREAM: <carry>: Upgrade OCP images from 4.18 to 4.19 UPSTREAM: <carry>: Add Openshift's catalogd manifests - Move to openshift/catalogd the specific manifest under: https://github.com/openshift/operator-framework-catalogd/tree/main/openshift - Add call to generate catalogd manifest to 'make manifest'. Make verify test is now done for catalogd and operator-controller Openshift's manifests UPSTREAM: <carry>: resolve issue with pre-mature mounting of trusted CA configmap Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Add /etc/docker to the operator-controller and catalogd deployments This allows for use of the any image.config.openshift.io trusted CAs Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: fixup catalogd.Dockerfile paths Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Resolve issue with pre-mature mounting of service CA configmap Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: use projected volume for CAs to avoid subPath limitations Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Revert "UPSTREAM: <carry>: use projected volume for CAs to avoid subPath limitations" This reverts commit 548caa4. UPSTREAM: <carry>: use projected volume for CAs to avoid subPath limitations Signed-off-by: Joe Lanford <joe.lanford@gmail.com> UPSTREAM: <carry>: Remove vet from openshift verify The `vet` target was removed upstream. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Skip another upstream test Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Cleanup openshift/Makefile by removing no longer required comments regards catalogd e2e tests UPSTREAM: <carry>: Enable OCP metrics collection by default Enables OCP to collect Prometheus metrics for both catalogd and operator-controller by default. This is accomplished via ServiceMonitor CRs which are now created for both projects. UPSTREAM: <carry>: Fix catalogd.Dockerfile to use new paths The root catalogd directory has been removed Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Update DOWNSTREAM_OWNERS_ALIASES Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Add openshift node selector annotation Signed-off-by: Catherine Chan-Tse <cchantse@redhat.com> (cherry picked from commit 9b4a113) UPSTREAM: <carry>: Add caalogd-cas-dir option to op-con Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: set the SElinux type Signed-off-by: Jian Zhang <jiazha@redhat.com> UPSTREAM: <carry>: Add initial stack to run tests to validate the catalogs UPSTREAM: <carry>: Add vendor files for the catalog-sync tests UPSTREAM: <carry>: Bump catalog versions to 4.19 Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: revert "Bump catalog versions to 4.19" This reverts commit a98980b. UPSTREAM: <carry>: Update HOWTO-origin-tests techpreview is no longer a required option. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [DefaultCatalogTests]: Allow to pass auth path for docker credentials" UPSTREAM: <carry>: fix: set NoLchown=true to allow image unpack on OCPci UPSTREAM: <carry>: [DefaultCatalogTests]: Moving parse of ENVVAR to the caller (follow-up 345) UPSTREAM: <carry>: [Default Catalog]: Create tmp dir to extract layers with right permissions to avoid issues scenarios UPSTREAM: <carry>: [Default Catalog](cleanp) Remove hack directory which is not used UPSTREAM: <carry>: Change code implementation to extract layers in OCP env UPSTREAM: <carry>: Add vendor files for change in the extract code implementation UPSTREAM: <carry>: [Default Catalog Tests]: Final cleanups and enhancements of initial implementation UPSTREAM: <carry>: SELinux type for operator-controller Signed-off-by: Jian Zhang <jiazha@redhat.com> UPSTREAM: <carry>: Bump catalog versions to 4.19 Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add check for executable files in filesystem Checks if given paths exist and point to executable files or valid symlinks. UPSTREAM: <carry>: [Default Catalog Consistency Test]: fix junit output format to allow generate xml UPSTREAM: <carry>: [Default Catalog Consistency Test] (feat) add check to validate multi-arch support UPSTREAM: <carry>: [Default Catalog Consistency Test]: Enable CatalogChecks UPSTREAM: <carry>: [Default Catalog Consistency Test]: Rename Tests suite and small cleanups UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART for 4.20 Reconciling with https://github.com/openshift/ocp-build-data/tree/dfb5c7d531490cfdc61a3b88bc533702b9624997/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: Updating ose-olm-catalogd-container image to be consistent with ART for 4.20 Reconciling with https://github.com/openshift/ocp-build-data/tree/dfb5c7d531490cfdc61a3b88bc533702b9624997/images/ose-olm-catalogd.yml UPSTREAM: <carry>: Update e2e registry to use 1.24/4.20 Update the e2e registry Dockerfile to use golang 1.24/OCP 4.20 Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [Catalog Default Tests]: Upgrade go version to 1.24.3, dependencies and fix new lint issue UPSTREAM: <carry>: Add structure to allow move the orgin tests using OTE This commit introduces a binary and supporting structure to enable the execution of OpenShift origin (olmv1) tests using the Open Test Environment (OTE). It lays the groundwork for moving origin test in openshift/origin to be executed from this repository using OTE. UPSTREAM: <carry>: Add support for experimental manifests Update the openshift kustomize configuration for both operator-controller and catalogd. Update the manifest generation scripts to put the core generation code into a function (ignore-whitespace will help with the review), so that it can be called twice; once for standard, and once for experimental. Move around some of the kustomization directives to * Create a patch kustomization (Component) file and move the patch directives from olmv1-ns there. This allows it to be referenced from a different directory. * Add a kustomization file for tusted-ca. This allows it to be referenced from a different directory. * Move the setting of the namePrefix for operator-controller; this makes the generation compatible with upstream feature components. * Define experimental kustomization files that reference existing components. * Reference the correct CRDs (standard or experimental). * Add references to upstream feature components into the experimental manifests. This *will* add `--feature-gates` options from the upstream feature components to the experimental manifests. The cluster-olm-operator will strip those arguments from the deployments before adding the enabled feature gates. Update the Dockerfiles to include the experimental manifests and a copy script (`cp-manifests`) into the image containers. The complexity of having multiple sets of manifests mean that the simple initContainer copy mechanism found in cluster-olm-operator is no longer sufficient. This attempts to keep backwards compatibility with older versions of cluster-olm-operator, specifically by keeping the original (standard) manifests in the original location, and adding the experimental manifests in a new directory. The new `cp-manifests` script is used by newer versions of cluster-olm-operator. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [OTE] - chore: follow up openshift#383 – remove unreachable target call UPSTREAM: <carry>: Remove build of test image registry Upstream now uses a different image Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Add test-experimental-e2e target to openshift Makefile This adds a test-experimental-e2e target to allow the CI to run the experimental e2e test. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [OTE]: Add binary in the operator controller image to allow proper integration with OCP tests UPSTREAM: <carry>: Fix experimental manifest copying The standard manifest was being copied rather than the experimental manifest. This meant that the expected feature-flags are not present. This is failing now that we are doing a check for those feature-flags. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Update manifest generation for upstream rbac/webhooks Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [OTE] - Add tracking mechanism UPSTREAM: <carry>: Update OTE dep to get fix UPSTREAM: <carry>: [OTE] Add Readme UPSTREAM: <carry>: set GIT_COMMIT env from SOURCE_GIT_COMMIT in Dockerfiles for operator-controller and catalogd Signed-off-by: Rashmi Gottipati <chowdary.grashmi@gmail.com> UPSTREAM: <carry>: add openshift specific build target to pass commit info downstream Signed-off-by: Ankita Thomas <ankithom@redhat.com> UPSTREAM: <carry>: add source commit into binaries when linking - Removes extra GIT_COMMIT set - fixup Dockerfiles after rebase - consider "" unset so build-info can fill commit/date - double quote go flags & honor GIT_COMMIT if set - improve robustness of build-info parsing - Trim whitespace on all version fields - isUnset and valueOrUnknown now call strings.TrimSpace - Avoid clobbering values injected via ldflags - set repoState from build-info only when repoState is still unset - set version from build-info only when unset and build-info value is non-empty UPSTREAM: <carry>: OTE add first test from openshift/origin olmv1.go UPSTREAM: <carry>: Migrate tasks from openshift/origin olm v1.go file which are remaining This commit moves the final OLMv1 tests from openshift/origin/test/extended/olm/olmv1.go to their proper location in this repository. This migration is part of a larger effort to streamline development by co-locating tests with the component they validate. This will reduce CI overhead and allow for faster, more atomic changes. Assisted-by: Gemini UPSTREAM: <carry>: OTE - How to test locally with OCP instances UPSTREAM: <carry>: [OTE] Refac: refac helper and olmv1 test to create namespace instead to use pre-existent UPSTREAM: <carry>: [OTE] add webhook tests Migrates OLMv1 webhook operator tests from using external YAML files to defining resources in Go structs. This change removes file dependencies, improving test reliability and simplifying test setup. The migration is a refactoring of code from openshift/origin#30059. The new code uses better naming conventions and adapts the tests to work with a controller-runtime client, enhancing test consistency and maintainability. The migration covers all core test scenarios: - Validating, mutating, and conversion webhooks. - Certificate and secret rotation tolerance. Assisted-by: Gemini UPSTREAM: <carry>: OTE: rewrite the upgrade incompatible operator test This test replaces the existing upgrade incompatible test. The main change is that operator and catalog bundles are created on-the-fly to support OCP 4.20. This means we are no longer dependent on public operators for this test. This creates new bundles in the OCP ImageRegistry, this requires using a number of OCP APIs, including using a raw API URL to invoke the build. This is done by invoking an external k8s client (either `oc` or `kubectl`), and passing it a tarball of the bundle to be created. So, it can't be done by the golang k8sClient normally available (i.e. the create input is a tarball not a YAML file). This introduces the use of go-bindata to store the bundle contents. It also pulls in openshift mage, buld and operator APIs. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Handle service-ca cert availability/rotation There is problem when the service-ca certificate is not available at pod start. This is an issue because the SystemCertPool is created from SSL_CERT_DIR, which may include the empty service-ca. The SystemCertPool is never regenerated during the lifetime of the program execution, so it will never get updated when the service-ca is filled. Thus, we need to use --pull-cas-dir to reference the CAs that we want to use. This will also allow OLMv1 to reload the service-ca when it is reloaded (after 2 years, mind you). Removing the SSL_CERT_DIR setting, and adding the --pull-cas-dir flag ought to be equivalent to what we have now (i.e. SSL_CERT_DIR and no --pull-cas-dir), except that rotation will be handled better. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [OTE] add webhook tests Revert "UPSTREAM: <carry>: [OTE] add webhook tests" This reverts commit 9963614. UPSTREAM: <carry>: Upgrade OCP Catalog images from 4.19 to 4.20 UPSTREAM: <carry>: Remove bindata generation from build Using go-bindata is causing problems with ART builds. This removes the use of go-bindata from the builds. This will subsequently require that users MANUALLY run the `bindata` target to refresh the bindata, or use the `build-update` target. This is a quickfix to put out the fire. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: [OTE] Add webhook tests - Add dumping of container logs and `kubectl describe pods` output for better diagnostics. - Include targeted certificate details dump (`tls.crt` parse) when failures occur. - Add additional check to verify webhook responsiveness after certificate rotation. This change is a refactor of code from openshift/origin#30059. Assisted-by: Gemini UPSTREAM: <carry>: OTE add logs and dumps for olmv1 test and fix helper for clusterextensions UPSTREAM: <carry>: [OTE] Migrate preflight checks from openshift/origin Migrated OLMv1 operator preflight checks from using external YAML files to defining ClusterRole permissions directly in Go structs. This improves test reliability and simplifies test setup by removing file dependencies. The changes ensure precise replication of original test scenarios, including specific permission omissions for services, create verbs, ClusterRoleBindings, ConfigMap resourceNames, and escalate/bind verbs. Assisted-by: Gemini UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation This change is a refactor of code from openshift/origin#30059. Assisted-by: Gemini UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present. UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests UPSTREAM: <carry>: remove obsolete owners Signed-off-by: grokspawn <jordan@nimblewidget.com> UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin This commit migrates the olmv1_catalog set of tests from openshift/origin to OTE as part the broad effort to migrate all tests. Assisted-by: Gemini UPSTREAM: <carry>: Migrate single/own namespace tests This commit migrates the OLMv1 single and own namespace watch mode tests from openshift/origin/test/extended/olm/olmv1-singleownnamespace.go to this repository. This is part of the effort to move component-specific tests into their respective downstream locations. Assisted-by: Gemini UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present. This reverts commit 0bb1953. UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation This reverts commit e9e3220. UPSTREAM: <carry>: Ensure unique name for bad-catalog tests UPSTREAM: <carry>: Revert "Handle service-ca cert availability/rotation" This reverts commit 9cc13d8. UPSTREAM: <carry>: grant QE approver permission for OTE UPSTREAM: <carry>: Update webhook ote tests to use latest webhook-operator Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com> UPSTREAM: <carry>: update operator-controller to v1.5.1 UPSTREAM: <carry>: configure watchnamespace using spec.config for OTE tests UPSTREAM: <carry>: add jiazha to approvers UPSTREAM: <carry>: Create combined manifests for comparison Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Use Helm charts for openshift manifests Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: add support for tests-private cases and add the case UPSTREAM: <carry>: Fix cp-manifests copying of helm charts The method used to copy the helm charts is including an extra `helm` directory in the destination path, that is making the cluster-olm-operator code just a bit more complicated than it needs to be. This fixes the copy location. Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Remove kustomize manifests from images and repo Now that helm manifests are being used to dynamically generate the manifests, the pre-generated manifests are no longer needed. So, we can remove them from the repo and the images. However, because we still want to verify the manifests are "good", we are still creating a "single-file" version of the manifests for verification purposes, and to allow us to see what changes are happening to the manifests (from upstream and/or downstream sources). Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Add pedjak and trgeiger as reviewers UPSTREAM: <carry>: migrate more cases from tests-private and enhance suites with filters UPSTREAM: <carry>: Updating ose-olm-operator-controller-container image to be consistent with ART for 4.21 Reconciling with https://github.com/openshift/ocp-build-data/tree/4fbe3fab45239dc4be6f5d9d98a0bf36e0274ec9/images/ose-olm-operator-controller.yml UPSTREAM: <carry>: Updating ose-olm-catalogd-container image to be consistent with ART for 4.21 Reconciling with https://github.com/openshift/ocp-build-data/tree/4fbe3fab45239dc4be6f5d9d98a0bf36e0274ec9/images/ose-olm-catalogd.yml UPSTREAM: <carry>: OTE: Enable disconnected environment and build test operator controller image Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com> UPSTREAM: <carry>: for incompatible test add func to wait builder and deployer SA creation by OCP controller UPSTREAM: <carry>: Fix VERSION replacement in catalog bindata Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: check kubeconfig only run-test and run-suite UPSTREAM: <carry>: Clean up cp-manifests There is no longer a need to copy conditionally Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: Update does-not-exist and simple install to work in a disconnected environment Signed-off-by: Todd Short <todd.short@me.com> UPSTREAM: <carry>: support webhook case in disconnected UPSTREAM: <carry>: Consolidate build API This consolidates the in-cluster building of a bundle and catalog. The catalog and bundle bindata are inputs, along with a set of replacements so that catalog and bundle templates can be used to create the images. This can be done in the BeforeEach() for a set of tests that use the same data. Signed-off-by: Todd Short <todd.short@me.com>
…images from openshift/catalogd/manifests.yaml
Signed-off-by: Todd Short <todd.short@me.com>
…oss to avoid flakes
Signed-off-by: Todd Short <todd.short@me.com>
…uess and waiting for k8s cleanups Co-Author: kuiwang@redhat.com
…nts ( Follow-Up of: 714977c )
… uninstall Assisted-by: Cursor
… format Fix k8s.io/kubernetes replace version from v1.30.1-0... to v0.0.0-... format to resolve bumper tool verification failures. Add hack/ocp-replace.sh script to manage OCP fork replaces properly. Assisted-by: Cursor
…row job for migrated qe cases
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The current pod simply does a `sleep 1000`, which means that the startup, liveness and readiness probes all fail. Use a busybox containter to run a simple script and httpd server to emulate the probes.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
/label qe-approved |
|
@bandrade: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (2)
test/e2e/features/install.feature (1)
597-624: Use a dedicated service account to isolate this preflight permission test from the background bindings.The background step (line 9) grants
olm-safull RBAC permissions includingcreate. When this scenario applies the same service account withkubectl applyusing the no-create template, Kubernetes merges the rules additively rather than replacing them. Since both the background and scenario steps create bindings with identical names (based on${SERVICEACCOUNT_NAME}), thecreatepermissions from the background persist, making the test unable to properly validate the missing-permission path.Using a dedicated service account name (e.g.,
preflight-sa) ensures clean isolation.Suggested change
- Given ServiceAccount "olm-sa" without create permissions is available in ${TEST_NAMESPACE} + Given ServiceAccount "preflight-sa" without create permissions is available in ${TEST_NAMESPACE} And ClusterExtension is applied """ apiVersion: olm.operatorframework.io/v1 kind: ClusterExtension metadata: name: ${NAME} spec: namespace: ${TEST_NAMESPACE} serviceAccount: - name: olm-sa + name: preflight-sa source: sourceType: Catalog catalog: packageName: test selector: matchLabels: "olm.operatorframework.io/metadata.name": test-catalog """ And ClusterExtension reports Progressing as True with Reason Retrying and Message includes: """ pre-authorization failed: service account requires the following permissions to manage cluster extension """ And ClusterExtension reports Progressing as True with Reason Retrying and Message includes: """ Verbs:[create] """ - When ServiceAccount "olm-sa" with needed permissions is available in ${TEST_NAMESPACE} + When ServiceAccount "preflight-sa" with needed permissions is available in ${TEST_NAMESPACE}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/e2e/features/install.feature` around lines 597 - 624, The scenario uses the same ServiceAccount name "olm-sa" as the background steps, causing RBAC rules to merge and preserve create permissions; change the scenario to use a dedicated service account (e.g., "preflight-sa") by updating the ClusterExtension spec.serviceAccount.name and the Given/When ServiceAccount steps that refer to ${SERVICEACCOUNT_NAME} or "olm-sa" to the new name so the preflight permission test is isolated from background bindings.internal/operator-controller/applier/secretpacker.go (1)
20-29: Consider loweringgzipThresholdto benefit from compression earlier.Both
gzipThresholdandmaxSecretDataSizeare set to 900 KiB. This means compression only activates for objects that are already at the size limit. Since the design doc notes Kubernetes manifests typically achieve 5-10x compression, a lower threshold (e.g., 100 KiB) could reduce Secret storage and potentially fit more objects per Secret.However, if the intent is to minimize CPU overhead by only compressing when necessary to fit within limits, the current design is valid.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/operator-controller/applier/secretpacker.go` around lines 20 - 29, The gzipThreshold constant is set equal to maxSecretDataSize which delays compression until objects are already near Secret size limits; change gzipThreshold in secretpacker.go to a lower value (e.g., 100 * 1024) to enable compression earlier (and update its comment accordingly), or make gzipThreshold configurable if you prefer runtime control; update references to gzipThreshold in the packing logic so they use the new value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@helm/olmv1/templates/crds/customresourcedefinition-clusterobjectsets.olm.operatorframework.io.yml`:
- Line 3: Fix the typo in the commented tpl call: change the filename referenced
in the comment from "clusterobjectsetss.yaml" to "clusterobjectsets.yaml" so the
commented line tpl (.Files.Get
"base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsets.yaml")
. matches the actual file name used elsewhere.
In `@internal/operator-controller/applier/secretpacker_test.go`:
- Around line 3-18: The tests in secretpacker_test.go create a gzip.Reader but
only validate headers; fix each test (including the second case around lines
143-171) to fully read the gzip payload to EOF and surface
truncation/corruption: after calling gzip.NewReader, read the entire
decompressed stream (e.g., io.ReadAll or io.Copy to a buffer) and verify the
read result and error, then call Close() and check its error as well so any
truncated or corrupt gzip data fails the test; update the assertions around the
gzip handling in the relevant test helper or test functions to expect errors
when reading/closing fails.
In
`@internal/operator-controller/controllers/clusterobjectset_controller_test.go`:
- Around line 1097-1098: The test fixture name used at creation should include
an explicit numeric suffix so controllers.ExtractRevisionNumber(t, revisionName)
yields the expected Spec.Revision; update the fixture name currently "test-rev"
to "test-rev-1" (or another name ending with the desired numeric revision) so
Spec.Revision reflects that value when the test uses
controllers.ExtractRevisionNumber and subsequent assertions rely on
Spec.Revision.
In `@internal/operator-controller/controllers/clusterobjectset_controller.go`:
- Around line 539-543: The lookup in resolveObjectRef uses
ObjectSourceRef.Namespace verbatim so refs that omit namespace fail; before
calling c.Client.Get, fallback when ref.Namespace is empty by setting it to the
operator/OLM system namespace (use the reconciler's SystemNamespace field or
equivalent on the ClusterObjectSetReconciler) so the Secret lookup uses that
default namespace; update the mirrored E2E resolver the same way to keep
behavior consistent (ensure you reference ObjectSourceRef.Namespace,
resolveObjectRef, and the c.Client.Get call when making the change).
In `@internal/operator-controller/controllers/resolve_ref_test.go`:
- Around line 71-86: The tests currently only ensure reconciler.Reconcile
returns no error but don't verify that ref resolution altered the revision
payload; update the mockRevisionEngine.reconcile closure to capture the incoming
machinerytypes.Revision parameter (e.g., store it in a local variable accessible
to the test) and after calling controllers.ClusterObjectSetReconciler.Reconcile
assert that the captured Revision contains the expanded ConfigMap payload
(validate the expected key/value for plain JSON case and decompress+validate for
the gzip case). Apply the same change to the other test case that uses
mockRevisionEngine (the block referenced around lines 132-147) so both plain
JSON and gzip paths assert the resolved revision payload instead of only
checking for nil error.
In `@test/e2e/features/install.feature`:
- Line 528: The step "And ClusterObjectSet \"${NAME}-1\" ref Secrets exist in
\"olmv1-system\" namespace" hard-codes the Boxcutter Secret namespace; change it
to determine the active controller/installation namespace dynamically (e.g., use
the test feature variable that holds the installation namespace or an env var
like INSTALL_NAMESPACE/OPERATOR_NAMESPACE) and replace the literal
"olmv1-system" with that variable, or derive the namespace from the deployed
ClusterObjectSet/ClusterOperator resource before asserting; update the step to
reference the variable instead of the hard-coded string so the check works for
both "olmv1-system" and "openshift-operator-controller".
In `@test/e2e/steps/steps.go`:
- Around line 820-835: The test currently skips owner-label checks when the
ClusterObjectSet's label olm.operatorframework.io/owner-name is missing; update
the logic after retrieving cosObj (in the getResource/cosObj block) to fail fast
if that label is absent or empty by returning an error indicating the
ClusterObjectSet is missing the owner label (so expectedOwner must be non-empty
before iterating secrets), rather than silently skipping secret owner
assertions; reference cosObj.GetLabels(), expectedOwner, and the secrets loop
when making this change.
In
`@testdata/images/bundles/large-crd-operator/v1.0.0/manifests/largecrdoperator.clusterserviceversion.yaml`:
- Around line 57-92: The serviceAccountName is incorrectly nested inside the
container block (under the container named busybox-httpd-container); move the
serviceAccountName field out of the container and place it at the PodSpec level
(same indentation as terminationGracePeriodSeconds, volumes, and containers) so
the PodSpec includes serviceAccountName: simple-bundle-manager and the container
block no longer contains that field.
---
Nitpick comments:
In `@internal/operator-controller/applier/secretpacker.go`:
- Around line 20-29: The gzipThreshold constant is set equal to
maxSecretDataSize which delays compression until objects are already near Secret
size limits; change gzipThreshold in secretpacker.go to a lower value (e.g., 100
* 1024) to enable compression earlier (and update its comment accordingly), or
make gzipThreshold configurable if you prefer runtime control; update references
to gzipThreshold in the packing logic so they use the new value.
In `@test/e2e/features/install.feature`:
- Around line 597-624: The scenario uses the same ServiceAccount name "olm-sa"
as the background steps, causing RBAC rules to merge and preserve create
permissions; change the scenario to use a dedicated service account (e.g.,
"preflight-sa") by updating the ClusterExtension spec.serviceAccount.name and
the Given/When ServiceAccount steps that refer to ${SERVICEACCOUNT_NAME} or
"olm-sa" to the new name so the preflight permission test is isolated from
background bindings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ceb0ed5d-7b56-4ec3-822a-c35189001c7d
⛔ Files ignored due to path filters (3)
openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.gois excluded by!**/vendor/**openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterobjectset_types.gois excluded by!**/vendor/**openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/zz_generated.deepcopy.gois excluded by!**/vendor/**
📒 Files selected for processing (72)
.claude/commands/list-e2e-steps.mdAGENTS.mdapi/v1/clusterextension_types.goapi/v1/clusterextensionrevision_types_test.goapi/v1/clusterobjectset_types.goapi/v1/clusterobjectset_types_test.goapi/v1/validation_test.goapi/v1/zz_generated.deepcopy.goapplyconfigurations/api/v1/clusterextensionrevisionstatus.goapplyconfigurations/api/v1/clusterextensionstatus.goapplyconfigurations/api/v1/clusterobjectset.goapplyconfigurations/api/v1/clusterobjectsetobject.goapplyconfigurations/api/v1/clusterobjectsetphase.goapplyconfigurations/api/v1/clusterobjectsetspec.goapplyconfigurations/api/v1/clusterobjectsetstatus.goapplyconfigurations/api/v1/objectsourceref.goapplyconfigurations/api/v1/revisionstatus.goapplyconfigurations/utils.gocmd/operator-controller/main.gocommitchecker.yamlconfig/samples/olm_v1_clusterextension.yamldocs/api-reference/crd-ref-docs-gen-config.yamldocs/api-reference/olmv1-api-reference.mddocs/concepts/large-bundle-support.mdhack/tools/update-crds.shhelm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yamlhelm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterobjectsets.yamlhelm/olmv1/templates/crds/customresourcedefinition-clusterobjectsets.olm.operatorframework.io.ymlhelm/olmv1/templates/rbac/clusterrole-operator-controller-manager-role.ymlinternal/operator-controller/applier/boxcutter.gointernal/operator-controller/applier/boxcutter_test.gointernal/operator-controller/applier/externalize_test.gointernal/operator-controller/applier/phase.gointernal/operator-controller/applier/phase_test.gointernal/operator-controller/applier/provider.gointernal/operator-controller/applier/provider_test.gointernal/operator-controller/applier/secretpacker.gointernal/operator-controller/applier/secretpacker_test.gointernal/operator-controller/authorization/rbac.gointernal/operator-controller/authorization/rbac_test.gointernal/operator-controller/config/config.gointernal/operator-controller/config/config_test.gointernal/operator-controller/controllers/boxcutter_reconcile_steps.gointernal/operator-controller/controllers/clusterextension_reconcile_steps.gointernal/operator-controller/controllers/clusterobjectset_controller.gointernal/operator-controller/controllers/clusterobjectset_controller_internal_test.gointernal/operator-controller/controllers/clusterobjectset_controller_test.gointernal/operator-controller/controllers/common_controller.gointernal/operator-controller/controllers/common_controller_test.gointernal/operator-controller/controllers/resolve_ref_test.gointernal/operator-controller/controllers/revision_engine_factory.gointernal/operator-controller/labels/labels.gointernal/shared/util/test/artifacts.gomanifests/experimental-e2e.yamlmanifests/experimental.yamlopenshift/operator-controller/manifests-experimental.yamltest/e2e/README.mdtest/e2e/features/install.featuretest/e2e/features/revision.featuretest/e2e/features/status.featuretest/e2e/features/update.featuretest/e2e/steps/hooks.gotest/e2e/steps/steps.gotest/e2e/steps/testdata/olm-sa-boxcutter-no-create-rbac-template.yamltest/e2e/steps/testdata/olm-sa-boxcutter-rbac-template.yamltest/e2e/steps/testdata/pvc-probe-sa-boxcutter-rbac-template.yamltest/e2e/steps/testdata/rbac-template-for-all-extensions.yamltestdata/images/bundles/large-crd-operator/v1.0.0/manifests/largecrd.operatorframework.io_largecrdtests.yamltestdata/images/bundles/large-crd-operator/v1.0.0/manifests/largecrdoperator.clusterserviceversion.yamltestdata/images/bundles/large-crd-operator/v1.0.0/manifests/script.configmap.yamltestdata/images/bundles/large-crd-operator/v1.0.0/metadata/annotations.yamltestdata/images/catalogs/test-catalog/v1/configs/catalog.yaml
💤 Files with no reviewable changes (2)
- applyconfigurations/api/v1/clusterextensionrevisionstatus.go
- api/v1/clusterextensionrevision_types_test.go
| {{- if .Values.options.operatorController.enabled }} | ||
| {{- if (eq .Values.options.featureSet "standard") }} | ||
| {{- /* Add when GA: tpl (.Files.Get "base/operator-controller/crd/standard/olm.operatorframework.io_clusterextensionrevisionss.yaml") . */}} | ||
| {{- /* Add when GA: tpl (.Files.Get "base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsetss.yaml") . */}} |
There was a problem hiding this comment.
Typo in commented CRD path: double 's' in filename.
The commented path for the standard feature-set has clusterobjectsetss.yaml (double 's') while line 6 correctly uses clusterobjectsets.yaml. This should be fixed to prevent issues when enabling this for GA.
Proposed fix
-{{- /* Add when GA: tpl (.Files.Get "base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsetss.yaml") . */}}
+{{- /* Add when GA: tpl (.Files.Get "base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsets.yaml") . */}}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {{- /* Add when GA: tpl (.Files.Get "base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsetss.yaml") . */}} | |
| {{- /* Add when GA: tpl (.Files.Get "base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsets.yaml") . */}} |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@helm/olmv1/templates/crds/customresourcedefinition-clusterobjectsets.olm.operatorframework.io.yml`
at line 3, Fix the typo in the commented tpl call: change the filename
referenced in the comment from "clusterobjectsetss.yaml" to
"clusterobjectsets.yaml" so the commented line tpl (.Files.Get
"base/operator-controller/crd/standard/olm.operatorframework.io_clusterobjectsets.yaml")
. matches the actual file name used elsewhere.
| import ( | ||
| "bytes" | ||
| "compress/gzip" | ||
| "crypto/sha256" | ||
| "encoding/base64" | ||
| "encoding/json" | ||
| "strings" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
| "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" | ||
|
|
||
| ocv1 "github.com/operator-framework/operator-controller/api/v1" | ||
| "github.com/operator-framework/operator-controller/internal/operator-controller/labels" | ||
| ) |
There was a problem hiding this comment.
Read the gzip payload to EOF in this test.
gzip.NewReader only validates the header. Corruption and truncation show up on Read/Close, so this case can pass with unreadable Secret data.
Suggested test hardening
import (
"bytes"
"compress/gzip"
"crypto/sha256"
"encoding/base64"
"encoding/json"
+ "io"
"strings"
"testing"
@@
// Verify we can decompress it.
reader, err := gzip.NewReader(bytes.NewReader(data))
require.NoError(t, err)
- defer reader.Close()
+ decompressed, err := io.ReadAll(reader)
+ require.NoError(t, err)
+ require.NoError(t, reader.Close())
+
+ var roundtrip map[string]interface{}
+ require.NoError(t, json.Unmarshal(decompressed, &roundtrip))
+ assert.Equal(t, "ConfigMap", roundtrip["kind"])
})Also applies to: 143-171
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/operator-controller/applier/secretpacker_test.go` around lines 3 -
18, The tests in secretpacker_test.go create a gzip.Reader but only validate
headers; fix each test (including the second case around lines 143-171) to fully
read the gzip payload to EOF and surface truncation/corruption: after calling
gzip.NewReader, read the entire decompressed stream (e.g., io.ReadAll or io.Copy
to a buffer) and verify the read result and error, then call Close() and check
its error as well so any truncated or corrupt gzip data fails the test; update
the assertions around the gzip handling in the relevant test helper or test
functions to expect errors when reading/closing fails.
| // Extract revision number from name (e.g., "rev-1" -> 1, "test-ext-10" -> 10) | ||
| revNum := controllers.ExtractRevisionNumber(t, revisionName) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Call site under review:"
sed -n '1094,1099p;1721,1724p' internal/operator-controller/controllers/clusterobjectset_controller_test.go
echo
echo "ExtractRevisionNumber definition:"
rg -n -C4 '\bExtractRevisionNumber\b' --type goRepository: openshift/operator-framework-operator-controller
Length of output: 4529
🏁 Script executed:
cat -n internal/operator-controller/controllers/testhelpers_test.go | sed -n '9,35p'Repository: openshift/operator-framework-operator-controller
Length of output: 1360
Fixture name at line 1723 should match the revision it will receive.
Line 1098 derives Spec.Revision from controllers.ExtractRevisionNumber(t, revisionName), which silently defaults to revision 1 when the name doesn't end with a numeric suffix. At line 1723, passing "test-rev" will result in Spec.Revision=1 despite the fixture name suggesting otherwise. Rename to "test-rev-1" for clarity.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/operator-controller/controllers/clusterobjectset_controller_test.go`
around lines 1097 - 1098, The test fixture name used at creation should include
an explicit numeric suffix so controllers.ExtractRevisionNumber(t, revisionName)
yields the expected Spec.Revision; update the fixture name currently "test-rev"
to "test-rev-1" (or another name ending with the desired numeric revision) so
Spec.Revision reflects that value when the test uses
controllers.ExtractRevisionNumber and subsequent assertions rely on
Spec.Revision.
| func (c *ClusterObjectSetReconciler) resolveObjectRef(ctx context.Context, ref ocv1.ObjectSourceRef) (*unstructured.Unstructured, error) { | ||
| secret := &corev1.Secret{} | ||
| key := client.ObjectKey{Name: ref.Name, Namespace: ref.Namespace} | ||
| if err := c.Client.Get(ctx, key, secret); err != nil { | ||
| return nil, fmt.Errorf("getting Secret %s/%s: %w", ref.Namespace, ref.Name, err) |
There was a problem hiding this comment.
Honor the default namespace contract for Secret refs.
ObjectSourceRef.Namespace is documented as optional, but this lookup uses it verbatim. A ref that omits namespace will fail here instead of defaulting to the OLM system namespace, so the new ref path is broken for the documented API shape. Please apply that fallback before the Get call; the mirrored E2E resolver should be updated the same way.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/operator-controller/controllers/clusterobjectset_controller.go`
around lines 539 - 543, The lookup in resolveObjectRef uses
ObjectSourceRef.Namespace verbatim so refs that omit namespace fail; before
calling c.Client.Get, fallback when ref.Namespace is empty by setting it to the
operator/OLM system namespace (use the reconciler's SystemNamespace field or
equivalent on the ClusterObjectSetReconciler) so the Secret lookup uses that
default namespace; update the mirrored E2E resolver the same way to keep
behavior consistent (ensure you reference ObjectSourceRef.Namespace,
resolveObjectRef, and the c.Client.Get call when making the change).
| mockEngine := &mockRevisionEngine{ | ||
| reconcile: func(_ context.Context, _ machinerytypes.Revision, _ ...machinerytypes.RevisionReconcileOption) (machinery.RevisionResult, error) { | ||
| return mockRevisionResult{}, nil | ||
| }, | ||
| } | ||
| reconciler := &controllers.ClusterObjectSetReconciler{ | ||
| Client: fakeClient, | ||
| RevisionEngineFactory: &mockRevisionEngineFactory{engine: mockEngine}, | ||
| TrackingCache: &mockTrackingCache{client: fakeClient}, | ||
| Clock: clocktesting.NewFakeClock(metav1.Now().Time), | ||
| } | ||
|
|
||
| _, err = reconciler.Reconcile(context.Background(), ctrl.Request{ | ||
| NamespacedName: types.NamespacedName{Name: cos.Name}, | ||
| }) | ||
| require.NoError(t, err) |
There was a problem hiding this comment.
Assert that ref resolution changes the revision payload.
The happy-path cases only check that Reconcile returns nil. Because the mocks on Lines 72 and 133 ignore machinerytypes.Revision, these tests would still pass if ref expansion stopped and unresolved phases were handed downstream. Capture the revision in the mock and assert the expected ConfigMap is present for both plain JSON and gzip.
Also applies to: 132-147
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/operator-controller/controllers/resolve_ref_test.go` around lines 71
- 86, The tests currently only ensure reconciler.Reconcile returns no error but
don't verify that ref resolution altered the revision payload; update the
mockRevisionEngine.reconcile closure to capture the incoming
machinerytypes.Revision parameter (e.g., store it in a local variable accessible
to the test) and after calling controllers.ClusterObjectSetReconciler.Reconcile
assert that the captured Revision contains the expanded ConfigMap payload
(validate the expected key/value for plain JSON case and decompress+validate for
the gzip case). Apply the same change to the other test case that uses
mockRevisionEngine (the block referenced around lines 132-147) so both plain
JSON and gzip paths assert the resolved revision payload instead of only
checking for nil error.
| Then ClusterExtension is rolled out | ||
| And ClusterExtension is available | ||
| And ClusterObjectSet "${NAME}-1" phase objects use refs | ||
| And ClusterObjectSet "${NAME}-1" ref Secrets exist in "olmv1-system" namespace |
There was a problem hiding this comment.
Don't hard-code the Boxcutter Secret namespace.
Line 528 pins this check to olmv1-system, but this PR also carries OpenShift manifests that install the controller in openshift-operator-controller. The same literal is showing up in the new test coverage, so this makes the externalization path environment-specific instead of validating the active installation.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@test/e2e/features/install.feature` at line 528, The step "And
ClusterObjectSet \"${NAME}-1\" ref Secrets exist in \"olmv1-system\" namespace"
hard-codes the Boxcutter Secret namespace; change it to determine the active
controller/installation namespace dynamically (e.g., use the test feature
variable that holds the installation namespace or an env var like
INSTALL_NAMESPACE/OPERATOR_NAMESPACE) and replace the literal "olmv1-system"
with that variable, or derive the namespace from the deployed
ClusterObjectSet/ClusterOperator resource before asserting; update the step to
reference the variable instead of the hard-coded string so the check works for
both "olmv1-system" and "openshift-operator-controller".
| // Get the owner name from the ClusterObjectSet's own labels. | ||
| cosObj, err := getResource("clusterobjectset", revisionName, "") | ||
| if err != nil { | ||
| return fmt.Errorf("getting ClusterObjectSet %q: %w", revisionName, err) | ||
| } | ||
| expectedOwner := cosObj.GetLabels()["olm.operatorframework.io/owner-name"] | ||
|
|
||
| for _, s := range secrets { | ||
| revLabel := s.Labels["olm.operatorframework.io/revision-name"] | ||
| if revLabel != revisionName { | ||
| return fmt.Errorf("secret %s/%s has revision-name label %q, expected %q", s.Namespace, s.Name, revLabel, revisionName) | ||
| } | ||
| ownerLabel := s.Labels["olm.operatorframework.io/owner-name"] | ||
| if expectedOwner != "" && ownerLabel != expectedOwner { | ||
| return fmt.Errorf("secret %s/%s has owner-name label %q, expected %q", s.Namespace, s.Name, ownerLabel, expectedOwner) | ||
| } |
There was a problem hiding this comment.
Fail fast if the ClusterObjectSet is missing the owner label.
If cosObj lacks olm.operatorframework.io/owner-name, expectedOwner is empty and this step skips the Secret owner-label assertion entirely. That lets the scenario pass when both the ClusterObjectSet and all generated ref Secrets are missing the owner label.
Suggested fix
// Get the owner name from the ClusterObjectSet's own labels.
cosObj, err := getResource("clusterobjectset", revisionName, "")
if err != nil {
return fmt.Errorf("getting ClusterObjectSet %q: %w", revisionName, err)
}
expectedOwner := cosObj.GetLabels()["olm.operatorframework.io/owner-name"]
+ if expectedOwner == "" {
+ return fmt.Errorf("ClusterObjectSet %q is missing label %q", revisionName, "olm.operatorframework.io/owner-name")
+ }
for _, s := range secrets {
revLabel := s.Labels["olm.operatorframework.io/revision-name"]
if revLabel != revisionName {
return fmt.Errorf("secret %s/%s has revision-name label %q, expected %q", s.Namespace, s.Name, revLabel, revisionName)
}
ownerLabel := s.Labels["olm.operatorframework.io/owner-name"]
- if expectedOwner != "" && ownerLabel != expectedOwner {
+ if ownerLabel != expectedOwner {
return fmt.Errorf("secret %s/%s has owner-name label %q, expected %q", s.Namespace, s.Name, ownerLabel, expectedOwner)
}
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@test/e2e/steps/steps.go` around lines 820 - 835, The test currently skips
owner-label checks when the ClusterObjectSet's label
olm.operatorframework.io/owner-name is missing; update the logic after
retrieving cosObj (in the getResource/cosObj block) to fail fast if that label
is absent or empty by returning an error indicating the ClusterObjectSet is
missing the owner label (so expectedOwner must be non-empty before iterating
secrets), rather than silently skipping secret owner assertions; reference
cosObj.GetLabels(), expectedOwner, and the secrets loop when making this change.
| spec: | ||
| terminationGracePeriodSeconds: 0 | ||
| volumes: | ||
| - name: scripts | ||
| configMap: | ||
| name: httpd-script | ||
| defaultMode: 0755 | ||
| containers: | ||
| - name: busybox-httpd-container | ||
| image: busybox:1.37 | ||
| command: ["/scripts/httpd.sh"] | ||
| ports: | ||
| - containerPort: 80 | ||
| volumeMounts: | ||
| - name: scripts | ||
| mountPath: /scripts | ||
| readOnly: true | ||
| startupProbe: | ||
| httpGet: | ||
| path: /started | ||
| port: 80 | ||
| failureThreshold: 30 | ||
| periodSeconds: 10 | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /live | ||
| port: 80 | ||
| failureThreshold: 1 | ||
| periodSeconds: 2 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /ready | ||
| port: 80 | ||
| initialDelaySeconds: 1 | ||
| periodSeconds: 1 | ||
| serviceAccountName: simple-bundle-manager |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
from pathlib import Path
path = Path("testdata/images/bundles/large-crd-operator/v1.0.0/manifests/largecrdoperator.clusterserviceversion.yaml")
for lineno, line in enumerate(path.read_text().splitlines(), 1):
if 57 <= lineno <= 92:
indent = len(line) - len(line.lstrip(" "))
print(f"{lineno:4} indent={indent}: {line}")
PYRepository: openshift/operator-framework-operator-controller
Length of output: 2019
Move serviceAccountName out of the container block.
Line 92 nests serviceAccountName under the container at indent level 20. Kubernetes only accepts this field on PodSpec (indent level 16), so the Deployment will either be rejected by schema validation or run under the default service account instead of simple-bundle-manager, breaking the intended RBAC setup.
Proposed fix
spec:
terminationGracePeriodSeconds: 0
+ serviceAccountName: simple-bundle-manager
volumes:
- name: scripts
configMap:
@@
readinessProbe:
httpGet:
path: /ready
port: 80
initialDelaySeconds: 1
periodSeconds: 1
- serviceAccountName: simple-bundle-manager📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| spec: | |
| terminationGracePeriodSeconds: 0 | |
| volumes: | |
| - name: scripts | |
| configMap: | |
| name: httpd-script | |
| defaultMode: 0755 | |
| containers: | |
| - name: busybox-httpd-container | |
| image: busybox:1.37 | |
| command: ["/scripts/httpd.sh"] | |
| ports: | |
| - containerPort: 80 | |
| volumeMounts: | |
| - name: scripts | |
| mountPath: /scripts | |
| readOnly: true | |
| startupProbe: | |
| httpGet: | |
| path: /started | |
| port: 80 | |
| failureThreshold: 30 | |
| periodSeconds: 10 | |
| livenessProbe: | |
| httpGet: | |
| path: /live | |
| port: 80 | |
| failureThreshold: 1 | |
| periodSeconds: 2 | |
| readinessProbe: | |
| httpGet: | |
| path: /ready | |
| port: 80 | |
| initialDelaySeconds: 1 | |
| periodSeconds: 1 | |
| serviceAccountName: simple-bundle-manager | |
| spec: | |
| terminationGracePeriodSeconds: 0 | |
| serviceAccountName: simple-bundle-manager | |
| volumes: | |
| - name: scripts | |
| configMap: | |
| name: httpd-script | |
| defaultMode: 0755 | |
| containers: | |
| - name: busybox-httpd-container | |
| image: busybox:1.37 | |
| command: ["/scripts/httpd.sh"] | |
| ports: | |
| - containerPort: 80 | |
| volumeMounts: | |
| - name: scripts | |
| mountPath: /scripts | |
| readOnly: true | |
| startupProbe: | |
| httpGet: | |
| path: /started | |
| port: 80 | |
| failureThreshold: 30 | |
| periodSeconds: 10 | |
| livenessProbe: | |
| httpGet: | |
| path: /live | |
| port: 80 | |
| failureThreshold: 1 | |
| periodSeconds: 2 | |
| readinessProbe: | |
| httpGet: | |
| path: /ready | |
| port: 80 | |
| initialDelaySeconds: 1 | |
| periodSeconds: 1 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@testdata/images/bundles/large-crd-operator/v1.0.0/manifests/largecrdoperator.clusterserviceversion.yaml`
around lines 57 - 92, The serviceAccountName is incorrectly nested inside the
container block (under the container named busybox-httpd-container); move the
serviceAccountName field out of the container and place it at the PodSpec level
(same indentation as terminationGracePeriodSeconds, volumes, and containers) so
the PodSpec includes serviceAccountName: simple-bundle-manager and the container
block no longer contains that field.
|
@tmshort: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Hi @Xia-Zhao-rh , could you help verify it? Thanks! |
|
/retitle OCPBUGS-78211,OCPBUGS-78455: Synchronize From Upstream Repositories |
|
@tmshort: This pull request references Jira Issue OCPBUGS-78211, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. This pull request references Jira Issue OCPBUGS-78455, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@kuiwang02: This pull request references Jira Issue OCPBUGS-78211, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: This pull request references Jira Issue OCPBUGS-78455, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
OCPBUGS-78211 is verified. |
The downstream repository has been updated with the following following upstream commits:
The
vendor/directory has been updated and the following commits were carried:@catalogd-updateThis pull request is expected to merge without any human intervention. If tests are failing here, changes must land upstream to fix any issues so that future downstreaming efforts succeed.
/label tide/merge-method-merge