vendor in latest containers/(storage,common,image)

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2022-04-21 15:15:41 -04:00
parent 121dde6234
commit 17105028e5
54 changed files with 439 additions and 2083 deletions

View File

@@ -3,12 +3,12 @@ package shelldriver
import (
"bytes"
"context"
"fmt"
"os"
"os/exec"
"sort"
"strings"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
)
@@ -27,22 +27,33 @@ var (
type driverConfig struct {
// DeleteCommand contains a shell command that deletes a secret.
// The secret id is provided as environment variable SECRET_ID
DeleteCommand string `mapstructure:"delete"`
DeleteCommand string
// ListCommand contains a shell command that lists all secrets.
// The output is expected to be one id per line
ListCommand string `mapstructure:"list"`
ListCommand string
// LookupCommand contains a shell command that retrieves a secret.
// The secret id is provided as environment variable SECRET_ID
LookupCommand string `mapstructure:"lookup"`
LookupCommand string
// StoreCommand contains a shell command that stores a secret.
// The secret id is provided as environment variable SECRET_ID
// The secret value itself is provided over stdin
StoreCommand string `mapstructure:"store"`
StoreCommand string
}
func (cfg *driverConfig) ParseOpts(opts map[string]string) error {
if err := mapstructure.Decode(opts, cfg); err != nil {
return err
for key, value := range opts {
switch key {
case "delete":
cfg.DeleteCommand = value
case "list":
cfg.ListCommand = value
case "lookup":
cfg.LookupCommand = value
case "store":
cfg.StoreCommand = value
default:
return fmt.Errorf("invalid shell driver option: %q", key)
}
}
if cfg.DeleteCommand == "" ||
cfg.ListCommand == "" ||