Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPO: Unittest and fix eventhandling of HCP controller #1605

Merged

Conversation

alvaroaleman
Copy link
Contributor

This change:

  • Adds a unittest to the CPO that verifies that all objects it creates
    for a given HCP trigger a reconciliation of that HCP
  • Updates the HCP controller to use a CreateOrUpdate wrapper that
    inserts a HCP ownerRef into all objects, similiar to what we already
    do in the hostedcluster controller

What this PR does / why we need it:

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 sjenning July 24, 2022 01:53
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2022
@alvaroaleman
Copy link
Contributor Author

/retest

1 similar comment
@alvaroaleman
Copy link
Contributor Author

/retest

@alvaroaleman
Copy link
Contributor Author

/retest-required

@csrwng
Copy link
Contributor

csrwng commented Jul 25, 2022

@alvaroaleman this lgtm
Looks like now we have a good bit of redundant code in the individual reconcile funcs (that sets the owner ref), but I think that's ok. We should eventually remove it.
It also looks like you need to rebase.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2022
@alvaroaleman
Copy link
Contributor Author

@csrwng yeah I was trying to come up with an elegant way to do this in support/upsert but couldn't think of one.

Rebased it.

This change:
* Adds a unittest to the CPO that verifies that all objects it creates
  for a given HCP trigger a reconciliation of that HCP
* Updates the HCP controller to use a CreateOrUpdate wrapper that
  inserts a HCP ownerRef into all objects, similiar to what we already
  do in the hostedcluster controller
@alvaroaleman
Copy link
Contributor Author

@csrwng could you have another look, please?

@alvaroaleman
Copy link
Contributor Author

/retest-required

1 similar comment
@alvaroaleman
Copy link
Contributor Author

/retest-required

@csrwng
Copy link
Contributor

csrwng commented Jul 28, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

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

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

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 2 against base HEAD 1e29e78 and 8 for PR HEAD f5824ab in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 28, 2022

@alvaroaleman: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/capi-provider-agent-sanity f5824ab link false /test capi-provider-agent-sanity

Full PR test history. Your PR dashboard.

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.

@alvaroaleman
Copy link
Contributor Author

/retest-required

@openshift-merge-robot openshift-merge-robot merged commit 27384bf into openshift:main Jul 29, 2022
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.

4 participants