Merge pull request #13047 from cdoern/scpSyntax

podman image scp syntax correction
This commit is contained in:
OpenShift Merge Robot
2022-02-03 10:05:22 -05:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@ -146,6 +146,17 @@ func scp(cmd *cobra.Command, args []string) (finalErr error) {
return err
}
allLocal := true // if we are all localhost, do not validate connections but if we are using one localhost and one non we need to use sshd
for _, val := range cliConnections {
if !strings.Contains(val, "@localhost::") {
allLocal = false
break
}
}
if allLocal {
cliConnections = []string{}
}
var serv map[string]config.Destination
serv, err = GetServiceInformation(cliConnections, cfg)
if err != nil {

View File

@ -17,12 +17,13 @@ func parseImageSCPArg(arg string) (*entities.ImageScpOptions, []string, error) {
cliConnections := []string{}
switch {
case strings.Contains(arg, "@localhost"): // image transfer between users
case strings.Contains(arg, "@localhost::"): // image transfer between users
location.User = strings.Split(arg, "@")[0]
location, err = validateImagePortion(location, arg)
if err != nil {
return nil, nil, err
}
cliConnections = append(cliConnections, arg)
case strings.Contains(arg, "::"):
location, err = validateImagePortion(location, arg)
if err != nil {