mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-24 15:53:24 +00:00
Migrate to containerd 1.54
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
4c9c66812a
commit
2ae8b31ac0
8
vendor/github.com/containerd/containerd/diff/stream.go
generated
vendored
8
vendor/github.com/containerd/containerd/diff/stream.go
generated
vendored
@ -168,7 +168,11 @@ func (c *compressedProcessor) Close() error {
|
||||
return c.rc.Close()
|
||||
}
|
||||
|
||||
func BinaryHandler(id, returnsMediaType string, mediaTypes []string, path string, args []string) Handler {
|
||||
// BinaryHandler creates a new stream processor handler which calls out to the given binary.
|
||||
// The id is used to identify the stream processor and allows the caller to send
|
||||
// payloads specific for that stream processor (i.e. decryption keys for decrypt stream processor).
|
||||
// The binary will be called for the provided mediaTypes and return the given media type.
|
||||
func BinaryHandler(id, returnsMediaType string, mediaTypes []string, path string, args, env []string) Handler {
|
||||
set := make(map[string]struct{}, len(mediaTypes))
|
||||
for _, m := range mediaTypes {
|
||||
set[m] = struct{}{}
|
||||
@ -177,7 +181,7 @@ func BinaryHandler(id, returnsMediaType string, mediaTypes []string, path string
|
||||
if _, ok := set[mediaType]; ok {
|
||||
return func(ctx context.Context, stream StreamProcessor, payloads map[string]*types.Any) (StreamProcessor, error) {
|
||||
payload := payloads[id]
|
||||
return NewBinaryProcessor(ctx, mediaType, returnsMediaType, stream, path, args, payload)
|
||||
return NewBinaryProcessor(ctx, mediaType, returnsMediaType, stream, path, args, env, payload)
|
||||
}, true
|
||||
}
|
||||
return nil, false
|
||||
|
Reference in New Issue
Block a user