func (p ExistingPetSet) Key() string {
	return petsetKey(p.Name)
}
Key returns PetSet name
package resources
import (
	"log"
	"github.com/Mirantis/k8s-AppController/pkg/client"
	appsalpha1 "github.com/Mirantis/k8s-AppController/pkg/client/petsets/apis/apps/v1alpha1"
	"github.com/Mirantis/k8s-AppController/pkg/client/petsets/typed/apps/v1alpha1"
	"github.com/Mirantis/k8s-AppController/pkg/interfaces"
	"github.com/Mirantis/k8s-AppController/pkg/report"
)
var petSetParamFields = []string{
	"Spec.Template.Spec.Containers.Name",
	"Spec.Template.Spec.Containers.Env",
	"Spec.Template.Spec.InitContainers.Name",
	"Spec.Template.Spec.InitContainers.Env",
	"Spec.Template.ObjectMeta",
}
type PetSet struct {
	Base
	PetSet    *appsalpha1.PetSet
	Client    v1alpha1.PetSetInterface
	APIClient client.Interface
}
type petSetTemplateFactory struct{}
func (petSetTemplateFactory) ShortName(definition client.ResourceDefinition) string {
	if definition.PetSet == nil {
		return ""
	}
	return definition.PetSet.Name
}
func (petSetTemplateFactory) Kind() string {
	return "petset"
}
func (petSetTemplateFactory) New(def client.ResourceDefinition, c client.Interface, gc interfaces.GraphContext) interfaces.Resource {
	petSet := parametrizeResource(def.PetSet, gc, petSetParamFields).(*appsalpha1.PetSet)
	return newPetSet(petSet, c.PetSets(), c, def.Meta)
}
func (petSetTemplateFactory) NewExisting(name string, c client.Interface, gc interfaces.GraphContext) interfaces.Resource {
	return report.SimpleReporter{BaseResource: ExistingPetSet{Name: name, Client: c.PetSets(), APIClient: c}}
}
func petsetStatus(p v1alpha1.PetSetInterface, name string, apiClient client.Interface) (interfaces.ResourceStatus, error) {
	ps, err := p.Get(name)
	if err != nil {
		return interfaces.ResourceError, err
	}
	return podsStateFromLabels(apiClient, ps.Spec.Template.ObjectMeta.Labels)
}
func petsetKey(name string) string {
	return "petset/" + name
}
func (p PetSet) Key() string {
	return petsetKey(p.PetSet.Name)
}
func (p PetSet) Create() error {
	if err := checkExistence(p); err != nil {
		log.Println("Creating", p.Key())
		_, err = p.Client.Create(p.PetSet)
		return err
	}
	return nil
}
func (p PetSet) Delete() error {
	return p.Client.Delete(p.PetSet.Name, nil)
}
func (p PetSet) Status(meta map[string]string) (interfaces.ResourceStatus, error) {
	return petsetStatus(p.Client, p.PetSet.Name, p.APIClient)
}
func newPetSet(petset *appsalpha1.PetSet, client v1alpha1.PetSetInterface, apiClient client.Interface, meta map[string]interface{}) interfaces.Resource {
	return report.SimpleReporter{BaseResource: PetSet{Base: Base{meta}, PetSet: petset, Client: client, APIClient: apiClient}}
}
type ExistingPetSet struct {
	Base
	Name      string
	Client    v1alpha1.PetSetInterface
	APIClient client.Interface
}