Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cmd/auth/profiles.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,10 +29,11 @@ func (c *profileMetadata) IsEmpty() bool {
return c.Host == "" && c.AccountID == ""
}

func (c *profileMetadata) Load(ctx context.Context, skipValidate bool) {
func (c *profileMetadata) Load(ctx context.Context, configFilePath string, skipValidate bool) {
cfg := &config.Config{
Loaders: []config.Loader{config.ConfigFile},
Profile: c.Name,
Loaders: []config.Loader{config.ConfigFile},
ConfigFile: configFilePath,
Profile: c.Name,
}
_ = cfg.EnsureResolved()
if cfg.IsAws() {
Expand DownExpand Up@@ -117,7 +118,7 @@ func newProfilesCommand() *cobra.Command {
go func() {
ctx := cmd.Context()
t := time.Now()
profile.Load(ctx, skipValidate)
profile.Load(ctx, iniFile.Path(), skipValidate)
log.Debugf(ctx, "Profile %q took %s to load", profile.Name, time.Since(t))
wg.Done()
}()
Expand Down
2 changes: 1 addition & 1 deletion cmd/auth/profiles_test.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ func TestProfiles(t *testing.T) {

// Load the profile
profile := &profileMetadata{Name: "profile1"}
profile.Load(ctx, true)
profile.Load(ctx, configFile, true)

// Check the profile
assert.Equal(t, "profile1", profile.Name)
Expand Down