Skip to content

Commit cc244eb

Browse files
committed
tweaks
Signed-off-by: Grant Linville <[email protected]>
1 parent 0b9fddf commit cc244eb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/credentials/store.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (s Store) Add(ctx context.Context, cred Credential) error {
112112
}
113113

114114
func (s Store) Remove(ctx context.Context, toolName string) error {
115-
if len(s.credCtxs) > 1 {
115+
if len(s.credCtxs) > 1 || first(s.credCtxs) == AllCredentialContexts {
116116
return fmt.Errorf("error: credential deletion is not supported when multiple credential contexts are provided")
117117
}
118118

@@ -160,7 +160,6 @@ func (s Store) List(ctx context.Context) ([]Credential, error) {
160160
}
161161

162162
// Go through the contexts in reverse order so that higher priority contexts override lower ones.
163-
// TODO - is this how we want to do it?
164163
credsByName := make(map[string]Credential)
165164
for i := len(s.credCtxs) - 1; i >= 0; i-- {
166165
for _, c := range credsByContext[s.credCtxs[i]] {

0 commit comments

Comments
 (0)