Show events when describing service accounts
Signed-off-by: Matt Rogers <mrogers@redhat.com>
This commit is contained in:
		@@ -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
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user