mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
Add ReclaimPolicy
field to kubectl describe storageclass
output.
Add `ReclaimPolicy` field to `kubectl describe storageclass` output.
This commit is contained in:
parent
5030391c07
commit
957cc8f593
@ -3111,6 +3111,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
Block a user