-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Promote Statefulset controller and its e2e tests to use apps/v1 #55792
Promote Statefulset controller and its e2e tests to use apps/v1 #55792
Conversation
/sig apps |
/assign @kow3ns |
6577306
to
aaf3b6a
Compare
Do we need to worry about this potentially breaking GKE (if GKE doesn't have |
/test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-node-e2e |
/retest |
@ncdc This seems to paas e2e-gke-gci now is it good enough? Sorry just noticing this test is skipped. |
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.
- The title of this PR is confusing. StatefulSet is promoted to v1. What you are doing is converting the controller to use the v1 client.
- You can't do this now. If we merge this PR we break cluster upgrade for any cluster with multiple masters, and rolling back an upgrade becomes hazardous. We can accept a PR like this for the 1.10 release.
@kow3ns Sure, I can maintain this PR until 1.9 is cut out of |
/test pull-kubernetes-unit |
/unassign |
@dhilipkumars don't close it. We will do this in the 1.10 timeframe and we can review and merge when we come out of code freeze. |
@antoineco Conditions are already a part of v1 api object? Is there a specific functionality we should include when you say 'condition management' ? |
@dhilipkumars I meant actually computing the resource conditions at the end of the reconciliation loop. Currently it seems like the |
@antoineco I'm not sure that is the scope of this PR, this is simply making the core controller work on top of Could you please create an issue if there isn't one so that this requirement can be tracked? |
ping @kubernetes/sig-apps-api-reviews |
69a30b7
to
0de0e5f
Compare
pkg/apis/apps/v1/conversion.go
Outdated
@@ -453,8 +453,10 @@ func Convert_apps_StatefulSetUpdateStrategy_To_v1_StatefulSetUpdateStrategy(in * | |||
} | |||
|
|||
func Convert_v1_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1.StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { | |||
out.ObservedGeneration = new(int64) | |||
*out.ObservedGeneration = in.ObservedGeneration | |||
if in.ObservedGeneration != nil { |
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 does not make sense.
in. ObservedGeneration
is int64
, which cannot be nil
.
I prefer to keep this unchanged.
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.
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.
Refer to #49607. Don't change the type back.
pkg/apis/apps/v1/conversion.go
Outdated
@@ -476,7 +478,8 @@ func Convert_v1_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1.StatefulS | |||
|
|||
func Convert_apps_StatefulSetStatus_To_v1_StatefulSetStatus(in *apps.StatefulSetStatus, out *appsv1.StatefulSetStatus, s conversion.Scope) error { | |||
if in.ObservedGeneration != nil { | |||
out.ObservedGeneration = *in.ObservedGeneration | |||
out.ObservedGeneration = new(int64) |
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.
out.ObservedGeneration
is type int64
. Should not create a new int64 ptr here.
Keep this unchanged.
Actually there are inconsistence between apps/internal
and apps/v1
. Such as ObservedGeneration
is type *int64
in apps/internal
, while it is changed to int64
in apps/v1
.
5266916
to
8ccb8b9
Compare
/test pull-kubernetes-cross |
pkg/apis/apps/v1/conversion.go
Outdated
@@ -453,6 +453,7 @@ func Convert_apps_StatefulSetUpdateStrategy_To_v1_StatefulSetUpdateStrategy(in * | |||
} | |||
|
|||
func Convert_v1_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1.StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { | |||
|
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.
Remove this newline.
pkg/apis/apps/v1/conversion.go
Outdated
@@ -472,9 +473,11 @@ func Convert_v1_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1.StatefulS | |||
} | |||
} | |||
return nil | |||
|
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.
Ditto.
pkg/apis/apps/v1/conversion.go
Outdated
} | ||
|
||
func Convert_apps_StatefulSetStatus_To_v1_StatefulSetStatus(in *apps.StatefulSetStatus, out *appsv1.StatefulSetStatus, s conversion.Scope) error { | ||
|
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.
Ditto.
@@ -22,7 +22,8 @@ import ( | |||
|
|||
"github.com/golang/glog" | |||
|
|||
apps "k8s.io/api/apps/v1beta1" | |||
apps "k8s.io/api/apps/v1" | |||
//apps "k8s.io/api/apps/v1beta1" |
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.
Forgot to remove this?
@@ -23,7 +23,8 @@ import ( | |||
"regexp" | |||
"strconv" | |||
|
|||
apps "k8s.io/api/apps/v1beta1" | |||
//apps "k8s.io/api/apps/v1beta1" |
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.
Forgot to remove this ?
pkg/kubectl/rollback.go
Outdated
return "", fmt.Errorf("failed restoring revision %d: %v", toRevision, err) | ||
} | ||
|
||
return rollbackSuccess, nil | ||
} | ||
|
||
// findHistoryV1 returns a controllerrevision of a specific revision from the given controllerrevisions. | ||
// It returns nil if no such controllerrevision exists. | ||
// If toRevision is 0, the last previously used history is returned. |
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.
Add a TODO here to rename this to findHistory when other controllers have been upgraded.
test/e2e/apps/statefulset.go
Outdated
apps "k8s.io/api/apps/v1beta1" | ||
appsv1beta2 "k8s.io/api/apps/v1beta2" | ||
apps "k8s.io/api/apps/v1" | ||
//appsv1beta1 "k8s.io/api/apps/v1beta1" |
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.
Remove these two comment lines.
test/e2e/apps/statefulset.go
Outdated
@@ -844,7 +845,7 @@ var _ = SIGDescribe("StatefulSet", func() { | |||
return nil | |||
}, framework.StatefulPodTimeout, 2*time.Second).Should(BeNil()) | |||
}) | |||
|
|||
/* Comment it for 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.
Any reasons to comment it?
349c508
to
aba725a
Compare
/lgtm |
/approve |
cc: @smarterclayton could you please approve. |
/assign @smarterclayton |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhilipkumars, dixudx, kow3ns, smarterclayton Associated issue: #55714 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test all Tests are more than 96 hours old. Re-running tests. |
@dhilipkumars: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 55792, 58342). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Promotes the statefulset controller to use to use the latest apps group apps/v1
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes # #55714
Special notes for your reviewer:
Listerexpansion for v1
k8s.io/client-go/listers/apps/v1
(was recently done for v1beta2)v1beta2
&&v1
hadObservedGeneration
asint64
where asv1beta1
and rest of the code (including conversion) is expectingObservedGeneration
to be*int64
rollback
andhistory
commands a couple functions have been duplicated to allow us to usev1
version instead ofv1beta1
for statefulsets, while the older functions are still used by other controllers.We should be able to remove these duplicates once all the controllers are moved.
If this aligns with the plan then i could move other controllers too.
cc: @kow3ns
Release note: