MCPcopy Create free account
hub / github.com/docker/secrets-engine / restoreConfig

Function restoreConfig

plugin/config.go:121–140  ·  view source on GitHub ↗
(p ExternalPlugin)

Source from the content-addressed store, hash-verified

119var errPluginNotLaunchedByEngine = errors.New("plugin not launched by secrets engine")
120
121func restoreConfig(p ExternalPlugin) (*cfg, error) {
122 cfgString := os.Getenv(api.PluginLaunchedByEngineVar)
123 if cfgString == "" {
124 return nil, errPluginNotLaunchedByEngine
125 }
126 c, err := ipc.NewPluginConfigFromEngineEnv(cfgString)
127 if err != nil {
128 return nil, err
129 }
130 conn, err := ipc.FromCustomCfg(c.Custom)
131 if err != nil {
132 return nil, err
133 }
134 return &cfg{
135 plugin: p,
136 name: c.Name,
137 conn: conn,
138 registrationTimeout: c.RegistrationTimeout,
139 }, nil
140}

Callers 2

Test_restoreConfigFunction · 0.85
newCfgFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_restoreConfigFunction · 0.68