func (p newPersistentVolumeClaim) Status(meta map[string]string) (interfaces.ResourceStatus, error) {
	return persistentVolumeClaimStatus(p.Client, p.PersistentVolumeClaim.Name)
}
Status returns PVC status.
package resources
import (
	"log"
	"github.com/Mirantis/k8s-AppController/pkg/client"
	"github.com/Mirantis/k8s-AppController/pkg/interfaces"
	"github.com/Mirantis/k8s-AppController/pkg/report"
	corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
	"k8s.io/client-go/pkg/api/v1"
)
var persistentVolumeClaimParamFields = []string{
	"Spec",
}
type newPersistentVolumeClaim struct {
	Base
	PersistentVolumeClaim *v1.PersistentVolumeClaim
	Client                corev1.PersistentVolumeClaimInterface
}
type persistentVolumeClaimTemplateFactory struct{}
func (persistentVolumeClaimTemplateFactory) ShortName(definition client.ResourceDefinition) string {
	if definition.PersistentVolumeClaim == nil {
		return ""
	}
	return definition.PersistentVolumeClaim.Name
}
func (persistentVolumeClaimTemplateFactory) Kind() string {
	return "persistentvolumeclaim"
}
func (persistentVolumeClaimTemplateFactory) New(def client.ResourceDefinition, c client.Interface, gc interfaces.GraphContext) interfaces.Resource {
	return report.SimpleReporter{
		BaseResource: newPersistentVolumeClaim{
			Base: Base{def.Meta},
			PersistentVolumeClaim: parametrizeResource(def.PersistentVolumeClaim, gc, persistentVolumeClaimParamFields).(*v1.PersistentVolumeClaim),
			Client:                c.PersistentVolumeClaims(),
		}}
}
func (persistentVolumeClaimTemplateFactory) NewExisting(name string, c client.Interface, gc interfaces.GraphContext) interfaces.Resource {
	return report.SimpleReporter{BaseResource: existingPersistentVolumeClaim{Name: name, Client: c.PersistentVolumeClaims()}}
}
func persistentVolumeClaimKey(name string) string {
	return "persistentvolumeclaim/" + name
}
func (p newPersistentVolumeClaim) Key() string {
	return persistentVolumeClaimKey(p.PersistentVolumeClaim.Name)
}
func persistentVolumeClaimStatus(p corev1.PersistentVolumeClaimInterface, name string) (interfaces.ResourceStatus, error) {
	persistentVolumeClaim, err := p.Get(name)
	if err != nil {
		return interfaces.ResourceError, err
	}
	if persistentVolumeClaim.Status.Phase == v1.ClaimBound {
		return interfaces.ResourceReady, nil
	}
	return interfaces.ResourceNotReady, nil
}
func (p newPersistentVolumeClaim) Create() error {
	if err := checkExistence(p); err != nil {
		log.Println("Creating", p.Key())
		p.PersistentVolumeClaim, err = p.Client.Create(p.PersistentVolumeClaim)
		return err
	}
	return nil
}
func (p newPersistentVolumeClaim) Delete() error {
	return p.Client.Delete(p.PersistentVolumeClaim.Name, &v1.DeleteOptions{})
}