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

graduate PersistentVolumeLastPhaseTransitionTime to beta in v1.29 #120627

Merged

Conversation

RomanBednar
Copy link
Contributor

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?

PersistentVolumeLastPhaseTransitionTime is now beta, enabled by default.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://kep.k8s.io/3762

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 13, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Sep 13, 2023
@RomanBednar
Copy link
Contributor Author

/assign @jsafrane

/sig storage

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 13, 2023
@@ -143,7 +143,7 @@ func (persistentvolumeStatusStrategy) GetResetFields() map[fieldpath.APIVersion]
return fields
}

var nowFunc = metav1.Now
var NowFunc = metav1.Now
Copy link
Member

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.

Copy link
Contributor Author

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

@jsafrane
Copy link
Member

jsafrane commented Oct 9, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 9, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5e743e73814a428680689c9017bdcba1ed99242b

@jsafrane
Copy link
Member

jsafrane commented Oct 9, 2023

/label api-review

@@ -19,6 +19,7 @@ package storage
import (
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsafrane PTAL again, lgtm was removed. Here's the diff, the followup push is just a rebase.

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.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2023
@@ -166,6 +173,7 @@ func TestWatch(t *testing.T) {
}

func TestUpdateStatus(t *testing.T) {
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.PersistentVolumeLastPhaseTransitionTime, true)()
Copy link
Member

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.

Copy link
Contributor Author

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?

@RomanBednar
Copy link
Contributor Author

/retest-required

@msau42
Copy link
Member

msau42 commented Oct 27, 2023

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: b20e590d2243cd740f8be31c07dbfa1a3a5e0aee

@msau42
Copy link
Member

msau42 commented Oct 27, 2023

/assign @deads2k

@dims
Copy link
Member

dims commented Oct 27, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit 6a4f08e into kubernetes:master Oct 27, 2023
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 27, 2023
@BBBmau
Copy link

BBBmau commented Jan 12, 2024

Looks like the docs didn't get updated that it is now in beta. Making lastPhaseTransitionTime not an alpha field anymore.

@RomanBednar
Copy link
Contributor Author

@BBBmau You're right, I missed that when moving the feature to beta. Thank you for raising the issue, I've opened a PR to remove the comment here: #122728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. 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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Status: API review completed, 1.29
Development

Successfully merging this pull request may close these issues.

None yet

8 participants