Documentation ¶
Index ¶
Constants ¶
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" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OSMapProvider ¶
OSMapProvider is responsible for getting the operating systems maps
type OSMaps ¶
OSMaps is responsible for getting the operating systems maps which contain mapping of GuestOS to common templates and mapping of osinfo to common templates
func NewOSMapProvider ¶
NewOSMapProvider creates new OSMapProvider
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