MCPcopy Create free account
hub / github.com/cloudbase/garm / RenderRunnerInstallScript

Function RenderRunnerInstallScript

internal/templates/templates.go:74–86  ·  view source on GitHub ↗
(tpl string, context any)

Source from the content-addressed store, hash-verified

72}
73
74func RenderRunnerInstallScript(tpl string, context any) ([]byte, error) {
75 t, err := template.New("").Parse(tpl)
76 if err != nil {
77 return nil, fmt.Errorf("failed to parse template: %w", err)
78 }
79
80 var buf bytes.Buffer
81 if err := t.Execute(&buf, context); err != nil {
82 return nil, fmt.Errorf("failed to execute template: %w", err)
83 }
84 data := buf.String()
85 return []byte(data), nil
86}
87
88func RenderRunnerInstallWrapper(ctx context.Context, osType commonParams.OSType, metadataURL, token string) ([]byte, error) {
89 tmpl, err := template.ParseFS(Userdata, "userdata/*_wrapper.tmpl")

Callers 1

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected