-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
StatefulSet kubectl rollout command #49674
Conversation
e4d5bad
to
c00edea
Compare
@kow3ns @foxish @janetkuo
I am not sure whether statefulset handles Do you have any idea why adding |
bc999df
to
99fb2e8
Compare
cc @kubernetes/sig-cli-pr-reviews |
containers: | ||
- name: nginx | ||
image: gcr.io/google_containers/nginx-slim:0.7 | ||
image: gcr.io/google-containers/pause:latest |
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.
image does not match the name, right?
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.
yup, i will change the container name.
@@ -461,3 +477,137 @@ func (ssc *StatefulSetController) syncStatefulSet(set *apps.StatefulSet, pods [] | |||
glog.V(4).Infof("Successfully synced StatefulSet %s/%s successful", set.Namespace, set.Name) | |||
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.
Do we need this commented out code?
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.
It looks like i have removed the codes from the newest commit.
@@ -75,3 +76,39 @@ func (s *statefulSetLister) GetPodStatefulSets(pod *v1.Pod) ([]*apps.StatefulSet | |||
|
|||
return psList, 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.
Commented out? needed?
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.
Not needed - i will remove it.
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 have removed it from the newest commit, so no change is needed.
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.
Kubectl change and cmd test are mostly LGTM
pkg/kubectl/history.go
Outdated
if err != nil { | ||
return nil, nil, fmt.Errorf("failed to retrieve DaemonSet %s: %v", name, err) | ||
return nil, nil, fmt.Errorf("failed to obtain accessor for %s named %s: %v", kind, accessor.GetName(), err) |
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.
accessor.GetName()
Why not simply use name
? It should be identical.
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.
ya, name
suffices. :)
pkg/kubectl/history.go
Outdated
if err != nil { | ||
return nil, nil, err | ||
} | ||
historyList, err := apps.ControllerRevisions(ds.Namespace).List(metav1.ListOptions{LabelSelector: selector.String()}) | ||
historyList, err := apps.ControllerRevisions(accessor.GetNamespace()).List(metav1.ListOptions{LabelSelector: selector.String()}) |
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.
accessor.GetNamespace()
Same question. Why not using namespace
?
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.
Looking at the original codes, namespace
may be different from accessor.GetNamespace()
.
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 will verify whether they are the same, and remove Accessor
codes if so.
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 think they should be the same, since the logic chain is
parameters<name, namespace> -> obj -> accessor -> GetNamespace()
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.
Noted! Thanks for confirming - let me remove the Accessor
codes.
@@ -3627,7 +3680,7 @@ run_stateful_set_tests() { | |||
# Pre-condition: no statefulset exists | |||
kube::test::get_object_assert statefulset "{{range.items}}{{$id_field}}:{{end}}" '' | |||
# Command: create statefulset | |||
kubectl create -f hack/testdata/nginx-statefulset.yaml "${kube_flags[@]}" | |||
kubectl create -f hack/testdata/rollingupdate-statefulset.yaml "${kube_flags[@]}" |
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.
Just curious why changing this?
If hack/testdata/nginx-statefulset.yaml
is no longer needed, please delete it.
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 initally planned to reuse nginx-statefulset.yaml
, but found out that updateStrategy
of the spec has to be changed. I am not sure whether it is fine to change existing YAML test files, so i created a new one.
I will remove nginx-statefulset.yaml
if it is not used at other places.
hack/make-rules/test-cmd-util.sh
Outdated
|
||
image_field0="(index .spec.template.spec.containers 0).image" | ||
image_field1="(index .spec.template.spec.containers 1).image" | ||
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.
nit: remove white space
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.
sure!
- -c | ||
- 'while true; do sleep 1; done' | ||
|
||
|
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.
nit: remove unnecessary white space and newline.
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.
yup! i will remove it - it is an issue with my text editor.
- -c | ||
- 'while true; do sleep 1; done' | ||
|
||
|
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.
nit: remove unnecessary white space and newline.
198217f
to
0bbd6dc
Compare
@mengqiy Addressed your feedback. Thanks! :) |
Regarding |
@@ -0,0 +1,25 @@ | |||
apiVersion: 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.
Use apps/v1beta2
instead so that we make sure apps/v1beta2 StatefulSet works?
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.
Agreed. It makes sense to use apps/v1beta2
as we are migrating to it.
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.
Would you change the rollingupdate-daemonset yaml files (under testdata) to apps/v1beta2
as well while you're at it?
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.
yup! we should also do so for deployment.
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.
Would you change the rollingupdate-daemonset yaml files (under testdata) to
apps/v1beta2
as well while you're at it?
Actually, we can do this separately in another PR. I'll file a PR for this, you just need to modify the statefulset manifest to use apps/v1beta2
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.
Ya, let's do it in another PR.
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 filed #51061 for manifests other than StatefulSet
daemonset_image_field0="(index .spec.template.spec.containers 0).image" | ||
daemonset_image_field1="(index .spec.template.spec.containers 1).image" | ||
image_field0="(index .spec.template.spec.containers 0).image" | ||
image_field1="(index .spec.template.spec.containers 1).image" |
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.
We can replace deployment_image_field
and deployment_second_image_field
with these two as well
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.
Noted!
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- name: kubernetes-pause | ||
image: gcr.io/google-containers/pause:latest |
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.
Use gcr.io/google_containers/nginx-slim:0.7
for this and gcr.io/google_containers/nginx-slim:0.8
for rv2 (since the name is nginx)
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.
noted!
hack/make-rules/test-cmd-util.sh
Outdated
# Update the statefulset (revision 2) | ||
kubectl apply -f hack/testdata/rollingupdate-statefulset-rv2.yaml --record "${kube_flags[@]}" | ||
kube::test::wait_object_assert statefulset "{{range.items}}{{$image_field0}}:{{end}}" "${IMAGE_STATEFULSET_R2}:" | ||
kube::test::get_object_assert statefulset "{{range.items}}{{$container_len}}{{end}}" "1" |
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.
In DaemonSet history test I put 1 container in v1 and 2 containers in v2 intentionally, so that I can test if the apply and rollback work. Then this part is to make sure the number of containers is correct. Would you change it accordingly?
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 didn't manage to get 2 containers into the statefulset YAML file a few weeks ago. Let me try again. :)
versionedAppsClient := versionedAppsClientV1beta1(h.c) | ||
ds, allHistory, err := controlledHistories(versionedExtensionsClient, versionedAppsClient, namespace, name) | ||
versionedExtensionsClient := versionedExtensionsClientV1beta1(h.c) |
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 change isn't necessary (unless there's a reason to move it?)
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 switched the order that puts versionedExtensionsClient
before versionedAppsClient
. There are 2 reasons behind:
(1) it is alphabetically ordered for having versionedAppsClient
before versionedExtensionsClient
(2) controlledHistories
function brings argument in the order of versionedAppsClient
and then versionedExtensionsClient
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.
okay
return nil, nil, fmt.Errorf("failed to retrieve StatefulSet %s: %v", name, err) | ||
} | ||
labelSelector = ss.Spec.Selector | ||
obj = ss |
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 a default case and return 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.
Sure!
pkg/kubectl/rollback.go
Outdated
versionedDS, allHistory, err := controlledHistories(versionedExtensionsClient, versionedAppsClient, ds.Namespace, ds.Name) | ||
versionedExtensionsClient := versionedExtensionsClientV1beta1(r.c) | ||
versionedObj, allHistory, err := controlledHistories(versionedAppsClient, versionedExtensionsClient, ds.Namespace, ds.Name, "DaemonSet") | ||
versionedDS := versionedObj.(*externalextensions.DaemonSet) | ||
if err != 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.
error check should be done immediately after where err
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.
make sense!
pkg/kubectl/rollback.go
Outdated
versionedDS, allHistory, err := controlledHistories(versionedExtensionsClient, versionedAppsClient, ds.Namespace, ds.Name) | ||
versionedExtensionsClient := versionedExtensionsClientV1beta1(r.c) | ||
versionedObj, allHistory, err := controlledHistories(versionedAppsClient, versionedExtensionsClient, ds.Namespace, ds.Name, "DaemonSet") | ||
versionedDS := versionedObj.(*externalextensions.DaemonSet) |
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 will panic if versionedObj
is not a *externalextensions.DaemonSet
. It's probably okay, but it'll be safer to do something like:
versionedDS, ok := versionedObj.(*externalextensions.DaemonSet)
// return an error if !ok
Same comment for the other type assertion in this PR
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.
Noted! Thanks for pointing it out - this is very important as i use type assertion frequently.
} | ||
|
||
// toRevision is a non-negative integer, with 0 being reserved to indicate rolling back to previous configuration | ||
func (r *StatefulSetRollbacker) Rollback(obj runtime.Object, updatedAnnotations map[string]string, toRevision int64, dryRun bool) (string, 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.
Lots of code duplication with (r *DaemonSetRollbacker) Rollback
. Would you de-duplicate it (or at least part of it)?
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.
Sure! i will carry out the de-duplication using polymorphism runtime.Object
.
@crimsonfaith91 there's a bug in StatefulSet update validation which caused changing the number of containers impossible for StatefulSets. I filed a patch to fix it: #51051 |
Automatic merge from submit-queue (batch tested with PRs 50980, 46902, 51051, 51062, 51020) Fix StatefulSet update validation StatefulSet update validation did not allow change to number of containers in pod template. Fix this bug so that it's possible to make this kind of change. Found it when suggesting test-cmd changes in #49674. @kubernetes/sig-apps-pr-reviews @smarterclayton /approve no-issue
d926e1b
to
a7b51ac
Compare
@@ -39,3 +26,12 @@ spec: | |||
- sh | |||
- -c | |||
- 'while true; do sleep 1; done' | |||
- name: nginx-2 | |||
image: gcr.io/google_containers/nginx-slim:0.8 |
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.
Would you update nginx
to gcr.io/google_containers/nginx-slim:0.8
and add another container (e.g. gcr.io/google-containers/pause:2.0
).
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.
sure!
hack/make-rules/test-cmd-util.sh
Outdated
kube::test::get_object_assert statefulset "{{range.items}}{{$id_field}}:{{end}}" '' | ||
|
||
# Command: create a StatefulSet (revision 1) | ||
kubectl apply -f hack/testdata/rollingupdate-statefulset.yaml --record "${kube_flags[@]}" |
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 tried --record
locally and it did work. We need to verify controllerrevisions' annotations here first, otherwise this test might be flaky (when undo is called before StS controller creates controllerrevisions)
@@ -3007,10 +3007,10 @@ run_daemonset_history_tests() { | |||
# Command | |||
# Create a DaemonSet (revision 1) | |||
kubectl apply -f hack/testdata/rollingupdate-daemonset.yaml --record "${kube_flags[@]}" | |||
kube::test::get_object_assert controllerrevisions "{{range.items}}{{$annotations_field}}:{{end}}" ".*rollingupdate-daemonset.yaml --record.*" | |||
kube::test::wait_object_assert controllerrevisions "{{range.items}}{{$annotations_field}}:{{end}}" ".*rollingupdate-daemonset.yaml --record.*" |
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.
@janetkuo We have to change get_object_assert
to wait_object_assert
here. :)
command: | ||
- sh | ||
- -c | ||
- 'while true; do sleep 1; done' |
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.
You can't run these commands in pause. Just remove them.
- sh | ||
- -c | ||
- 'while true; do sleep 1; done' | ||
- name: nginx-2 |
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.
name it pause
instead
hack/make-rules/test-cmd-util.sh
Outdated
kube::test::get_object_assert statefulset "{{range.items}}{{$container_len}}{{end}}" "2" | ||
# Clean up - delete newest configuration | ||
kubectl delete -f hack/testdata/rollingupdate-statefulset-rv2.yaml "${kube_flags[@]}" | ||
# Post-condition: no pods from statefulset controller |
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 the redundant space in the beginning
pkg/kubectl/history.go
Outdated
@@ -175,7 +175,7 @@ func (h *DaemonSetHistoryViewer) ViewHistory(namespace, name string, revision in | |||
if !ok { | |||
return "", fmt.Errorf("unable to find the specified revision") | |||
} | |||
dsOfHistory, err := applyHistory(ds, history) | |||
dsOfHistory, err := applyHistory(versionedObj.(*extensionsv1beta1.DaemonSet), history) |
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 the check I suggested to make sure it won't panic
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 will check to ensure i didn't miss this in other places.
pkg/kubectl/history.go
Outdated
labelSelector = ss.Spec.Selector | ||
obj = ss | ||
default: | ||
return nil, nil, fmt.Errorf("undefined API object kind: %s", kind) |
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.
"unsupported", not undefined
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.
Ya, as the switch case is not exhaustive, unsupported
is a better word.
pkg/kubectl/rollback.go
Outdated
if err != nil { | ||
return "", fmt.Errorf("unable to find history controlled by DaemonSet %s: %v", ds.Name, err) | ||
} | ||
versionedDS, ok := versionedObj.(*externalextensions.DaemonSet) | ||
if !ok { | ||
return "", fmt.Errorf("unable to perform type assertion for DaemonSet %s", ds.Name) |
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.
If !ok
, it means that the value doesn't hold the type. So the error message should say that the thing is not of DaemonSet type. Something like "unexpected non-DaemonSet object returned: %v", versionedDS
.
Same for other type assertion error messages.
pkg/kubectl/rollback.go
Outdated
if h.Revision == toRevision { | ||
// If toRevision != 0, find the history with matching revision | ||
toHistory = h | ||
break |
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.
Since this is extracted into a function, you can replace the above 2 lines with return h
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.
SGTM
if toRevision == 0 { | ||
// If toRevision == 0, find the latest revision (2nd max) | ||
sort.Sort(historiesByRevision(allHistory)) | ||
toHistory = allHistory[len(allHistory)-2] |
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.
Since this is now a function, you should return an error when len(allHistory) <= 1
. The callers already checked it, but it's safer to check it again, so that future callers won't cause a panic (index out of range
).
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.
For len(allHistory) == 0
, we should return nil
.
For len(allHistory) == 1
, we should return allHistory[0]
.
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.
No, you have to return nil
for both cases. findHistory
finds the history of a specific revision number. If there's only one history (let's say it's rv 5), and I asked for rv 10, you should return me nil
instead of blindly return me whatever history you have.
Please add godoc for findHistory
as well.
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.
SGTM
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.
Or you can check if allHistory[0].Revision == toRevision
when the length is 1.
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 thought about this, but the original check is shorter:
if toRevision == 0 && len(allHistory) <= 1 {
pkg/kubectl/rollback.go
Outdated
return toHistory | ||
} | ||
|
||
func isPodTemplateConvertible(specTemplate *v1.PodTemplateSpec) (string, 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.
The function name is misleading. This function doesn't check if the given template is convertible, but converts and prints the v1 template in api template format. Name it "printTemplate" instead.
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.
Will printPodTemplate
be better?
pkg/kubectl/rollback.go
Outdated
} | ||
|
||
// findHistory checks whether controller revision exists for rollback purpose | ||
func findHistory(toRevision int64, allHistory []*appsv1beta1.ControllerRevision) *appsv1beta1.ControllerRevision { |
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.
An example godoc:
// findHistory 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.
SGTM
pkg/kubectl/rollback.go
Outdated
} | ||
|
||
// printPodTemplate converts pod template to unversioned before printing out the template | ||
func printPodTemplate(specTemplate *v1.PodTemplateSpec) (string, 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.
// printPodTemplate converts a given pod template into a human-readable string
We convert it first because DescribePodTemplate
only accepts internal representation of a pod template. Converting the template isn't the main thing this function does, but printing it is.
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 will change the godoc messages accordingly.
@crimsonfaith91: you cannot LGTM your own PR. In response to this:
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. |
4cbfab4
to
ebdbafd
Compare
/lgtm |
@@ -3041,6 +3044,58 @@ run_daemonset_history_tests() { | |||
set +o errexit | |||
} | |||
|
|||
run_statefulset_history_tests() { | |||
set -o nounset |
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.
Leave this set, and if you want to not fail on certain calls them put them in an "if"
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 follow the template of run_daemonset_history_tests
: https://github.com/kubernetes/kubernetes/blob/master/hack/make-rules/test-cmd-util.sh#L2998
If we are to remove this line for statefulset, we should also do so for daemonset.
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.
Ok
/approve no-issue |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crimsonfaith91, janetkuo, spxtr Associated issue: 49890 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 |
Automatic merge from submit-queue (batch tested with PRs 50033, 49988, 51132, 49674, 51207) |
What this PR does / why we need it: This PR implements StatefulSet kubectl rollout command, covering
history
,status
, andundo
.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #49890Special notes for your reviewer:
Release note: