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

Fix clusterdeployment tests for DeepEquals #1410

Merged
merged 1 commit into from Jun 9, 2021

Conversation

2uasimojo
Copy link
Member

TL;DR: When comparing objects coming back from kube, things like ResourceVersion should be ignored (unless asserting that the object has not changed on the server, in which case comparing only ResourceVersion should suffice).

We had a couple of tests that were using DeepEquals to compare an object from the (fake) kube server to one we constructed locally. The ResourceVersion returned by the fake server changed in controller-runtime 0.8.0 which broke tests. We worked around that; but the Right Thing To Do™ is to make the comparison ignore ResourceVersion entirely. It is thusly done via this commit.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2021
TL;DR: When comparing objects coming back from kube, things like
ResourceVersion should be ignored (unless asserting that the object has
not changed on the server, in which case comparing *only*
ResourceVersion should suffice).

We had a couple of tests that were using DeepEquals to compare an object
from the (fake) kube server to one we constructed locally. The
ResourceVersion returned by the fake server [changed in
controller-runtime
0.8.0](kubernetes-sigs/controller-runtime#1306)
which broke tests. We [worked
around](openshift@c7d6052)
that; but the Right Thing To Do™ is to make the comparison ignore
ResourceVersion entirely. It is thusly done via this commit.
@2uasimojo
Copy link
Member Author

/assign @dgoodwin

@dgoodwin
Copy link
Contributor

dgoodwin commented Jun 9, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 9, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo, dgoodwin

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:

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

@openshift-merge-robot openshift-merge-robot merged commit ba15b21 into openshift:master Jun 9, 2021
@2uasimojo 2uasimojo deleted the mostly-equals branch June 10, 2021 14:33
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.

None yet

3 participants