MCPcopy Create free account
hub / github.com/helm/helm / buildPluginConfig

Function buildPluginConfig

internal/plugin/runtime_extismv1.go:249–278  ·  view source on GitHub ↗
(input *Input, r *RuntimeExtismV1)

Source from the content-addressed store, hash-verified

247}
248
249func buildPluginConfig(input *Input, r *RuntimeExtismV1) extism.PluginConfig {
250 mc := wazero.NewModuleConfig().
251 WithSysWalltime()
252 if input.Stdin != nil {
253 mc = mc.WithStdin(input.Stdin)
254 }
255 if input.Stdout != nil {
256 mc = mc.WithStdout(input.Stdout)
257 }
258 if input.Stderr != nil {
259 mc = mc.WithStderr(input.Stderr)
260 }
261 if len(input.Env) > 0 {
262 env := ParseEnv(input.Env)
263 for k, v := range env {
264 mc = mc.WithEnv(k, v)
265 }
266 }
267
268 config := extism.PluginConfig{
269 ModuleConfig: mc,
270 RuntimeConfig: wazero.NewRuntimeConfigCompiler().
271 WithCloseOnContextDone(true).
272 WithCompilationCache(r.CompilationCache),
273 EnableWasi: true,
274 EnableHttpResponseHeaders: true,
275 }
276
277 return config
278}
279
280func buildHostFunctions(hostFunctions map[string]extism.HostFunction, rc *RuntimeConfigExtismV1) ([]extism.HostFunction, error) {
281 result := make([]extism.HostFunction, len(rc.HostFunctions))

Callers 1

InvokeMethod · 0.85

Calls 1

ParseEnvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…