mirror of https://github.com/docker/cli.git
cli/command/image/build_buildkit.go:450:56: parseSSH - result 1 (error) is always nil (unparam)
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
parent
0ce2eae5a2
commit
28ac2f82c6
|
@ -476,16 +476,13 @@ func parseSecret(value string) (*secretsprovider.FileSource, error) {
|
||||||
func parseSSHSpecs(sl []string) (session.Attachable, error) {
|
func parseSSHSpecs(sl []string) (session.Attachable, error) {
|
||||||
configs := make([]sshprovider.AgentConfig, 0, len(sl))
|
configs := make([]sshprovider.AgentConfig, 0, len(sl))
|
||||||
for _, v := range sl {
|
for _, v := range sl {
|
||||||
c, err := parseSSH(v)
|
c := parseSSH(v)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
configs = append(configs, *c)
|
configs = append(configs, *c)
|
||||||
}
|
}
|
||||||
return sshprovider.NewSSHAgentProvider(configs)
|
return sshprovider.NewSSHAgentProvider(configs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseSSH(value string) (*sshprovider.AgentConfig, error) {
|
func parseSSH(value string) *sshprovider.AgentConfig {
|
||||||
parts := strings.SplitN(value, "=", 2)
|
parts := strings.SplitN(value, "=", 2)
|
||||||
cfg := sshprovider.AgentConfig{
|
cfg := sshprovider.AgentConfig{
|
||||||
ID: parts[0],
|
ID: parts[0],
|
||||||
|
@ -493,5 +490,5 @@ func parseSSH(value string) (*sshprovider.AgentConfig, error) {
|
||||||
if len(parts) > 1 {
|
if len(parts) > 1 {
|
||||||
cfg.Paths = strings.Split(parts[1], ",")
|
cfg.Paths = strings.Split(parts[1], ",")
|
||||||
}
|
}
|
||||||
return &cfg, nil
|
return &cfg
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue