// integrationTestSetup creates a new namespace to play in, and returns the name of that namespace
// together with a function to tear it down afterwards.
// It also deploys the proxy in that namespace, with the given flags
integrationTestSetup creates a new namespace to play in, and returns the name of that namespace
together with a function to tear it down afterwards.
It also deploys the proxy in that namespace, with the given flags
// integrationTestSetup creates a new namespace to play in and returns the name of that namespace // together with a function to tear it down afterwards . // It also deploys the proxy in that namespace with the given flags
func integrationTestSetup(t *testing.T, name string) (string, func()) {
	if _, err := os.Stat(tmpRoot); os.IsNotExist(err) {
		require.NoError(t, os.Mkdir(tmpRoot, os.ModePerm))
	}
	tmpDir, err := ioutil.TempDir(tmpRoot, name+"-")
	require.NoError(t, err)
	namespace := createNamespace(t, name)
	manifestPath := renderProxyDaemonSetManifest(t, tmpDir, namespace)
	applyManifest(t, manifestPath)
	tearDownFunc := func() {
		deleteManifest(t, manifestPath)
		deleteNamespace(t, namespace)
		require.NoError(t, os.RemoveAll(tmpDir))
	}
	return namespace, tearDownFunc
}
func integrationTestSetup ( t * testing . T , name string ) ( string , func ( ) ) { if _ , err := os . Stat ( tmpRoot ) ; os . IsNotExist ( err ) { require . NoError ( t , os . Mkdir ( tmpRoot , os . ModePerm ) ) } tmpDir , err := ioutil . TempDir ( tmpRoot , name + " " ) require . NoError ( t , err ) namespace := createNamespace ( t , name ) manifestPath := renderProxyDaemonSetManifest ( t , tmpDir , namespace ) applyManifest ( t , manifestPath ) tearDownFunc := func ( ) { deleteManifest ( t , manifestPath ) deleteNamespace ( t , namespace ) require . NoError ( t , os . RemoveAll ( tmpDir ) ) } return namespace , tearDownFunc }
integrationTestSetup creates a new namespace to play in, and returns the name of that namespace
together with a function to tear it down afterwards.
integrationTestSetup creates a new namespace to play in and returns the name of that namespace together with a function to tear it down afterwards .