code cleanup
parent
30410e80eb
commit
83556dcc51
|
|
@ -22,13 +22,14 @@ var RestMapping = &RestMapper{}
|
|||
type RestMapper struct{}
|
||||
|
||||
// Find a mapping given a resource name.
|
||||
func (*RestMapper) Find1(res string) (*meta.RESTMapping, error) {
|
||||
func (*RestMapper) Find(res string) (*meta.RESTMapping, error) {
|
||||
if m, ok := resMap[res]; ok {
|
||||
return m, nil
|
||||
}
|
||||
return nil, fmt.Errorf("no mapping for resource %s", res)
|
||||
}
|
||||
|
||||
// ToRESTMapper map resources to kind, and map kind and version to interfaces for manipulating K8s objects.
|
||||
func (*RestMapper) ToRESTMapper() (meta.RESTMapper, error) {
|
||||
rc := conn.restConfigOrDie()
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func (b *Base) List(ns string) (Columnars, error) {
|
|||
func (b *Base) Describe(kind, pa string) (string, error) {
|
||||
ns, n := namespaced(pa)
|
||||
|
||||
mapping, err := k8s.RestMapping.Find1(kind)
|
||||
mapping, err := k8s.RestMapping.Find(kind)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue