mirror of https://github.com/k3s-io/k3s
Show events when describing service accounts
Signed-off-by: Matt Rogers <mrogers@redhat.com>pull/6/head
parent
baf2f85e73
commit
c42c43a13f
|
@ -2173,10 +2173,15 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string, describerSett
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return describeServiceAccount(serviceAccount, tokens, missingSecrets)
|
var events *api.EventList
|
||||||
|
if describerSettings.ShowEvents {
|
||||||
|
events, _ = d.Core().Events(namespace).Search(api.Scheme, serviceAccount)
|
||||||
|
}
|
||||||
|
|
||||||
|
return describeServiceAccount(serviceAccount, tokens, missingSecrets, events)
|
||||||
}
|
}
|
||||||
|
|
||||||
func describeServiceAccount(serviceAccount *api.ServiceAccount, tokens []api.Secret, missingSecrets sets.String) (string, error) {
|
func describeServiceAccount(serviceAccount *api.ServiceAccount, tokens []api.Secret, missingSecrets sets.String, events *api.EventList) (string, error) {
|
||||||
return tabbedString(func(out io.Writer) error {
|
return tabbedString(func(out io.Writer) error {
|
||||||
w := NewPrefixWriter(out)
|
w := NewPrefixWriter(out)
|
||||||
w.Write(LEVEL_0, "Name:\t%s\n", serviceAccount.Name)
|
w.Write(LEVEL_0, "Name:\t%s\n", serviceAccount.Name)
|
||||||
|
@ -2228,6 +2233,10 @@ func describeServiceAccount(serviceAccount *api.ServiceAccount, tokens []api.Sec
|
||||||
w.WriteLine()
|
w.WriteLine()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if events != nil {
|
||||||
|
DescribeEvents(events, w)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue