func (k *kubeResource) GetName() string {
	return k.Metadata.Name
}
interface support method
package kubectl
import (
	"errors"
	"fmt"
	"strings"
)
const (
	KindDeployment = "deployment"
	KindReplicaSet = "replicaset"
	KindNamespace = "namespace"
	KindPod = "pod"
	KindList = "list"
	PodStatusRunning = "Running"
	ClusterContextEnv = "CLUSTER_CONTEXT"
	strategyTypeRollingUpdate = "RollingUpdate"
)
type (
	resourceMetadata struct {
		Name       string            `yaml:"name"`
		Namespace  string            `yaml:"namespace"`
		Labels     map[string]string `yaml:"labels"`
		Generation int               `yaml:"generation"`
		UID        string            `yaml:"uid"`
	}
	resourceStatus struct {
		AvailableReplicas   int    `yaml:"availableReplicas"`    
		ObservedGeneration  int    `yaml:"observedGeneration"`   
		Replicas            int    `yaml:"replicas"`             
		UpdatedReplicas     int    `yaml:"updatedReplicas"`      
		UnavailableReplicas int    `yaml:"unavailableReplicas"`  
		Phase               string `yaml:"phase"`                
	}
	resourceContainer struct {
		Image string `yaml:"image"`  
		Name  string `yaml:"name"`
	}
	resourceContainerSpec struct {
		Containers []resourceContainer `yaml:"containers"`
	}
	resourceMetadataSpec struct {
		Labels map[string]string `yaml:"labels"`
	}
	resourceTemplate struct {
		Metadata resourceMetadataSpec  `yaml:"metadata"`
		Spec     resourceContainerSpec `yaml:"spec"`
	}
	resourceStrategyRolling struct {
		MaxSurge       int `yaml:"maxSurge"`
		MaxUnavailable int `yaml:"maxUnavailable"`
	}
	resourceStrategy struct {
		Type          string                  `yaml:"type"`
		RollingUpdate resourceStrategyRolling `yaml:"rollingUpdate"`
	}
	resourceSpec struct {
		Replicas int              `yaml:"replicas"`
		Template resourceTemplate `yaml:"template"`
		Strategy resourceStrategy `yaml:"strategy"`
	}
	kubeResourceList struct {
		Kind  string         `yaml:"kind"`
		Items []kubeResource `yaml:"items"`
	}
	kubeResource struct {
		Kind     string           `yaml:"kind"`
		Metadata resourceMetadata `yaml:"metadata"`
		Spec     resourceSpec     `yaml:"spec"`
		Status   resourceStatus   `yaml:"status"`
	}
	kubeResourceListInterface interface {
		GetItems() ResourceList
	}
	podList struct {
		Items []Pod `yaml:"items"`
	}
	deploymentList struct {
		Items []Deployment `yaml:"items"`
	}
	replicaSetList struct {
		Items []ReplicaSet `yaml:"items"`
	}
	namespaceList struct {
		Items []Namespace `yaml:"items"`
	}
	KubeResourceInterface interface {
		GetKind() string
		GetName() string
		ToDeployment() (*Deployment, error)
	}
	ResourceList []KubeResourceInterface
	Pod struct {
		Kind     string                `yaml:"kind"`
		Metadata resourceMetadata      `yaml:"metadata"`
		Spec     resourceContainerSpec `yaml:"spec"`
		Status   resourceStatus        `yaml:"status"`
	}
	Deployment struct {
		Kind     string           `yaml:"kind"`
		Metadata resourceMetadata `yaml:"metadata"`
		Spec     resourceSpec     `yaml:"spec"`
		Status   resourceStatus   `yaml:"status"`
	}
	ReplicaSet struct {
		Kind     string           `yaml:"kind"`
		Metadata resourceMetadata `yaml:"metadata"`
		Spec     resourceSpec     `yaml:"spec"`
		Status   resourceStatus   `yaml:"status"`
	}
	Namespace struct {
		Kind     string           `yaml:"kind"`
		Metadata resourceMetadata `yaml:"metadata"`
	}
)
func (rl ResourceList) FilteredByKind(kind string) ResourceList {
	result := make(ResourceList, 0)
	for _, obj := range rl {
		if obj.GetKind() == kind {
			result = append(result, obj)
		}
	}
	return result
}
func (rl ResourceList) ToDeploymentList() []Deployment {
	dlist := make([]Deployment, 0)
	for _, obj := range rl {
		if obj.GetKind() == KindDeployment {
			d, _ := obj.(*Deployment)
			dlist = append(dlist, *d)
		}
	}
	return dlist
}
func (rl ResourceList) ToReplicaSetList() []ReplicaSet {
	rlist := make([]ReplicaSet, 0)
	for _, obj := range rl {
		if obj.GetKind() == KindReplicaSet {
			r, _ := obj.(*ReplicaSet)
			rlist = append(rlist, *r)
		}
	}
	return rlist
}
func (rl ResourceList) ToNamespaceList() []Namespace {
	nlist := make([]Namespace, 0)
	for _, obj := range rl {
		if obj.GetKind() == KindNamespace {
			n, _ := obj.(*Namespace)
			nlist = append(nlist, *n)
		}
	}
	return nlist
}
func (rl ResourceList) ToPodList() []Pod {
	plist := make([]Pod, 0)
	for _, obj := range rl {
		if obj.GetKind() == KindPod {
			p, _ := obj.(*Pod)
			plist = append(plist, *p)
		}
	}
	return plist
}
func (k *kubeResource) GetKind() string {
	return strings.ToLower(k.Kind)
}