Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Use in-tree metav1.Condition instead of custom copied type #197

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Apr 12, 2022

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 12, 2022
Copy link
Contributor

@adrianludwin adrianludwin left a 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

Comment on lines 67 to 70
// 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),
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Apr 12, 2022
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.
@erikgb erikgb force-pushed the refactor/conditions branch from 57d4749 to 8bddee6 Compare April 13, 2022 12:20
Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 34837c2 into kubernetes-retired:master Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants