MCPcopy Index your code
hub / github.com/docker/cli / validateConfig

Function validateConfig

cli/command/plugin/create.go:30–41  ·  view source on GitHub ↗

validateConfig ensures that a valid config.json is available in the given path

(path string)

Source from the content-addressed store, hash-verified

28
29// validateConfig ensures that a valid config.json is available in the given path
30func validateConfig(path string) error {
31 dt, err := os.Open(filepath.Join(path, "config.json"))
32 if err != nil {
33 return err
34 }
35
36 m := plugin.Config{}
37 err = json.NewDecoder(dt).Decode(&m)
38 _ = dt.Close()
39
40 return err
41}
42
43// validateContextDir validates the given dir and returns its absolute path on success.
44func validateContextDir(contextDir string) (string, error) {

Callers 1

runCreateFunction · 0.70

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…