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

Specifying a port in the connection string incorrectly adds the port to the name of the host #1124

Closed
memetb opened this issue Oct 29, 2024 · 0 comments

Comments

@memetb
Copy link
Contributor

memetb commented Oct 29, 2024

This issue relates to #1116.

System Information

Linux distribution

Debian 6.1.94-1 (2024-06-21) x86_64 GNU/Linux

Terraform version

Terraform v1.5.7
on linux_amd64

Provider and libvirt versions

v0.8.1

Description of Issue/Question

Setup

As per the comment here, the name passed to the virConnectOpen should be stripped of port names.

// According to https://libvirt.org/uri.html
// The name passed to the remote virConnectOpen function is formed by removing
// transport, hostname, port number, username and extra parameters from the remote URI
// unless the name option is specified.

However, it seems specifying a port name does not correctly do this. This bug is subtle, however adding a test scenario reveals its presence. It also affects ssh-config based settings (specifically #1116) because the server name becomes incorrectly parsed as the string "servername:port" instead of "servername", causing the ssh_config to fail loading specific settings.

This code affects this call. However, I do not know how it affects the operation of virConnectOpen itself.

	if err := l.ConnectToURI(libvirt.ConnectURI(u.RemoteName())); err != nil {
@memetb memetb closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant