Skip to content

Commit 3719016

Browse files
committed
Made url dynamic
1 parent 650204b commit 3719016

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

cmd/login.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ import (
3131
"strings"
3232
)
3333

34-
const boundaryUrl = "https://controller.boundary.intercube.cloud"
35-
3634
var sshUsername = "root"
3735

3836
// loginCmd represents the login command
3937
var loginCmd = &cobra.Command{
4038
Use: "login",
4139
Short: "Login with your API token",
4240
Run: func(cmd *cobra.Command, args []string) {
41+
boundaryUrl := config.Login.InstanceUrl
42+
if boundaryUrl == "" {
43+
boundaryUrl = "https://controller.boundary.intercube.cloud"
44+
}
45+
4346
boundaryPath, err := exec.LookPath("boundary")
4447
if err != nil {
4548
panic("Boundary not installed on this machine. Download & install boundary before using the login function (https://learn.hashicorp.com/tutorials/boundary/getting-started-install)")

util/configuration.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ type MagentoBaseUrl struct {
1818
}
1919

2020
type Login struct {
21-
Username string
22-
Password string
23-
Scope string
24-
AuthMethod string `mapstructure:"auth_method"`
21+
Username string
22+
Password string
23+
Scope string
24+
AuthMethod string `mapstructure:"auth_method"`
25+
InstanceUrl string `mapstructure:"instance_url"`
2526
}

0 commit comments

Comments
 (0)