Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TemplateOsLabel is a label that specifies the OS of the template TemplateOsLabel = "os.template.kubevirt.io/%s" // TemplateWorkloadLabel is a label that specifies the workload of the template TemplateWorkloadLabel = "workload.template.kubevirt.io/%s" // TemplateFlavorLabel is a label that specifies the flavor of the template TemplateFlavorLabel = "flavor.template.kubevirt.io/%s" // TemplateNameOsAnnotation is an annotation that specifies human readable os name TemplateNameOsAnnotation = "name.os.template.kubevirt.io/%s" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TemplateHandler ¶
type TemplateHandler struct {
// contains filtered or unexported fields
}
TemplateHandler attempts to process templates based on given parameters
func NewTemplateHandler ¶
func NewTemplateHandler(templateProvider TemplateProvider) *TemplateHandler
NewTemplateHandler creates new TemplateHandler
func (*TemplateHandler) ProcessTemplate ¶
func (f *TemplateHandler) ProcessTemplate(template *templatev1.Template, vmName *string, namespace string) (*kubevirtv1.VirtualMachine, error)
ProcessTemplate processes template with provided parameter values
type TemplateProvider ¶
type TemplateProvider interface { Find(namespace *string, os *string, workload *string, flavor *string) (*templatev1.TemplateList, error) Process(namespace string, vmName *string, template *templatev1.Template) (*templatev1.Template, error) }
TemplateProvider searches for and processes templates in Openshift
type Templates ¶
type Templates struct {
Client *tempclient.TemplateV1Client
}
Templates is responsible for finding and processing templates
func NewTemplateProvider ¶
func NewTemplateProvider(client *tempclient.TemplateV1Client) *Templates
NewTemplateProvider creates new TemplateProvider
func (*Templates) Find ¶
func (t *Templates) Find(namespace *string, os *string, workload *string, flavor *string) (*templatev1.TemplateList, error)
Find looks for a template based on given namespace and options
func (*Templates) Process ¶
func (t *Templates) Process(namespace string, vmName *string, template *templatev1.Template) (*templatev1.Template, error)
Process calls the openshift api to process parameters
Click to show internal directories.
Click to hide internal directories.