-
Notifications
You must be signed in to change notification settings - Fork 113
Use in-tree metav1.Condition instead of custom copied type #197
Use in-tree metav1.Condition instead of custom copied type #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, but otherwise lgtm
/ok-to-test
// TODO(adrianludwin) Is the following statement really correct? | ||
// Set time as an obviously wrong value 1970-01-01T00:00:00Z since we | ||
// overwrite conditions every time. | ||
LastTransitionTime: metav1.Unix(0, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be happy to just leave that out since I assume it's the zero value anyway. Also SetStatusCondition seems to set it automatically if it's zero-valued anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, removing it seems to introduce failing tests. I will have to investigate a bit more or leave it as it is now. WDYT? There are two quite different use-cases calling this function: loadNamespaceConditions
and syncConditions
. I suspect we need two functions with a bit different semantics to fix the failing tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok maybe just update the comment (that this code doesn't work without this statement) and I'll approve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done as suggested. I think you could take a look. It seems to touch some of the core functions in HNC that I do not know very well, at least not yet.
This is a refactoring. K8s 1.20 is EOL, so it should be safe to use the master type from api-machinery. Tested: Ran both unit-tests ('make test') and integration test ('make test-e2e') successfully.
57d4749
to
8bddee6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianludwin, erikgb 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 |
This is a refactoring. K8s 1.20 is EOL, so it should be safe to use the master type from api-machinery.
Tested: Ran both unit-tests ('make test') and integration test ('make test-e2e') successfully.
/cc @adrianludwin
/cc @rjbez17