| 121 | } |
| 122 | |
| 123 | func copyLocalConfig(t testing.TB, configDir string) { |
| 124 | t.Helper() |
| 125 | |
| 126 | // copy local config.json if exists |
| 127 | localConfig := filepath.Join(os.Getenv("HOME"), ".docker", "config.json") |
| 128 | // if no config present just continue |
| 129 | if _, err := os.Stat(localConfig); err != nil { |
| 130 | // copy the local config.json to the test config dir |
| 131 | CopyFile(t, localConfig, filepath.Join(configDir, "config.json")) |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | // initializePlugins copies the necessary plugin files to the temporary config |
| 136 | // directory for the test. |