2018-12-11 14:03:47 +00:00
package manager
2025-03-04 23:16:33 +01:00
import (
"os/exec"
"github.com/docker/cli/cli-plugins/metadata"
)
2018-12-11 14:03:47 +00:00
// Candidate represents a possible plugin candidate, for mocking purposes
type Candidate interface {
Path ( ) string
Metadata ( ) ( [ ] byte , error )
}
type candidate struct {
path string
}
func ( c * candidate ) Path ( ) string {
return c . path
}
func ( c * candidate ) Metadata ( ) ( [ ] byte , error ) {
2025-03-04 23:16:33 +01:00
return exec . Command ( c . path , metadata . MetadataSubcommandName ) . Output ( ) // #nosec G204 -- ignore "Subprocess launched with a potential tainted input or cmd arguments"
2018-12-11 14:03:47 +00:00
}