(tpl string, context any)
| 72 | } |
| 73 | |
| 74 | func 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 | |
| 88 | func RenderRunnerInstallWrapper(ctx context.Context, osType commonParams.OSType, metadataURL, token string) ([]byte, error) { |
| 89 | tmpl, err := template.ParseFS(Userdata, "userdata/*_wrapper.tmpl") |
no test coverage detected