diff --git a/environment/env.go b/environment/env.go new file mode 100644 index 0000000..25079b4 --- /dev/null +++ b/environment/env.go @@ -0,0 +1,7 @@ +package environment + +// Environment Variables that are used. +// These environment variables need to be set before launching elektron. + +// Environment Variable to store the password for username="rapl" on the nodes in the cluster. +var RaplPassword = "RAPL_PSSWD" diff --git a/rapl/cap.go b/rapl/cap.go index 6b5ec2f..dd57a49 100644 --- a/rapl/cap.go +++ b/rapl/cap.go @@ -4,6 +4,8 @@ import ( "github.com/pkg/errors" "golang.org/x/crypto/ssh" "strconv" + "os" + elekEnv "bitbucket.org/sunybingcloud/elektron/environment" ) func Cap(host, username string, percentage float64) error { @@ -15,8 +17,8 @@ func Cap(host, username string, percentage float64) error { sshConfig := &ssh.ClientConfig{ User: username, Auth: []ssh.AuthMethod{ - // TODO: CHANGE and MAKE THIS USE SSH KEY BEFORE MAKING PUBLIC!!!! - ssh.Password("pankajlikesdanceswithwolves#!@#"), + // TODO: CHANGE and MAKE THIS USE SSH KEY!!!! + ssh.Password(os.Getenv(elekEnv.RaplPassword)), }, }