MCPcopy Index your code
hub / github.com/devspace-sh/devspace / SetPluginConfig

Function SetPluginConfig

pkg/devspace/plugin/hook.go:132–157  ·  view source on GitHub ↗
(config config.Config)

Source from the content-addressed store, hash-verified

130var configOnce sync.Once
131
132func SetPluginConfig(config config.Config) {
133 configOnce.Do(func() {
134 pluginContextLock.Lock()
135 defer pluginContextLock.Unlock()
136
137 if config == nil || config.Config() == nil {
138 return
139 }
140
141 configBytes, err := yaml.Marshal(config.Config())
142 if err != nil {
143 logErrorf("error marshalling devspace.yaml: %v", err)
144 return
145 }
146
147 pluginContext[ConfigEnv] = string(configBytes)
148 pluginContext[ConfigPathEnv] = config.Path()
149
150 varsBytes, err := json.Marshal(config.Variables())
151 if err != nil {
152 logErrorf("error marshalling config vars: %v", err)
153 return
154 }
155 pluginContext[ConfigVarsEnv] = string(varsBytes)
156 })
157}
158
159func LogExecutePluginHookWithContext(extraEnv map[string]interface{}, events ...string) {
160 err := ExecutePluginHookWithContext(extraEnv, events...)

Callers 1

LoadWithParserMethod · 0.92

Calls 6

ConfigInterface · 0.92
logErrorfFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
PathMethod · 0.65
VariablesMethod · 0.65

Tested by

no test coverage detected