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

Add statefulset conditions #55268

Merged
merged 2 commits into from Nov 10, 2017

Conversation

foxish
Copy link
Contributor

@foxish foxish commented Nov 7, 2017

What this PR does / why we need it: This PR adds conditions to statefulset status making it consistent with other controllers for v1. See linked issue for discussion.

/xref: #7856

Special notes for your reviewer:

Release note:

StatefulSet status now has support for conditions, making it consistent with other core controllers in v1 

@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 7, 2017
@k8s-github-robot k8s-github-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Nov 7, 2017
// Status of the condition, one of True, False, Unknown.
Status api.ConditionStatus
// The last time this condition was updated.
LastUpdateTime metav1.Time
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to remove LastUpdateTime now? It would mean this is inconsistent with others, but at least we wouldn't propagate it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there consensus on this?

@kow3ns @janetkuo thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

LastUpdateTime was added to DeploymentCondition to replace LastHeartbeatTime or lastProbeTime we see in other conditions (ref #19343 (comment) and #35529 (comment)). It's useful for users to understand what is going on.

We haven't added it to ReplicaSetCondition, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on our discussion - looks like we can remove it from here, since this type isn't in use yet. There's no strong reason to add it only to remove it later.

@smarterclayton
Copy link
Contributor

/approve

One comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 7, 2017
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2017

// Represents the latest available observations of a statefulset's current state.
// +patchMergeKey=type
// +patchStrategy=merge
Copy link
Member

@janetkuo janetkuo Nov 8, 2017

Choose a reason for hiding this comment

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

// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
// The last time this condition was updated.
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"`
Copy link
Member

@janetkuo janetkuo Nov 8, 2017

Choose a reason for hiding this comment

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

Why's the protobuf tag 6 instead of 3? Just remove the protobuf part and let the codegen auto-generate it instead

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 8, 2017
@foxish foxish force-pushed the add-sts-conditions branch 2 times, most recently from 936a528 to 3098139 Compare November 8, 2017 02:53
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2017
@foxish
Copy link
Contributor Author

foxish commented Nov 8, 2017

/retest

@janetkuo
Copy link
Member

janetkuo commented Nov 8, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2017
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to @fejta).

Review the full test history for this PR.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2017
@@ -465,6 +466,7 @@ func Convert_v1_StatefulSetStatus_To_apps_StatefulSetStatus(in *appsv1.StatefulS
out.CollisionCount = new(int32)
*out.CollisionCount = *in.CollisionCount
}
out.Conditions = *(*[]apps.StatefulSetCondition)(unsafe.Pointer(&in.Conditions))
Copy link
Contributor Author

@foxish foxish Nov 8, 2017

Choose a reason for hiding this comment

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

@caesarxuchao PTAL. Does this seem reasonable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per offline discussion - simplified to not use unsafe conversions.

@foxish foxish force-pushed the add-sts-conditions branch 2 times, most recently from 8075ca5 to 9efca4d Compare November 8, 2017 23:17
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2017
@foxish
Copy link
Contributor Author

foxish commented Nov 9, 2017

Rebased. @janetkuo PTAL

@janetkuo
Copy link
Member

janetkuo commented Nov 9, 2017

/lgtm

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

foxish commented Nov 9, 2017

/retest

@foxish
Copy link
Contributor Author

foxish commented Nov 9, 2017

/test pull-kubernetes-e2e-gce-device-plugin-gpu

@foxish
Copy link
Contributor Author

foxish commented Nov 9, 2017

/test pull-kubernetes-verify
/test pull-kubernetes-e2e-gce
/test pull-kubernetes-bazel-test
/test pull-kubernetes-e2e-gce-device-plugin-gpu

@foxish foxish removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2017
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2017
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2017
@kow3ns
Copy link
Member

kow3ns commented Nov 9, 2017

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: foxish, janetkuo, kow3ns, smarterclayton

Associated issue: 7856

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

@foxish
Copy link
Contributor Author

foxish commented Nov 10, 2017

/test pull-kubernetes-unit

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 3ce7c3e into kubernetes:master Nov 10, 2017
@foxish foxish deleted the add-sts-conditions branch November 10, 2017 10:16
@antoineco
Copy link
Contributor

xref #51594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

None yet

8 participants