kubectl get does not count binaryData keys on ConfigMap

Running `kubectl get` against a configmap with only binary keys
returned a `0` for the number of keys which is incorrect.
This commit is contained in:
Clayton Coleman 2019-07-31 17:19:52 -04:00
parent a9a68c5e44
commit bc6b735aa2
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3

View File

@ -1696,7 +1696,7 @@ func printConfigMap(obj *api.ConfigMap, options printers.PrintOptions) ([]metav1
row := metav1beta1.TableRow{ row := metav1beta1.TableRow{
Object: runtime.RawExtension{Object: obj}, Object: runtime.RawExtension{Object: obj},
} }
row.Cells = append(row.Cells, obj.Name, int64(len(obj.Data)), translateTimestampSince(obj.CreationTimestamp)) row.Cells = append(row.Cells, obj.Name, int64(len(obj.Data)+len(obj.BinaryData)), translateTimestampSince(obj.CreationTimestamp))
return []metav1beta1.TableRow{row}, nil return []metav1beta1.TableRow{row}, nil
} }