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
graduate PersistentVolumeLastPhaseTransitionTime to beta in v1.29 #120627
graduate PersistentVolumeLastPhaseTransitionTime to beta in v1.29 #120627
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/assign @jsafrane /sig storage |
@@ -143,7 +143,7 @@ func (persistentvolumeStatusStrategy) GetResetFields() map[fieldpath.APIVersion] | |||
return fields | |||
} | |||
|
|||
var nowFunc = metav1.Now | |||
var NowFunc = metav1.Now |
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.
How about adding a comment explaining the reason why the function is defined, e.g. for a test purpose.
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.
This function is not entirely for testing, I just exported it to allow override in tests. It is used to set actual timestamp in PV strategy: https://github.com/kubernetes/kubernetes/blob/0fcfea649cda8915b1ceaa886eeea23d903afb55/pkg/registry/core/persistentvolume/strategy.go#L74
/lgtm |
LGTM label has been added. Git tree hash: 5e743e73814a428680689c9017bdcba1ed99242b
|
/label api-review |
@@ -19,6 +19,7 @@ package storage | |||
import ( |
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.
Should we explicit enable the feature gate in these 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.
I've added it for the modified test (TestUpdateStatus
). Explicit is better, but is there any other advantage if it's enabled by default now?
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.
NowFunc() has to be exported so it is available for testing in other packages.
After enabling PersistentVolumeLastPhaseTransitionTime feature, any test that compares PV objects that transitioned phase needs to handle timestamp values correctly. Either the tests should avoid phase transitions if not needed or the test needs to set the same timestamp on new PV object so it's not changed and can be checked for equality later, the latter is used in this commit.
0fcfea6
to
e42e659
Compare
e42e659
to
fb872e8
Compare
@@ -166,6 +173,7 @@ func TestWatch(t *testing.T) { | |||
} | |||
|
|||
func TestUpdateStatus(t *testing.T) { | |||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.PersistentVolumeLastPhaseTransitionTime, true)() |
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.
Should we add more testcases? i.e. one's featute-gate is on and another's featute-gate is off.
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.
Tests were added mostly in alpha to strategy_test.go
and are quite extensive, pretty much covering all possible scenarios in combination with feature gate enablement/disablement. I just fixed this test because timestamp addition broke it (as expected). Is there some specific test case that you have in mind that we might have missed?
/retest-required |
/lgtm |
LGTM label has been added. Git tree hash: b20e590d2243cd740f8be31c07dbfa1a3a5e0aee
|
/assign @deads2k |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, msau42, RomanBednar 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 |
Looks like the docs didn't get updated that it is now in beta. Making |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
PersistentVolumeLastPhaseTransitionTime is planned to graduate to beta in 1.29.
PR for updating KEP: kubernetes/enhancements#4125
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Here are the criteria for beta graduation according to this KEP:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: