Skip to content

Commit e9ad5c8

Browse files
author
Quentin Perez
committed
Remove scaleway_api_endpoint
1 parent 98c7c43 commit e9ad5c8

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

pkg/cli/main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ func Start(rawArgs []string, streams *commands.Streams) (int, error) {
5050
return 1, fmt.Errorf("unable to open .scwrc config file: %v", cfgErr)
5151
}
5252

53-
if config != nil {
54-
defaultComputeAPI := os.Getenv("scaleway_api_endpoint")
55-
if defaultComputeAPI == "" {
56-
defaultComputeAPI = config.ComputeAPI
57-
}
58-
}
59-
6053
if *flVersion {
6154
fmt.Fprintf(streams.Stderr, "scw version %s, build %s\n", scwversion.VERSION, scwversion.GITCOMMIT)
6255
return 0, nil

pkg/commands/info.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"github.com/kardianos/osext"
1313

14+
"github.com/scaleway/scaleway-cli/pkg/api"
1415
"github.com/scaleway/scaleway-cli/pkg/config"
1516
)
1617

@@ -25,7 +26,7 @@ func RunInfo(ctx CommandContext, args InfoArgs) error {
2526

2627
fmt.Fprintf(ctx.Stdout, "Organization:\t\t%s\n", ctx.API.Organization)
2728
// FIXME: add partially-masked token
28-
fmt.Fprintf(ctx.Stdout, "API Endpoint:\t\t%s\n", ctx.Getenv("scaleway_api_endpoint"))
29+
fmt.Fprintf(ctx.Stdout, "API Endpoint:\t\t%s\n", api.ComputeAPI)
2930
configPath, _ := config.GetConfigFilePath()
3031
fmt.Fprintf(ctx.Stdout, "RC file:\t\t%s\n", configPath)
3132
fmt.Fprintf(ctx.Stdout, "User:\t\t\t%s\n", ctx.Getenv("USER"))

pkg/config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ func GetConfig() (*Config, error) {
8383
config.AccountAPI = "https://account.scaleway.com"
8484
config.Save()
8585
}
86-
if os.Getenv("scaleway_api_endpoint") == "" {
87-
os.Setenv("scaleway_api_endpoint", config.ComputeAPI)
88-
}
8986
return &config, nil
9087
}
9188

0 commit comments

Comments
 (0)