func (r Release) Name() string {
	if r.SemVer != nil {
		return r.SemVer.Name
	}
	panic("No release type specified")
}
Name returns the name of the actual version.
package v1alpha1
import (
	"fmt"
	"github.com/manifoldco/heighliner/internal/k8sutils"
	"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type Release struct {
	OwnerReferences []metav1.OwnerReference `json:"ownerReference,omitempty"`
	Image string `json:"image"`
	ReleaseTime metav1.Time `json:"releaseTime"`
	SemVer *SemVerRelease `json:"semVer,omitempty"`
	Level SemVerLevel `json:"level"`
}
func (r Release) String() string {
	return fmt.Sprintf("%s-%s", r.SemVer.String(), r.ReleaseTime)
}
func (r Release) StreamName(prefix string) string {
	if r.SemVer != nil {
		switch r.Level {
		case SemVerLevelRelease:
			return prefix
		case SemVerLevelReleaseCandidate:
			return fmt.Sprintf("%s-rc", prefix)
		case SemVerLevelPreview:
			return fmt.Sprintf("%s-pr-%s", prefix, k8sutils.ShortHash(r.SemVer.Name, 8))
		default:
			panic("Unknown SemVerLevel")
		}
	}
	panic("No release type specified")
}
func (r Release) FullName(prefix string) string {
	if r.SemVer != nil {
		return fmt.Sprintf("%s-%s", r.StreamName(prefix), k8sutils.ShortHash(r.SemVer.Version, 8))
	}
	panic("No release type specified")
}