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

crane-agent can not connect the existing runtime endpint when using default runtime endpoint #857

Closed
xrmzju opened this issue Aug 30, 2023 · 0 comments · Fixed by #858
Closed
Assignees
Labels
kind/bug Something isn't working

Comments

@xrmzju
Copy link
Contributor

xrmzju commented Aug 30, 2023

Describe the bug
in current logic, crane-agent will connect the given runtimeEndpoint first if --runtime-endpoint args was given

       var runtimeEndpoints []string
	if runtimeEndpoint != "" {
		runtimeEndpoints = append(runtimeEndpoints, runtimeEndpoint)
	}
	runtimeEndpoints = append(runtimeEndpoints, defaultRuntimeEndpoints...)

but in NewRemoteRuntimeService func, it will dial the socket in none-block mode, which will return success immediately even the runtimeEnpoint not exist

     for _, endpoint := range runtimeEndpoints {
		containerRuntime, err := criremote.NewRemoteRuntimeService(endpoint, 3*time.Second)
		if err == nil {
			return containerRuntime, nil
		}
		errs = append(errs, err)
	}

Reproduce steps

  1. set the crane-agent with none-existing runtime endpoint
--runtime-endpoint=unix:///var/run/none.sock
  1. crane-agent panic with a bad runtimeService conn
    Expected behavior
  2. connect with the given runtime endpoint only
  3. if no runtime endpoint given, try the default runtime-endpoint list one by one until found a real success one(by dial in block mode)
    Screenshots

Environment (please complete the following information):

  • K8S Version: [e.g. 1.19]
  • Crane Version: [e.g. 0.1.0]
  • Browser [e.g. chrome, safari]
@xrmzju xrmzju added the kind/bug Something isn't working label Aug 30, 2023
@qmhu qmhu closed this as completed in #858 Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant