INNER CODE UNIT · Go

setupHomeDir

kubermatic/kubermatic · cmd/conformance-tester/main.go:248

func setupHomeDir(log *zap.SugaredLogger) (string, []byte, error) {
	// We'll set the env-var $HOME to this directory when executing the tests
	homeDir, err := os.MkdirTemp("/tmp", "e2e-home-")
	if err != nil {
		return "", nil, fmt.Errorf("failed to setup temporary home dir: %w", err)
	}
	log.Infof("Setting up temporary home directory with SSH keys at %s...", homeDir)

	if err := os.MkdirAll(path.Join(homeDir, ".ssh"), os.ModePerm); err != nil {
		return "", nil, err
	}

	// Setup temporary home dir with filepath.Join(os.Getenv("HOME"), ".ssh")
	// Make sure to create relevant ssh keys (because they are hardcoded in the e2e tests...). They must not be password protected
	log.Debug("Generating SSH keys...")
	// Private Key generation
	privateKey, err := rsa.GenerateKey(cryptorand.Reader, 4096)
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…