Add ServiceAccount API type, client
This commit is contained in:
@@ -255,6 +255,7 @@ var limitRangeColumns = []string{"NAME"}
|
||||
var resourceQuotaColumns = []string{"NAME"}
|
||||
var namespaceColumns = []string{"NAME", "LABELS", "STATUS"}
|
||||
var secretColumns = []string{"NAME", "TYPE", "DATA"}
|
||||
var serviceAccountColumns = []string{"NAME", "SECRETS"}
|
||||
var persistentVolumeColumns = []string{"NAME", "LABELS", "CAPACITY", "ACCESSMODES", "STATUS", "CLAIM"}
|
||||
var persistentVolumeClaimColumns = []string{"NAME", "LABELS", "STATUS", "VOLUME"}
|
||||
var componentStatusColumns = []string{"NAME", "STATUS", "MESSAGE", "ERROR"}
|
||||
@@ -283,6 +284,8 @@ func (h *HumanReadablePrinter) addDefaultHandlers() {
|
||||
h.Handler(namespaceColumns, printNamespaceList)
|
||||
h.Handler(secretColumns, printSecret)
|
||||
h.Handler(secretColumns, printSecretList)
|
||||
h.Handler(serviceAccountColumns, printServiceAccount)
|
||||
h.Handler(serviceAccountColumns, printServiceAccountList)
|
||||
h.Handler(persistentVolumeClaimColumns, printPersistentVolumeClaim)
|
||||
h.Handler(persistentVolumeClaimColumns, printPersistentVolumeClaimList)
|
||||
h.Handler(persistentVolumeColumns, printPersistentVolume)
|
||||
@@ -596,6 +599,21 @@ func printSecretList(list *api.SecretList, w io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func printServiceAccount(item *api.ServiceAccount, w io.Writer) error {
|
||||
_, err := fmt.Fprintf(w, "%s\t%d\n", item.Name, len(item.Secrets))
|
||||
return err
|
||||
}
|
||||
|
||||
func printServiceAccountList(list *api.ServiceAccountList, w io.Writer) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printServiceAccount(&item, w); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func printNode(node *api.Node, w io.Writer) error {
|
||||
conditionMap := make(map[api.NodeConditionType]*api.NodeCondition)
|
||||
NodeAllConditions := []api.NodeConditionType{api.NodeReady}
|
||||
|
Reference in New Issue
Block a user