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

Add a default A record for each VM #65

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

AlonaKaplan
Copy link
Member

@AlonaKaplan AlonaKaplan commented Oct 4, 2023

make vm.namespace.<cluster>. resolve to one of the VM-reported IP addresses. This may make it a bit easier to find the VM even if the user does not recall its interface names.

What this PR does / why we need it:
make vm.namespace.<cluster>. resolve to one of the VM-reported IP addresses. This may make it a bit easier to find the VM even if the user does not recall its interface names.

This intends to resolve https://issues.redhat.com/browse/CNV-30087

Special notes for your reviewer:
Finalizing PR #60

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Oct 4, 2023
Copy link
Collaborator

@oshoval oshoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Worth to describe please the the FQDN includes cluster_name vm.namespace.<cluster_name>. (as mentioned on ticket / done by tests)

Comment on lines 140 to 144
func getIPFromARecord(record string) string {
index := strings.Index(record, "IN A")
ipAddress := record[index+len("IN A"):]
return strings.TrimSpace(ipAddress)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider (it assumes there is a match, because we know exactly how the string is built)


var re = regexp.MustCompile(`IN A ([\d.]+)`)
...

func getIPFromARecord(record string) string {
	return re.FindStringSubmatch(record)[1]
}

or just to capture the IP during the loop here
https://github.com/kubevirt/kubesecondarydns/pull/65/files#diff-a30c82f2c74defbce7c4500610281c5da73d3882f7323c22a5223d1632a2011eR116

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@AlonaKaplan
Copy link
Member Author

Thanks

Worth to describe please the the FQDN includes cluster_name vm.namespace.<cluster_name>. (as mentioned on ticket / done by tests)

Describe where? It is written in the PR description - "make vm.namespace. resolve to one of the VM-reported IP addresses. "

@oshoval
Copy link
Collaborator

oshoval commented Oct 8, 2023

Thanks
Worth to describe please the the FQDN includes cluster_name vm.namespace.<cluster_name>. (as mentioned on ticket / done by tests)

Describe where? It is written in the PR description - "make vm.namespace. resolve to one of the VM-reported IP addresses. "

In the PR desc itself please, just to add there that <cluster_name> should be part of the query (PR desc atm doesn't mention <cluster_name> as part of the query)
Unless the servers have a suffix with cluster_name it won't find it.
Even the tests include it.

dankenigsberg and others added 2 commits October 8, 2023 10:37
make vm.namespace.<cluster> resolve to one of the VM-reported IP
addresses. This may make it a bit easier to find the VM even if the user
does not recall its interface names.

Signed-off-by: Dan Kenigsberg <[email protected]>
Signed-off-by: Alona Paz <[email protected]>
Signed-off-by: Alona Paz <[email protected]>
@oshoval
Copy link
Collaborator

oshoval commented Oct 8, 2023

/test pull-kubesecondarydns-e2e-k8s

failure not relevant
Error response from daemon: cannot listen on the TCP port: listen tcp4 :34873: bind: address already in use
we might want to try another random port when it creates the sockets

Copy link
Collaborator

@oshoval oshoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2023
@AlonaKaplan
Copy link
Member Author

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlonaKaplan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 8, 2023
@kubevirt-bot kubevirt-bot merged commit eb90ade into kubevirt:main Oct 8, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants