Commit 80649300 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #51607 from xingzhou/sc-newfield

Automatic merge from submit-queue (batch tested with PRs 51438, 52182, 51607, 47912, 51595). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. Add `ReclaimPolicy` field to `kubectl describe storageclass` output. Add `ReclaimPolicy` field to `kubectl describe storageclass` output. PR https://github.com/kubernetes/kubernetes/pull/47987 added `ReclaimPolicy` field to StorageClass. **Release note**: ```release-note None ```
parents d2cf4d01 957cc8f5
...@@ -3128,6 +3128,9 @@ func describeStorageClass(sc *storage.StorageClass, events *api.EventList) (stri ...@@ -3128,6 +3128,9 @@ func describeStorageClass(sc *storage.StorageClass, events *api.EventList) (stri
w.Write(LEVEL_0, "Annotations:\t%s\n", labels.FormatLabels(sc.Annotations)) w.Write(LEVEL_0, "Annotations:\t%s\n", labels.FormatLabels(sc.Annotations))
w.Write(LEVEL_0, "Provisioner:\t%s\n", sc.Provisioner) w.Write(LEVEL_0, "Provisioner:\t%s\n", sc.Provisioner)
w.Write(LEVEL_0, "Parameters:\t%s\n", labels.FormatLabels(sc.Parameters)) w.Write(LEVEL_0, "Parameters:\t%s\n", labels.FormatLabels(sc.Parameters))
if sc.ReclaimPolicy != nil {
w.Write(LEVEL_0, "ReclaimPolicy:\t%s\n", *sc.ReclaimPolicy)
}
if events != nil { if events != nil {
DescribeEvents(events, w) DescribeEvents(events, w)
} }
......
...@@ -819,6 +819,7 @@ func TestDescribeCluster(t *testing.T) { ...@@ -819,6 +819,7 @@ func TestDescribeCluster(t *testing.T) {
} }
func TestDescribeStorageClass(t *testing.T) { func TestDescribeStorageClass(t *testing.T) {
reclaimPolicy := api.PersistentVolumeReclaimRetain
f := fake.NewSimpleClientset(&storage.StorageClass{ f := fake.NewSimpleClientset(&storage.StorageClass{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "foo", Name: "foo",
...@@ -832,6 +833,7 @@ func TestDescribeStorageClass(t *testing.T) { ...@@ -832,6 +833,7 @@ func TestDescribeStorageClass(t *testing.T) {
"param1": "value1", "param1": "value1",
"param2": "value2", "param2": "value2",
}, },
ReclaimPolicy: &reclaimPolicy,
}) })
s := StorageClassDescriber{f} s := StorageClassDescriber{f}
out, err := s.Describe("", "foo", printers.DescriberSettings{ShowEvents: true}) out, err := s.Describe("", "foo", printers.DescriberSettings{ShowEvents: true})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment