mirror of
https://github.com/docker/cli.git
synced 2026-09-26 01:10:35 -04:00
review changes
- fix lint issues
- use errors pkg for wrapping errors
- cleanup on error when setting up secrets mount
- fix erroneous import
- remove unneeded switch for secret reference mode
- return single mount for secrets instead of slice
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: 3f9494f1d6
Component: cli
This commit is contained in:
@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
@@ -31,6 +32,13 @@ func parseSecretString(secretString string) (string, string, error) {
|
||||
} else {
|
||||
targetName = secretName
|
||||
}
|
||||
|
||||
// ensure target is a filename only; no paths allowed
|
||||
tDir, _ := filepath.Split(targetName)
|
||||
if tDir != "" {
|
||||
return "", "", fmt.Errorf("target must not have a path")
|
||||
}
|
||||
|
||||
return secretName, targetName, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user