Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli prc command checks Container Pathing #74

Open
luthermonson opened this issue Dec 14, 2021 · 0 comments
Open

cli prc command checks Container Pathing #74

luthermonson opened this issue Dec 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@luthermonson
Copy link
Contributor

there's been a usability problem with wins for quite some time regarding the cli prc command. the idea is youre calling out to the host via grpc to execute the exe on the host. the process to do this is from a container and since this code here

func GetBinaryPath(binaryName string) (string, error) {
// find service abs path
p, err := exec.LookPath(binaryName)
if err != nil {
return "", err
}
p, err = filepath.Abs(p)
if err != nil {
return "", err
}
// detect service is file or not
fi, err := os.Stat(p)
if err == nil {
if !fi.IsDir() {
return p, nil
}
err = errors.Errorf("%s is directory", p)
}
if filepath.Ext(p) == "" {
p += ".exe"
fi, err := os.Stat(p)
if err == nil {
if !fi.IsDir() {
return p, nil
}
return "", errors.Errorf("%s is directory", p)
}
}
return "", err
}

this code is run in the container via cli prc and it checks the container for the binary and then calls the binary via grpc on the host meaning the binary has to be in both locations. in the container and on the host. we've basically been getting around this problem with copying files everywhere in run.ps1 powershell scripts.

proposal... add grpc logic so the cli prc command asks the host via the socket if the binary is there, is the right hash etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants