mirror of https://github.com/k3s-io/k3s
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 ```pull/6/head
commit
8064930037
|
@ -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, "Provisioner:\t%s\n", sc.Provisioner)
|
||||
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 {
|
||||
DescribeEvents(events, w)
|
||||
}
|
||||
|
|
|
@ -819,6 +819,7 @@ func TestDescribeCluster(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDescribeStorageClass(t *testing.T) {
|
||||
reclaimPolicy := api.PersistentVolumeReclaimRetain
|
||||
f := fake.NewSimpleClientset(&storage.StorageClass{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "foo",
|
||||
|
@ -832,6 +833,7 @@ func TestDescribeStorageClass(t *testing.T) {
|
|||
"param1": "value1",
|
||||
"param2": "value2",
|
||||
},
|
||||
ReclaimPolicy: &reclaimPolicy,
|
||||
})
|
||||
s := StorageClassDescriber{f}
|
||||
out, err := s.Describe("", "foo", printers.DescriberSettings{ShowEvents: true})
|
||||
|
|
Loading…
Reference in New Issue