mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 04:03:20 +00:00
Merge pull request #100177 from wangyx1992/wrapped-error
fix errors in wrapped format
This commit is contained in:
@@ -35,12 +35,12 @@ func readCredentialProviderConfigFile(configPath string) (*kubeletconfig.Credent
|
||||
|
||||
data, err := ioutil.ReadFile(configPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to read external registry credential provider configuration from %q: %v", configPath, err)
|
||||
return nil, fmt.Errorf("unable to read external registry credential provider configuration from %q: %w", configPath, err)
|
||||
}
|
||||
|
||||
config, err := decode(data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error decoding config %s: %v", configPath, err)
|
||||
return nil, fmt.Errorf("error decoding config %s: %w", configPath, err)
|
||||
}
|
||||
|
||||
return config, nil
|
||||
|
@@ -328,7 +328,7 @@ func (e *execPlugin) ExecPlugin(ctx context.Context, image string) (*credentialp
|
||||
authRequest := &credentialproviderapi.CredentialProviderRequest{Image: image}
|
||||
data, err := e.encodeRequest(authRequest)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to encode auth request: %v", err)
|
||||
return nil, fmt.Errorf("failed to encode auth request: %w", err)
|
||||
}
|
||||
|
||||
stdout := &bytes.Buffer{}
|
||||
@@ -385,7 +385,7 @@ func (e *execPlugin) ExecPlugin(ctx context.Context, image string) (*credentialp
|
||||
func (e *execPlugin) encodeRequest(request *credentialproviderapi.CredentialProviderRequest) ([]byte, error) {
|
||||
data, err := runtime.Encode(e.encoder, request)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error encoding request: %v", err)
|
||||
return nil, fmt.Errorf("error encoding request: %w", err)
|
||||
}
|
||||
|
||||
return data, nil
|
||||
|
Reference in New Issue
Block a user