mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 18:08:51 +08:00 
			
		
		
		
	fix(deps): update github.com/containers/image/v5 digest to 2343e81
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
		
							
								
								
									
										28
									
								
								vendor/github.com/hashicorp/go-retryablehttp/client.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								vendor/github.com/hashicorp/go-retryablehttp/client.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -658,9 +658,9 @@ func (c *Client) Do(req *Request) (*http.Response, error) { | ||||
| 	if logger != nil { | ||||
| 		switch v := logger.(type) { | ||||
| 		case LeveledLogger: | ||||
| 			v.Debug("performing request", "method", req.Method, "url", req.URL) | ||||
| 			v.Debug("performing request", "method", req.Method, "url", redactURL(req.URL)) | ||||
| 		case Logger: | ||||
| 			v.Printf("[DEBUG] %s %s", req.Method, req.URL) | ||||
| 			v.Printf("[DEBUG] %s %s", req.Method, redactURL(req.URL)) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @ -715,9 +715,9 @@ func (c *Client) Do(req *Request) (*http.Response, error) { | ||||
| 		if err != nil { | ||||
| 			switch v := logger.(type) { | ||||
| 			case LeveledLogger: | ||||
| 				v.Error("request failed", "error", err, "method", req.Method, "url", req.URL) | ||||
| 				v.Error("request failed", "error", err, "method", req.Method, "url", redactURL(req.URL)) | ||||
| 			case Logger: | ||||
| 				v.Printf("[ERR] %s %s request failed: %v", req.Method, req.URL, err) | ||||
| 				v.Printf("[ERR] %s %s request failed: %v", req.Method, redactURL(req.URL), err) | ||||
| 			} | ||||
| 		} else { | ||||
| 			// Call this here to maintain the behavior of logging all requests, | ||||
| @ -753,7 +753,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) { | ||||
|  | ||||
| 		wait := c.Backoff(c.RetryWaitMin, c.RetryWaitMax, i, resp) | ||||
| 		if logger != nil { | ||||
| 			desc := fmt.Sprintf("%s %s", req.Method, req.URL) | ||||
| 			desc := fmt.Sprintf("%s %s", req.Method, redactURL(req.URL)) | ||||
| 			if resp != nil { | ||||
| 				desc = fmt.Sprintf("%s (status: %d)", desc, resp.StatusCode) | ||||
| 			} | ||||
| @ -818,11 +818,11 @@ func (c *Client) Do(req *Request) (*http.Response, error) { | ||||
| 	// communicate why | ||||
| 	if err == nil { | ||||
| 		return nil, fmt.Errorf("%s %s giving up after %d attempt(s)", | ||||
| 			req.Method, req.URL, attempt) | ||||
| 			req.Method, redactURL(req.URL), attempt) | ||||
| 	} | ||||
|  | ||||
| 	return nil, fmt.Errorf("%s %s giving up after %d attempt(s): %w", | ||||
| 		req.Method, req.URL, attempt, err) | ||||
| 		req.Method, redactURL(req.URL), attempt, err) | ||||
| } | ||||
|  | ||||
| // Try to read the response body so we can reuse this connection. | ||||
| @ -903,3 +903,17 @@ func (c *Client) StandardClient() *http.Client { | ||||
| 		Transport: &RoundTripper{Client: c}, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // Taken from url.URL#Redacted() which was introduced in go 1.15. | ||||
| // We can switch to using it directly if we'll bump the minimum required go version. | ||||
| func redactURL(u *url.URL) string { | ||||
| 	if u == nil { | ||||
| 		return "" | ||||
| 	} | ||||
|  | ||||
| 	ru := *u | ||||
| 	if _, has := ru.User.Password(); has { | ||||
| 		ru.User = url.UserPassword(ru.User.Username(), "xxxxx") | ||||
| 	} | ||||
| 	return ru.String() | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	![29139614+renovate[bot]@users.noreply.github.com](/assets/img/avatar_default.png) renovate[bot]
					renovate[bot]