Skip to content

Commit

Permalink
don't read defaulft config if profile is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrar-Ahmed7 committed Feb 3, 2023
1 parent c3dab2f commit 7d6c489
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/one2nc/cloud-lens/internal"
"github.com/one2nc/cloud-lens/internal/config"
"github.com/one2nc/cloud-lens/internal/view"
Expand Down Expand Up @@ -50,11 +51,11 @@ func run(cmd *cobra.Command, args []string) {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: file})

//get config
cfg, err := config.Get()
// cfg, err := config.Get()
if err != nil {
panic(fmt.Sprintf("app get config failed -- %v", err))
}
sess, err := config.GetSession(profile, region, cfg.AwsConfig)
sess, err := config.GetSession(profile, region, *aws.NewConfig())
if err != nil {
panic(fmt.Sprintf("aws session init failed -- %v", err))
}
Expand Down

0 comments on commit 7d6c489

Please sign in to comment.