mirror of https://github.com/kubernetes/kops.git
DebugPrint should handle the case where the resource cannot be found
We print "unknown resource" instead Issue #22
This commit is contained in:
parent
7b57329f34
commit
2f84573e2b
|
|
@ -40,6 +40,11 @@ func DebugPrint(o interface{}) string {
|
|||
if o == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
if rh, ok := o.(*ResourceHolder); ok {
|
||||
if rh.Resource == nil {
|
||||
return fmt.Sprintf("unknown resource %q", rh.Name)
|
||||
}
|
||||
}
|
||||
if resource, ok := o.(Resource); ok {
|
||||
s, err := ResourceAsString(resource)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue