cleaning up
parent
c8084e43b8
commit
147a646e6a
|
|
@ -130,20 +130,22 @@ func (b *Base) List(ns string) (Columnars, error) {
|
||||||
// Describe a given resource.
|
// Describe a given resource.
|
||||||
func (b *Base) Describe(kind, pa string) (string, error) {
|
func (b *Base) Describe(kind, pa string) (string, error) {
|
||||||
mapping, err := k8s.RestMapping.Find(kind)
|
mapping, err := k8s.RestMapping.Find(kind)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
resource, ok := b.Resource.(*k8s.Resource)
|
return b.doDescribe(pa, mapping)
|
||||||
if !ok {
|
}
|
||||||
log.Debug().Msgf("resource not a (*k8s.Resource) and %s", err)
|
|
||||||
return "", fmt.Errorf("resource not a (*k8s.Resource) and %s", err)
|
resource, ok := b.Resource.(*k8s.Resource)
|
||||||
}
|
if !ok {
|
||||||
g, v, n := resource.GetInfo()
|
log.Debug().Msgf("resource not a (*k8s.Resource) and %s", err)
|
||||||
mapper := k8s.RestMapper{Connection: b.Connection}
|
return "", fmt.Errorf("resource not a (*k8s.Resource) and %s", err)
|
||||||
var e error
|
}
|
||||||
mapping, e = mapper.ResourceFor(fmt.Sprintf("%s.%s.%s", n, v, g))
|
g, v, n := resource.GetInfo()
|
||||||
if e != nil {
|
mapper := k8s.RestMapper{Connection: b.Connection}
|
||||||
log.Debug().Err(e).Msgf("Unable to find mapper for %s %s", kind, pa)
|
var e error
|
||||||
return "", e
|
mapping, e = mapper.ResourceFor(fmt.Sprintf("%s.%s.%s", n, v, g))
|
||||||
}
|
if e != nil {
|
||||||
|
log.Debug().Err(e).Msgf("Unable to find mapper for %s %s", kind, pa)
|
||||||
|
return "", e
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.doDescribe(pa, mapping)
|
return b.doDescribe(pa, mapping)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue