injector/test: remove unused var and change test dir prefix
Removes an unused pkg variable and changes the prefix
for the output test directory so it can be easily removed.
/tmp might contain other dirs starting with `envoy`, so deleting
by the existing prefix is not desirable.
@@ -21,14 +21,8 @@ const directoryForExpectationsYAML = "../../tests/envoy_xds_expectations/"
var log = logger.New("sidecar-injector")
-var tempDir string
-
func getTempDir() string {
- if tempDir != "" {
- return tempDir
- }
-
- dir, err := ioutil.TempDir("", "envoy")
+ dir, err := ioutil.TempDir("", "osm_test_envoy")
if err != nil {
log.Fatal().Err(err).Msg("Error creating temp directory")
}
