-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
In the following code block:
oras-go/registry/remote/credentials/store.go
Lines 136 to 152 in 8d139f0
// Put saves credentials into the store for the given server address. | |
// Put returns ErrPlaintextPutDisabled if native store is not available and | |
// [StoreOptions].AllowPlaintextPut is set to false. | |
func (ds *DynamicStore) Put(ctx context.Context, serverAddress string, cred auth.Credential) (returnErr error) { | |
if err := ds.getStore(serverAddress).Put(ctx, serverAddress, cred); err != nil { | |
return err | |
} | |
// save the detected creds store back to the config file on first put | |
ds.setCredsStoreOnce.Do(func() { | |
if ds.detectedCredsStore != "" { | |
if err := ds.config.SetCredentialsStore(ds.detectedCredsStore); err != nil { | |
returnErr = fmt.Errorf("failed to set credsStore: %w", err) | |
} | |
} | |
}) | |
return returnErr | |
} |
If ds.setCredsStoreOnce
fails on the first call to Put
, the subsequent calls to Put
will never attempt to set the credential store again but return success.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working