// WriteAssociatedSecret prints the secret data associated with a binding.
WriteAssociatedSecret prints the secret data associated with a binding.
// WriteAssociatedSecret prints the secret data associated with a binding .
func WriteAssociatedSecret(w io.Writer, secret *v1.Secret, err error, showSecrets bool) {
	if secret == nil && err == nil {
		return
	}
	fmt.Fprintln(w, "\nSecret Data:")
	if err != nil {
		fmt.Fprintf(w, "  %s", err.Error())
		return
	}
	keys := make([]string, 0, len(secret.Data))
	for key := range secret.Data {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	t := NewDetailsTable(w)
	for _, key := range keys {
		value := secret.Data[key]
		if showSecrets {
			t.Append([]string{key, string(value)})
		} else {
			t.Append([]string{key, fmt.Sprintf("%d bytes", len(value))})
		}
	}
	t.Render()
}
func WriteAssociatedSecret ( w io . Writer , secret * v1 . Secret , err error , showSecrets bool ) { if secret == nil && err == nil { return } fmt . Fprintln ( w , " \n " ) if err != nil { fmt . Fprintf ( w , " " , err . Error ( ) ) return } keys := make ( [ ] string , 0 , len ( secret . Data ) ) for key := range secret . Data { keys = append ( keys , key ) } sort . Strings ( keys ) t := NewDetailsTable ( w ) for _ , key := range keys { value := secret . Data [ key ] if showSecrets { t . Append ( [ ] string { key , string ( value ) } ) } else { t . Append ( [ ] string { key , fmt . Sprintf ( " " , len ( value ) ) } ) } } t . Render ( ) }
WriteAssociatedSecret prints the secret data associated with a binding.
WriteAssociatedSecret prints the secret data associated with a binding .
// Don't print anything the secret isn't ready yet // We should have been able to find a secret but couldn't for some reason, // warn about it without blowing up the entire command.