mirror of
				https://github.com/containers/podman.git
				synced 2025-11-01 02:42:11 +08:00 
			
		
		
		
	 598fc516a6
			
		
	
	598fc516a6
	
	
	
		
			
			The change in healthcheck_run_test.go, depends on the
containers/image change:
commit b6afa8ca7b324aca8fd5a7b5b206fc05c0c04874
Author: Mikhail Sokolov <msokolov@evolution.com>
Date:   Fri Mar 15 13:37:44 2024 +0200
    Add support for Docker HealthConfig.StartInterval (v25.0.0+)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			793 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			793 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2014 The Go Authors. All rights reserved.
 | |
| // Use of this source code is governed by a BSD-style
 | |
| // license that can be found in the LICENSE file.
 | |
| 
 | |
| package internal
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"net/http"
 | |
| )
 | |
| 
 | |
| // HTTPClient is the context key to use with golang.org/x/net/context's
 | |
| // WithValue function to associate an *http.Client value with a context.
 | |
| var HTTPClient ContextKey
 | |
| 
 | |
| // ContextKey is just an empty struct. It exists so HTTPClient can be
 | |
| // an immutable public variable with a unique type. It's immutable
 | |
| // because nobody else can create a ContextKey, being unexported.
 | |
| type ContextKey struct{}
 | |
| 
 | |
| func ContextClient(ctx context.Context) *http.Client {
 | |
| 	if ctx != nil {
 | |
| 		if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok {
 | |
| 			return hc
 | |
| 		}
 | |
| 	}
 | |
| 	return http.DefaultClient
 | |
| }
 |