func (wp *Wordpress) HomeURL(subPaths ...string) string {
	scheme := "http"
	if len(wp.Spec.TLSSecretRef) > 0 {
		scheme = "https"
	}
	paths := []string{"/"}
	if len(wp.Spec.Routes) > 0 {
		paths = append(paths, wp.Spec.Routes[0].Path)
	}
	paths = append(paths, subPaths...)
	p := path.Join(paths...)
	if p == "/" {
		p = ""
	}
	return fmt.Sprintf("%s://%s%s", scheme, wp.MainDomain(), p)
}
HomeURL returns the WP_HOMEURL (e.g. http://example.com/)
package wordpress
import (
	"fmt"
	"path"
	"github.com/cooleo/slugify"
	"k8s.io/apimachinery/pkg/labels"
	wordpressv1alpha1 "github.com/bitpoke/wordpress-operator/pkg/apis/wordpress/v1alpha1"
)
type Wordpress struct {
	*wordpressv1alpha1.Wordpress
}
type component struct {
	name       string  
	objNameFmt string
	objName    string
}
var (
	WordpressSecret = component{name: "web", objNameFmt: "%s-wp"}
	WordpressDeployment = component{name: "web", objNameFmt: "%s"}
	WordpressCron = component{name: "cron", objNameFmt: "%s-wp-cron"}
	WordpressDBUpgrade = component{name: "upgrade", objNameFmt: "%s-upgrade"}
	WordpressService = component{name: "web", objNameFmt: "%s"}
	WordpressIngress = component{name: "web", objNameFmt: "%s"}
	WordpressCodePVC = component{name: "code", objNameFmt: "%s-code"}
	WordpressMediaPVC = component{name: "media", objNameFmt: "%s-media"}
)
func New(obj *wordpressv1alpha1.Wordpress) *Wordpress {
	return &Wordpress{obj}
}
func (wp *Wordpress) Unwrap() *wordpressv1alpha1.Wordpress {
	return wp.Wordpress
}
func (wp *Wordpress) Labels() labels.Set {
	partOf := "wordpress"
	if wp.ObjectMeta.Labels != nil && len(wp.ObjectMeta.Labels["app.kubernetes.io/part-of"]) > 0 {
		partOf = wp.ObjectMeta.Labels["app.kubernetes.io/part-of"]
	}
	labels := labels.Set{
		"app.kubernetes.io/name":     "wordpress",
		"app.kubernetes.io/part-of":  partOf,
		"app.kubernetes.io/instance": wp.ObjectMeta.Name,
	}
	return labels
}
func (wp *Wordpress) ComponentLabels(component component) labels.Set {
	l := wp.Labels()
	l["app.kubernetes.io/component"] = component.name
	if component == WordpressDBUpgrade {
		l["wordpress.presslabs.org/upgrade-for"] = wp.ImageVersion()
	}
	return l
}
func (wp *Wordpress) ComponentName(component component) string {
	name := component.objName
	if len(component.objNameFmt) > 0 {
		name = fmt.Sprintf(component.objNameFmt, wp.ObjectMeta.Name)
	}
	if component == WordpressDBUpgrade {
		name = fmt.Sprintf("%s-for-%s", name, wp.ImageVersion())
	}
	return name
}
func (wp *Wordpress) ImageVersion() string {
	return slugify.Slugify(wp.Spec.Image)
}
func (wp *Wordpress) WebPodLabels() labels.Set {
	l := wp.Labels()
	l["app.kubernetes.io/component"] = "web"
	return l
}
func (wp *Wordpress) JobPodLabels() labels.Set {
	l := wp.Labels()
	l["app.kubernetes.io/component"] = "wp-cli"
	return l
}
func (wp *Wordpress) MainDomain() string {
	if len(wp.Spec.Routes) > 0 {
		return wp.Spec.Routes[0].Domain
	}
	return fmt.Sprintf("%s.%s.svc", wp.ComponentName(WordpressService), wp.Namespace)
}