code cleanup

mine
derailed 2019-03-15 18:10:53 -06:00
parent 30410e80eb
commit 83556dcc51
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -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
}