Skip to content

Commit dcd0755

Browse files
authored
Merge pull request kubernetes#85846 from akhinos/fix-describe-partition
Fix: describe of statefulset prints pointer not value
2 parents 1e252ce + 772dbbc commit dcd0755

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

staging/src/k8s.io/kubectl/pkg/describe/versioned/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,7 @@ func describeStatefulSet(ps *appsv1.StatefulSet, selector labels.Selector, event
31873187
if ps.Spec.UpdateStrategy.RollingUpdate != nil {
31883188
ru := ps.Spec.UpdateStrategy.RollingUpdate
31893189
if ru.Partition != nil {
3190-
w.Write(LEVEL_1, "Partition:\t%d\n", ru.Partition)
3190+
w.Write(LEVEL_1, "Partition:\t%d\n", *ru.Partition)
31913191
}
31923192
}
31933193

staging/src/k8s.io/kubectl/pkg/describe/versioned/describe_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,7 @@ func TestDescribeNode(t *testing.T) {
35443544
}
35453545

35463546
func TestDescribeStatefulSet(t *testing.T) {
3547-
var partition int32 = 2
3547+
var partition int32 = 2672
35483548
var replicas int32 = 1
35493549
fake := fake.NewSimpleClientset(&appsv1.StatefulSet{
35503550
ObjectMeta: metav1.ObjectMeta{
@@ -3575,7 +3575,7 @@ func TestDescribeStatefulSet(t *testing.T) {
35753575
t.Errorf("unexpected error: %v", err)
35763576
}
35773577
expectedOutputs := []string{
3578-
"bar", "foo", "Containers:", "mytest-image:latest", "Update Strategy", "RollingUpdate", "Partition",
3578+
"bar", "foo", "Containers:", "mytest-image:latest", "Update Strategy", "RollingUpdate", "Partition", "2672",
35793579
}
35803580
for _, o := range expectedOutputs {
35813581
if !strings.Contains(out, o) {

0 commit comments

Comments
 (0)