vendor: github.com/docker/docker 92884c25b394 (v25.0.0-dev)
full diff: 4046ae5e2f...92884c25b3
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
26
vendor/github.com/docker/docker/api/types/configs.go
generated
vendored
26
vendor/github.com/docker/docker/api/types/configs.go
generated
vendored
@ -1,9 +1,5 @@
|
||||
package types // import "github.com/docker/docker/api/types"
|
||||
|
||||
// configs holds structs used for internal communication between the
|
||||
// frontend (such as an http server) and the backend (such as the
|
||||
// docker daemon).
|
||||
|
||||
// ExecConfig is a small subset of the Config struct that holds the configuration
|
||||
// for the exec feature of docker.
|
||||
type ExecConfig struct {
|
||||
@ -20,25 +16,3 @@ type ExecConfig struct {
|
||||
WorkingDir string // Working directory
|
||||
Cmd []string // Execution commands and args
|
||||
}
|
||||
|
||||
// PluginRmConfig holds arguments for plugin remove.
|
||||
type PluginRmConfig struct {
|
||||
ForceRemove bool
|
||||
}
|
||||
|
||||
// PluginEnableConfig holds arguments for plugin enable
|
||||
type PluginEnableConfig struct {
|
||||
Timeout int
|
||||
}
|
||||
|
||||
// PluginDisableConfig holds arguments for plugin disable.
|
||||
type PluginDisableConfig struct {
|
||||
ForceDisable bool
|
||||
}
|
||||
|
||||
// NetworkListConfig stores the options available for listing networks
|
||||
type NetworkListConfig struct {
|
||||
// TODO(@cpuguy83): naming is hard, this is pulled from what was being used in the router before moving here
|
||||
Detailed bool
|
||||
Verbose bool
|
||||
}
|
||||
|
||||
26
vendor/github.com/docker/docker/client/hijack.go
generated
vendored
26
vendor/github.com/docker/docker/client/hijack.go
generated
vendored
@ -16,7 +16,6 @@ import (
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
"go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
@ -66,7 +65,8 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (_ net.Conn,
|
||||
}
|
||||
|
||||
ctx, span := tp.Tracer("").Start(ctx, req.Method+" "+req.URL.Path, trace.WithSpanKind(trace.SpanKindClient))
|
||||
span.SetAttributes(httpconv.ClientRequest(req)...)
|
||||
// FIXME(thaJeztah): httpconv.ClientRequest is now an internal package; replace this with alternative for semconv v1.21
|
||||
// span.SetAttributes(httpconv.ClientRequest(req)...)
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
span.RecordError(retErr)
|
||||
@ -98,7 +98,27 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (_ net.Conn,
|
||||
// Server hijacks the connection, error 'connection closed' expected
|
||||
resp, err := clientconn.Do(req)
|
||||
if resp != nil {
|
||||
span.SetStatus(httpconv.ClientStatus(resp.StatusCode))
|
||||
// This is a simplified variant of "httpconv.ClientStatus(resp.StatusCode))";
|
||||
//
|
||||
// The main purpose of httpconv.ClientStatus() is to detect whether the
|
||||
// status was successful (1xx, 2xx, 3xx) or non-successful (4xx/5xx).
|
||||
//
|
||||
// It also provides complex logic to *validate* status-codes against
|
||||
// a hard-coded list meant to exclude "bogus" status codes in "success"
|
||||
// ranges (1xx, 2xx) and convert them into an error status. That code
|
||||
// seemed over-reaching (and not accounting for potential future valid
|
||||
// status codes). We assume we only get valid status codes, and only
|
||||
// look at status-code ranges.
|
||||
//
|
||||
// For reference, see:
|
||||
// https://github.com/open-telemetry/opentelemetry-go/blob/v1.21.0/semconv/v1.17.0/httpconv/http.go#L85-L89
|
||||
// https://github.com/open-telemetry/opentelemetry-go/blob/v1.21.0/semconv/internal/v2/http.go#L322-L330
|
||||
// https://github.com/open-telemetry/opentelemetry-go/blob/v1.21.0/semconv/internal/v2/http.go#L356-L404
|
||||
code := codes.Unset
|
||||
if resp.StatusCode >= http.StatusBadRequest {
|
||||
code = codes.Error
|
||||
}
|
||||
span.SetStatus(code, "")
|
||||
}
|
||||
|
||||
//nolint:staticcheck // ignore SA1019 for connecting to old (pre go1.8) daemons
|
||||
|
||||
Reference in New Issue
Block a user