Skip to content

use CreateOrUpdate for OLM collect profiles resources#1018

Merged
openshift-merge-robot merged 1 commit intoopenshift:mainfrom
sjenning:fix-olm-direct-create
Feb 15, 2022
Merged

use CreateOrUpdate for OLM collect profiles resources#1018
openshift-merge-robot merged 1 commit intoopenshift:mainfrom
sjenning:fix-olm-direct-create

Conversation

@sjenning
Copy link
Copy Markdown
Contributor

@sjenning sjenning commented Feb 15, 2022

What this PR does / why we need it:
#583 introduced two direct calls to Create rather than CreateOrUpdate. The result in about half the mutating calls from the CPOs in CI being 409 Conflict on these two resources: secret pprof-cert and configmap olm-collect-profiles.

This PR switches to CreateOrUpdate to avoid these calls and reduce the CPO mutating call volume by roughly 50%.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci openshift-ci Bot requested review from csrwng and enxebre February 15, 2022 04:45
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2022
@@ -1913,8 +1913,11 @@ func (r *HostedControlPlaneReconciler) reconcileOperatorLifecycleManager(ctx con
// Collect Profiles
collectProfilesConfigMap := manifests.CollectProfilesConfigMap(hcp.Namespace)
olm.ReconcileCollectProfilesConfigMap(collectProfilesConfigMap, p.OwnerRef)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed now or not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, it should

@sjenning sjenning force-pushed the fix-olm-direct-create branch from 2d2d36c to 1d34f33 Compare February 15, 2022 14:16
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 15, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, sjenning

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [alvaroaleman,sjenning]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2022
@openshift-merge-robot openshift-merge-robot merged commit 197707c into openshift:main Feb 15, 2022
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 15, 2022

@sjenning: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants