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

Panic if --docker-run --name uses space not '=' to separate option name from value #2953

Closed
ralph-mcardell opened this issue Dec 23, 2022 · 0 comments · Fixed by #2955
Closed
Assignees
Labels
bug Something isn't working

Comments

@ralph-mcardell
Copy link

Describe the bug

Just migrating from legacy telepresence and dropping in telepresence 2 with existing use of
legacy telepresence panicked.

Stack trace led me to the

startInDocker function in the

https://github.com/telepresenceio/telepresence/blob/release/v2/pkg/client/cli/intercept/state.go

file.

Specifically the attempt to extract the value of the '--name' option:

name, hasName := getArg("--name")

fails and panics in the getArg function:

if i+1 < len(args) {
   				return parts[i+1], true

As it is assumed the parts array has enough elements, which is not the case if the --name option is of the form

--name the-name

rather than:

--name=the-name

as the string is only split on '=':

   parts := strings.Split(arg, "=")

To Reproduce

run telepresence v2 using legacy options and in the --docker-run arguments specify --name the-name not --name=the-name

telepresence --swap-deployment deployment-name --namespace blah --docker-run --name the-name ...

Expected behavior
telepresence to not panic and to run the docker container as specified

Versions (please complete the following information):

  • all v2.9.5
  • Linux Alma 8
  • Rancher k3s
@thallgren thallgren added the bug Something isn't working label Dec 27, 2022
@thallgren thallgren self-assigned this Dec 27, 2022
@thallgren thallgren linked a pull request Jan 5, 2023 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

2 participants